Boost logo

Boost :

From: Kaercher, Joerg (jkaercher_at_[hidden])
Date: 2001-09-24 15:22:04


in my project I have several C++ classes which are wrapped with
boost.python. Everything works nicely under Windows (using VisualC++) but
under Linux (using g++) the software crashes whenever I wrap more than one
class. Here is what gdb tells me about it:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (runnable)]
0x0 in ?? ()
(gdb) where
#0 0x0 in ?? ()
#1 0x401b8cd8 in
(this=0x80e3730, obj=0x810b170) at classes.cpp:346
#2 0x401c3131 in do_instance_dealloc.6 (obj=0x810b170) at types.cpp:208
#3 0x808d971 in PyDict_DelItem (op=0x80d0e9c, key=0x80cf9b8) at
#4 0x8057048 in eval_code2 (co=0x80d7d98, globals=0x80d0e9c,
locals=0x80d0e9c, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0,
defcount=0, closure=0x0) at Python/ceval.c:1528
#5 0x8055088 in PyEval_EvalCode (co=0x80d7d98, globals=0x80d0e9c,
locals=0x80d0e9c) at Python/ceval.c:341
#6 0x806dbb3 in run_node (n=0x80dab10, filename=0xbffff664 "",
globals=0x80d0e9c, locals=0x80d0e9c, flags=0xbffff408) at
#7 0x806db66 in run_err_node (n=0x80dab10, filename=0xbffff664 "",
globals=0x80d0e9c, locals=0x80d0e9c, flags=0xbffff408) at
#8 0x806db2e in PyRun_FileExFlags (fp=0x80cc588, filename=0xbffff664
"", start=257, globals=0x80d0e9c, locals=0x80d0e9c, closeit=1,
    at Python/pythonrun.c:1023
#9 0x806cea1 in PyRun_SimpleFileExFlags (fp=0x80cc588, filename=0xbffff664
"", closeit=1, flags=0xbffff408) at Python/pythonrun.c:665
#10 0x806c96c in PyRun_AnyFileExFlags (fp=0x80cc588, filename=0xbffff664
"", closeit=1, flags=0xbffff408) at Python/pythonrun.c:479
#11 0x8051e44 in Py_Main (argc=2, argv=0xbffff494) at Modules/main.c:320
#12 0x80518c6 in main (argc=2, argv=0xbffff494) at Modules/python.c:10
#13 0x40069a8e in __libc_start_main (main=0x80518b0 <main>, argc=2,
argv=0xbffff494, init=0x8050d8c <_init>, fini=0x80a2edc <_fini>,
rtld_fini=0x4000aa20 <_dl_fini>,
    stack_end=0xbffff48c) at ../sysdeps/generic/libc-start.c:92

#1 translates to
"boost::python::detail::class_base::instance_dealloc(_object*) const" and
the declaration of class_base in classes.hpp shows that instance_dealloc()
is a pure virtual function.
#0 seems to indicate that the compiler did not replace this member function
in the class_t class which inherits from class_base and (re)implements

The problem occurs with g++ 3.0.1 and g++ 2.95.2.

Did anybody have the same problem and found a solution?

Any help is appreciated.


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