Boost logo

Boost :

From: Andreas Dietrich (quasi_at_[hidden])
Date: 2001-08-16 18:25:33


The following code results in a segfault when calling test from python:

#include <Python.h>

namespace {

   PyObject *test(int l,int h){
      // not reached
      return 0;
#include <boost/python/class_builder.hpp>
namespace python = boost::python;
  try {
    python::module_builder this_module("crash");
  catch(...) {

My setup:


$ g++-2.96 -v
Reading specs from /usr/lib/gcc-lib/i586-mandrake-linux-gnu/2.96/specs
gcc version 2.96 20000731 (Mandrake Linux 8.1 2.96-0.58mdk)

I tried python 2.0, 2.1 each with and without exceptions enabled when
compiling bpl and crash.cpp. All with the same result, import crash works
fine, crash.test(1,1) segfaults.

Can anybody help me? I tried to look at it in a debugger, but I don't even
begin to understand the magic inside of boost::python :-(


"We've heard that a million monkeys at a million keyboards could produce the
complete works of Shakespeare. Now, thanks to the Internet, we know this is not
true."  -- Robert Wilensky

Boost list run by bdawes at, gregod at, cpdaniel at, john at