[PyKDE] bug in QObject.emit

Patrick Stinson ajole-1 at gci.net
Tue Feb 10 10:13:01 GMT 2004


replicable code, minus debugging output:

ajole at ajole pksampler $ python
Python 2.3.3 (#1, Jan 27 2004, 10:43:25) 
[GCC 3.2.3 20030422 (Gentoo Linux 1.4 3.2.3-r3, propolice)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from qt import * 
>>> class QO(QObject):
...     def __init__(self):
...             QObject.__init__(self)
...     def slotEmit(self):
...             QObject.emit(self, PYSIGNAL('thisbuggersit'), ())
... 
>>> a = QApplication([])
>>> b = QPushButton()
>>> b = QPushButton(None)
>>> o = QO()
>>> QObject.connect(b, SIGNAL('clicked()'), o.slotEmit) 
True
>>> b.show()
>>> a.setMainWidget(b)
>>> a.exec_loop()

** click **

Segmentation fault
ajole at ajole pksampler $ 

this is my call/stack trace:

SegFault: [ C stack trace ]

#50  0x080ba16c in PyEval_EvalCode()
#49  0x080c18a7 in PyEval_EvalCodeEx()
#48  0x080bfaa7 in eval_frame()
#47  0x080c3391 in call_function()
#46  0x0810dec2 in PyCFunction_Call()
#45  0x40a15251 in _Z27meth_QApplication_exec_loopP7_objectS0_()
#44  0x40db8161 in _ZN12QApplication4execEv()
#43  0x40dcb018 in _ZN10QEventLoop4execEv()
#42  0x40dcb176 in _ZN10QEventLoop9enterLoopEv()
#41  0x40d63aa7 in _ZN10QEventLoop13processEventsEj()
#40  0x40d4d179 in _ZN12QApplication15x11ProcessEventEP7_XEvent()
#39  0x40d4f9e8 in _ZN9QETWidget19translateMouseEventEPK7_XEvent()
#38  0x40a12eae in _ZN15sipQApplication6notifyEP7QObjectP6QEvent()
#37  0x40db73f8 in _ZN12QApplication6notifyEP7QObjectP6QEvent()
#36  0x40db7f15 in _ZN12QApplication14internalNotifyEP7QObjectP6QEvent()
#35  0x40792934 in _ZN14sipQPushButton5eventEP6QEvent()
#34  0x40e4751c in _ZN7QWidget5eventEP6QEvent()
#33  0x40793f75 in _ZN14sipQPushButton17mouseReleaseEventEP11QMouseEvent()
#32  0x4064f322 in _Z11sipVH_qt_3516PyGILState_STATEP7_objectP11QMouseEvent()
#31  0x41262fe4 in sip_api_call_method()
#30  0x080c3021 in PyEval_CallObjectWithKeywords()
#29  0x0805c4fe in PyObject_Call()
#28  0x080643d1 in instancemethod_call()
#27  0x0805c4fe in PyObject_Call()
#26  0x0810d711 in function_call()
#25  0x080c18a7 in PyEval_EvalCodeEx()
#24  0x080bfaa7 in eval_frame()
#23  0x080c3391 in call_function()
#22  0x0810dec2 in PyCFunction_Call()
#21  0x407998d8 in _Z34meth_QPushButton_mouseReleaseEventP7_objectS0_()
#20  0x407969d8 in 
_ZN14sipQPushButton28sipProtect_mouseReleaseEventEP11QMouseEvent()
#19  0x40e9ebfa in _ZN7QButton17mouseReleaseEventEP11QMouseEvent()
#18  0x4113321e in _ZN7QButton7clickedEv()
#17  0x40e12bb4 in _ZN7QObject15activate_signalEi()
#16  0x40e12d80 in _ZN7QObject15activate_signalEP15QConnectionListP8QUObject()
#15  0x40a48356 in _ZN11sipProxy_qt9qt_invokeEiP8QUObject()
#14  0x4064c632 in _ZN11sipProxy_qt9proxySlotEv()
#13  0x41269224 in sip_api_emit_to_slot()
#12  0x412694b1 in _Z10emitToSlotP8_sipSlotP7_object()
#11  0x080c3021 in PyEval_CallObjectWithKeywords()
#10  0x0805c4fe in PyObject_Call()
#9   0x080643d1 in instancemethod_call()
#8   0x0805c4fe in PyObject_Call()
#7   0x0810d711 in function_call()
#6   0x080c18a7 in PyEval_EvalCodeEx()
#5   0x080bfaa7 in eval_frame()
#4   0x080c3391 in call_function()
#3   0x0810dec2 in PyCFunction_Call()
#2   0x40a22a27 in _Z17meth_QObject_emitP7_objectS0_()
#1   0x41268ff1 in sip_api_emit_signal()
#0   0x4126713f in sip_api_get_cpp_ptr()



I know that isn't the indended use of emit(), but it shouldn't seg fault 
anyway...

I use sip 4.0 (4.0rc2-SIP4-160) , PyQt-snapshot-20040104, and the above 
python, all compiled with debugging symbols.




More information about the PyQt mailing list