[PyQt] CoreDump when calling slot with 'const char*' arguement

Alexis Boutillier alexis.boutillier at arteris.com
Thu Apr 9 18:29:18 BST 2009


I'm having a core dump when connecting a signal define in a PyQt wrapped 
c++ class to a python method.
The c++ signal have (const char*, int, int, int, int) as arguments.

I investigate the core and found that the problem is in the conversion 
from c++ types to python types:

in #11 0x00726c94 in PyQtProxy::invokeSlot (slot=@0x91104f4, 
qargs=0xbfffac24) at qpycore_pyqtproxy.cpp:444
A tuple is filed with the C++ element converted to python.
Looking at the element in the tuple, the "int" are correctly added but 
the "const char *" is not (can't print it with 

Looking further, in PyObject *Chimera::toPyObject(void *cpp) const,
The "int" parameters have the metatype 2 corresponding to QMetaType::Int 
which is OK
But the "const char *" have metatype 256 which is PyQt_PyObject::metatype

Looking at what was done in PyQt 4.4.4, in PyQt 4.5.xxxx there is no 
call to PyString_FromString to convert a "const char*" is it done by the 
sipConvertFromType(cpp, _type, 0);

Can someone help me for where to continue investigate this problem ?


sip 4.8.20090401
PyQt 4.5-20090401
qt 4.5.0
python 2.6.0

Boutillier Alexis
Methodology engineer

Arteris SA
The Network-on-Chip Company TM

6 par Ariane Immeuble Mercure
78284 Guyancourt Cedex
Office: (+33) 1 61 37 38 71
Fax:    (+33) 1 61 37 38 41
Alexis.Boutillier at arteris.net
-------------- next part --------------
#0  0x874f050d in ?? ()
#1  0x004da086 in internal_print (op=0x9128708, fp=0xacd5c0, flags=11326912, nesting=0) at Objects/object.c:309
#2  0x004bd360 in PyFile_WriteObject (v=0x9128708, f=0xb7f4c070, flags=1) at Objects/fileobject.c:116
#3  0x00534c40 in PyEval_EvalFrameEx (f=0x9145004, throwflag=0) at Python/ceval.c:1598
#4  0x00537f3c in PyEval_EvalCodeEx (co=0xb48ff1d0, globals=0x874f050d, locals=0x312d6b, args=0x9145004, argcount=6, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0)
    at Python/ceval.c:2942
#5  0x004c5274 in function_call (func=0xb49103ac, arg=0xb49179bc, kw=0x0) at Objects/funcobject.c:524
#6  0x00499d5b in PyObject_Call (func=0xb49103ac, arg=0x312d6b, kw=0x312d6b) at Objects/abstract.c:2487
#7  0x004adcbe in instancemethod_call (func=0x312d6b, arg=0xb49179bc, kw=0x312d6b) at Objects/classobject.c:2579
#8  0x00499d5b in PyObject_Call (func=0xb6c29e64, arg=0x312d6b, kw=0x312d6b) at Objects/abstract.c:2487
#9  0x005307af in PyEval_CallObjectWithKeywords (func=0x312d6b, arg=0xb49170bc, kw=0x0) at Python/ceval.c:3551
#10 0x0042c5ae in sip_api_invoke_slot (slot=0x9130a2c, sigargs=0xb49170bc) at qtlib.c:191
#11 0x04789c94 in PyQtProxy::invokeSlot (slot=@0x9130a2c, qargs=0xbfffac24) at qpycore_pyqtproxy.cpp:444
#12 0x04789b16 in PyQtProxy::unislot (this=0x9130a10, qargs=0xbfffac10) at qpycore_pyqtproxy.cpp:398
#13 0x04789a61 in PyQtProxy::qt_metacall (this=0x9130a10, _c=QMetaObject::InvokeMetaMethod, _id=1, _a=0xbfffac10) at qpycore_pyqtproxy.cpp:366
#14 0x0179295e in QMetaObject::activate (sender=0x91277d0, from_signal_index=34, to_signal_index=34, argv=0xbfffac10) at kernel/qobject.cpp:3060
#15 0x01792ff4 in QMetaObject::activate (sender=0x91277d0, m=0x312d6b, local_signal_index=7, argv=0x312d6b) at kernel/qobject.cpp:3134
#16 0x04d43481 in NlvQWidget::bindCallback (this=0x91277d0, _t1=0x9128708 "hlick-1", _t2=89, _t3=96, _t4=89, _t5=96) at moc_wrapper.cpp:568
#17 0x04d3c0e6 in NlvQWidget::emitBindcallback (this=0x91277d0, binding_type=0x9128708 "hlick-1", down_x=89, down_y=96, up_x=89, up_y=96) at ../../src/wrapper.cpp:943
## CUT ##

More information about the PyQt mailing list