[C++-sig] Can boost.python and PyQt be used together?

Paul F. Kunz Paul_Kunz at SLAC.Stanford.EDU
Sun Dec 8 20:48:36 CET 2002

>>>>> On Sun, 08 Dec 2002 12:15:23 -0500, David Abrahams <dave at boost-consulting.com> said:

> Of course, the only way I'd be able to know for sure would be to see
> more of the stack trace, and some of the variable values (e.g. the
> attribute name) wouldn't hurt...

(gdb) run
Starting program: /usr/local/bin/python /home/pfkeb/hippodraw-BUILD/testsuite/dclock.py
[New Thread 1024 (LWP 17399)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 17399)]
PyErr_SetObject (exception=0x81103c4, value=0x82c3db0) at Python/errors.c:39

gdb is pointing to this line

	oldtype = tstate->curexc_type;

(gdb) p tstate
$1 = (PyThreadState *) 0x0

(gdb) bt
#0  PyErr_SetObject (exception=0x81103c4, value=0x82c3db0)
    at Python/errors.c:39
#1  0x0808827b in PyErr_SetString (exception=0x81103c4, 
    string=0x80d1641 "tuple index out of range") at Python/errors.c:70
#2  0x0805ea1c in tupleitem (a=0x810598c, i=1) at Objects/tupleobject.c:283
#3  0x080ade3c in PySequence_GetItem (s=0x810598c, i=1)
    at Objects/abstract.c:1106
#4  0x080c0df0 in iter_iternext (iterator=0x82d0760) at Objects/iterobject.c:75
#5  0x080ad396 in PyIter_Next (iter=0x82d0760) at Objects/abstract.c:2092
#6  0x080ac23b in PySequence_List (v=0x810598c) at Objects/abstract.c:1401
#7  0x0805f841 in mro_implementation (type=0x40ca2460)
    at Objects/typeobject.c:756
#8  0x0805f8ce in mro_internal (type=0x40ca2460) at Objects/typeobject.c:792
#9  0x08061d0c in PyType_Ready (type=0x40ca2460) at Objects/typeobject.c:2170
#10 0x40c83ade in boost::python::objects::make_nurse_and_patient ()
   from /usr/local/boost/libboost_python.so.1.29.0
#11 0x0815e304 in ?? ()
Cannot access memory at address 0x2

Hmmm.   This is different from yesterday.   No sign of going thru
libsip.so, for example.   The only change in my code was to follow
David's suggestion of `return_internal_reference<>'.

   Its beginning to look like there is really something wrong with my
code or my Boost.Python wrapping. :-(  

More information about the Cplusplus-sig mailing list