[C++-sig] segmentation fault in Boost.Python/Python C api

Ralf W. Grosse-Kunstleve rwgk at yahoo.com
Fri Feb 10 05:45:27 CET 2006


Compile with -O0 -g, then run your application or script with valgrind
(http://valgrind.org/). Be sure to use the valgrind suppression file
Misc/valgrind-python.supp that comes with Python 2.4 or higher. There should be
0 valgrind errors, otherwise there are almost certainly bugs in your code. I
run valgrind 3.1.0 routinely on both 32-bit and 64-bit Linux and I know all of
Boost.Python is clean.

Cheers,
        Ralf

--- Umang Jaipuria <umangjaipuria at gmail.com> wrote:

> My application uses Boost.Python 1.33.1 and there was a segfault with a core 
> dump. The stack trace follows.
> I'll grateful if anyone can point me in the right direction to figuring out 
> what the problem is.
> 
> Thanks,
> Umang Jaipuria
> 
> #0  0x00c6d002 in free () from /lib/tls/libc.so.6
> #1  0x00da92de in PyObject_Free (p=0x5c30) at Objects/obmalloc.c:774
> #2  0x00da8d5d in PyMem_Free (p=0x0) at Objects/object.c:2111
> #3  0x0043b3a9 in boost::python::instance_holder::deallocate () from 
> /usr/local/lib/libboost_python-gcc-mt-1_33_1.so.1.33.1
> #4  0x0043b412 in boost::python::instance_holder::deallocate () from 
> /usr/local/lib/libboost_python-gcc-mt-1_33_1.so.1.33.1
> #5  0x00db44ff in subtype_dealloc (self=0xb746ff2c) at 
> Objects/typeobject.c:703
> #6  0x00db25d1 in tupledealloc (op=0xb74659bc) at Objects/tupleobject.c:145
> #7  0x00ddd6a0 in eval_frame (f=0xa37737c) at Python/ceval.c:3652
> #8  0x00dde27b in PyEval_EvalCodeEx (co=0xb745f420, globals=0x4, locals=0x0, 
> args=0x0, argcount=2, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0)
>     at Python/ceval.c:2669
> #9  0x00d94458 in function_call (func=0xb7466294, arg=0xb7470eec, kw=0x0) at 
> Objects/funcobject.c:504
> #10 0x00d7c0d7 in PyObject_Call (func=0x1, arg=0x0, kw=0x0) at 
> Objects/abstract.c:1755
> #11 0x00dd7818 in PyEval_CallObjectWithKeywords (func=0x0, arg=0xb7470eec, 
> kw=0x0) at Python/ceval.c:3352
> #12 0x00e004a9 in PyEval_CallFunction (obj=0x0, format=0x0) at 
> Python/modsupport.c:477
> #13 0x0114f9bc in boost::python::call<myapp::action, 
> boost::reference_wrapper<myapp::context_collection>, 
> boost::reference_wrapper<myapp::rule* const> > (callable=0x0, a0=@0x0, 
> a1=@0x0) at handle.hpp:63
> 
> 
> 
> 
> _______________________________________________
> C++-sig mailing list
> C++-sig at python.org
> http://mail.python.org/mailman/listinfo/c++-sig
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the Cplusplus-sig mailing list