[PyQt] random deadlocks in pyqt application

Erik Janssens tw55413 at gmail.com
Sun Aug 30 10:22:30 BST 2009


Hi,

I'm having random deadlocks in my pyqt application (I don't do
any locking and such in the app itself, but the app has
2 QThreads).

They appear to occur random when the application is used like
a madman (opening and closing windows all the time).  A strange
observation is that the chances for deadlock are higher when using
xvfb instead of the normal x display.  (I use this for running
unittests overnight)

I'm running Ubuntu 9.04 using python2.5 (the deadlocks also 
appear when using python2.6)

The first line in the stack trace is always :

"xcb_wait_for_reply () from /usr/lib/libxcb.so.1"

Has anybody seen this before or can give me a clue on how
to proceed with this issue ?

Thx,

Erik
-------------- next part --------------
Program received signal SIGINT, Interrupt.
[Switching to Thread 0xb7d8b8d0 (LWP 5820)]
0xb7f4d430 in __kernel_vsyscall ()
(gdb) bt
#0  0xb7f4d430 in __kernel_vsyscall ()
#1  0xb7e687b1 in select () from /lib/tls/i686/cmov/libc.so.6
#2  0xb632fca7 in ?? () from /usr/lib/libxcb.so.1
#3  0xb6331a12 in xcb_wait_for_reply () from /usr/lib/libxcb.so.1
#4  0xb6406cae in _XReply () from /usr/lib/libX11.so.6
#5  0xb63e33b9 in XGetImage () from /usr/lib/libX11.so.6
#6  0xb68327ef in ?? () from /usr/lib/libQtGui.so.4
#7  0xb682003b in QPixmap::toImage () from /usr/lib/libQtGui.so.4
#8  0xb67e2cc3 in QWidgetPrivate::setWindowIcon_sys () from /usr/lib/libQtGui.so.4
#9  0xb67aa100 in QWidget::create () from /usr/lib/libQtGui.so.4
#10 0xb67a50c8 in QWidgetPrivate::createWinId () from /usr/lib/libQtGui.so.4
#11 0xb67e54e9 in QWidgetPrivate::setParent_sys () from /usr/lib/libQtGui.so.4
#12 0xb67ab645 in QWidget::setParent () from /usr/lib/libQtGui.so.4
#13 0xb67abe7e in QWidget::setParent () from /usr/lib/libQtGui.so.4
#14 0xb6bd77f6 in QMenuBar::setCornerWidget () from /usr/lib/libQtGui.so.4
#15 0xb6bb8937 in ?? () from /usr/lib/libQtGui.so.4
#16 0xb6bb9400 in ?? () from /usr/lib/libQtGui.so.4
#17 0xb6bc044a in ?? () from /usr/lib/libQtGui.so.4
#18 0xb6bc2425 in QMdiSubWindow::changeEvent () from /usr/lib/libQtGui.so.4
#19 0xb67a752f in QWidget::event () from /usr/lib/libQtGui.so.4
#20 0xb6bc107a in QMdiSubWindow::event () from /usr/lib/libQtGui.so.4
#21 0xb6750e9c in QApplicationPrivate::notify_helper () from /usr/lib/libQtGui.so.4
#22 0xb6759282 in QApplication::notify () from /usr/lib/libQtGui.so.4
#23 0xb7428613 in sipQApplication::notify (this=0xa1552b0, a0=0xc42d140, a1=0xbff68bb8) at sipQtGuipart9.cpp:20607
#24 0xb78a3a3b in QCoreApplication::notifyInternal () from /usr/lib/libQtCore.so.4
#25 0xb67e99e7 in QWidget::setWindowState () from /usr/lib/libQtGui.so.4
#26 0xb679c525 in QWidget::showMaximized () from /usr/lib/libQtGui.so.4
#27 0xb6bc1c1d in QMdiSubWindow::eventFilter () from /usr/lib/libQtGui.so.4
#28 0xb78a2c5a in QCoreApplicationPrivate::sendThroughObjectEventFilters () from /usr/lib/libQtCore.so.4
#29 0xb6750e7a in QApplicationPrivate::notify_helper () from /usr/lib/libQtGui.so.4
#30 0xb6759282 in QApplication::notify () from /usr/lib/libQtGui.so.4
#31 0xb7428613 in sipQApplication::notify (this=0xa1552b0, a0=0xc2b52f8, a1=0xbff69168) at sipQtGuipart9.cpp:20607
#32 0xb78a3a3b in QCoreApplication::notifyInternal () from /usr/lib/libQtCore.so.4
#33 0xb67e99e7 in QWidget::setWindowState () from /usr/lib/libQtGui.so.4
#34 0xb679c525 in QWidget::showMaximized () from /usr/lib/libQtGui.so.4
#35 0xb741060a in meth_QWidget_showMaximized (sipSelf=0xc91ab2c, sipArgs=0xb7d4b02c) at sipQtGuipart9.cpp:68687
#36 0x080ceb42 in PyEval_EvalFrameEx (f=0xa23b054, throwflag=0) at ../Python/ceval.c:3612
#37 0x080cfea5 in PyEval_EvalCodeEx (co=0xa493068, globals=0xa185604, locals=0x0, args=0xcb365b8, argcount=2, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0) at ../Python/ceval.c:2875
#38 0x08117511 in function_call (func=0xa521bc4, arg=0xcb365ac, kw=0x0) at ../Objects/funcobject.c:517
#39 0x0805d897 in PyObject_Call (func=0xbff67cac, arg=0xcb365ac, kw=0x0) at ../Objects/abstract.c:1861
#40 0x08063aaa in instancemethod_call (func=0xa521bc4, arg=0xcb365ac, kw=0x0) at ../Objects/classobject.c:2519
#41 0x0805d897 in PyObject_Call (func=0xbff67cac, arg=0xc7d394c, kw=0x0) at ../Objects/abstract.c:1861
#42 0x080c86cc in PyEval_CallObjectWithKeywords (func=0xc799644, arg=0xc7d394c, kw=0x0) at ../Python/ceval.c:3481
#43 0xb7c2fe47 in sip_api_invoke_slot (slot=0xaef1620, sigargs=0xc92772c) at /build/buildd/sip4-qt3-4.7.9/siplib/qtlib.c:716
#44 0xb79f8275 in PyQtProxy::invokeSlot (slot_conn=@0xaef1618, qargs=0xbff699b8) at /build/buildd/python-qt4-4.4.4/sip/QtCore/qobject.sip:2241
#45 0xb79f8e5b in PyQtProxy::unislot (this=0xaef1608, qargs=0xbff699b8) at /build/buildd/python-qt4-4.4.4/sip/QtCore/qobject.sip:2207
#46 0xb79f8f02 in PyQtProxy::qt_metacall (this=0xaef1608, _c=QMetaObject::InvokeMetaMethod, _id=2, _a=0xbff699b8) at /build/buildd/python-qt4-4.4.4/sip/QtCore/qobject.sip:2160
#47 0xb78b9ca8 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#48 0xb78ba932 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#49 0xb6d40eb9 in QTreeWidget::itemClicked () from /usr/lib/libQtGui.so.4
#50 0xb6d44d75 in ?? () from /usr/lib/libQtGui.so.4
#51 0xb6d4e491 in QTreeWidget::qt_metacall () from /usr/lib/libQtGui.so.4
#52 0xb713e354 in sipQTreeWidget::qt_metacall (this=0xae1eca0, _c=QMetaObject::InvokeMetaMethod, _id=111, _a=0xbff69b1c) at sipQtGuipart0.cpp:52918
#53 0xb78b9ca8 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#54 0xb78ba932 in QMetaObject::activate () from /usr/lib/libQtCore.so.4
#55 0xb6cc31b3 in QAbstractItemView::clicked () from /usr/lib/libQtGui.so.4
#56 0xb6cd07b5 in QAbstractItemView::mouseReleaseEvent () from /usr/lib/libQtGui.so.4
#57 0xb6d1378c in QTreeView::mouseReleaseEvent () from /usr/lib/libQtGui.so.4
#58 0xb7157922 in sipQTreeWidget::mouseReleaseEvent (this=0xae1eca0, a0=0xbff6a4b8) at sipQtGuipart0.cpp:53392
#59 0xb67a7b43 in QWidget::event () from /usr/lib/libQtGui.so.4
#60 0xb6b81993 in QFrame::event () from /usr/lib/libQtGui.so.4
#61 0xb6c2194f in QAbstractScrollArea::viewportEvent () from /usr/lib/libQtGui.so.4
#62 0xb6cd3647 in QAbstractItemView::viewportEvent () from /usr/lib/libQtGui.so.4
#63 0xb6d0e0c4 in QTreeView::viewportEvent () from /usr/lib/libQtGui.so.4
#64 0xb7131e24 in sipQTreeWidget::viewportEvent (this=0xae1eca0, a0=0xbff6a4b8) at sipQtGuipart0.cpp:53601
#65 0xb6c23f55 in ?? () from /usr/lib/libQtGui.so.4
#66 0xb78a2c5a in QCoreApplicationPrivate::sendThroughObjectEventFilters () from /usr/lib/libQtCore.so.4
#67 0xb6750e7a in QApplicationPrivate::notify_helper () from /usr/lib/libQtGui.so.4
#68 0xb6759b11 in QApplication::notify () from /usr/lib/libQtGui.so.4
#69 0xb7428613 in sipQApplication::notify (this=0xa1552b0, a0=0xa3903c8, a1=0xbff6a4b8) at sipQtGuipart9.cpp:20607
#70 0xb78a3a3b in QCoreApplication::notifyInternal () from /usr/lib/libQtCore.so.4
#71 0xb6758b7e in QApplicationPrivate::sendMouseEvent () from /usr/lib/libQtGui.so.4
#72 0xb67c897e in ?? () from /usr/lib/libQtGui.so.4
#73 0xb67c7ca7 in QApplication::x11ProcessEvent () from /usr/lib/libQtGui.so.4
#74 0xb67f2c6a in ?? () from /usr/lib/libQtGui.so.4
#75 0xb76b5b88 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#76 0xb76b90eb in ?? () from /usr/lib/libglib-2.0.so.0
#77 0xb76b9268 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#78 0xb78cf438 in QEventDispatcherGlib::processEvents () from /usr/lib/libQtCore.so.4
#79 0xb67f2365 in ?? () from /usr/lib/libQtGui.so.4
#80 0xb78a206a in QEventLoop::processEvents () from /usr/lib/libQtCore.so.4
#81 0xb78a24aa in QEventLoop::exec () from /usr/lib/libQtCore.so.4
#82 0xb78a4959 in QCoreApplication::exec () from /usr/lib/libQtCore.so.4
#83 0xb6750d17 in QApplication::exec () from /usr/lib/libQtGui.so.4
#84 0xb7429116 in meth_QApplication_exec_ (sipArgs=0xb7d4b02c) at sipQtGuipart9.cpp:22662
#85 0x080ceb42 in PyEval_EvalFrameEx (f=0xa1b3d9c, throwflag=0) at ../Python/ceval.c:3612
#86 0x080cfea5 in PyEval_EvalCodeEx (co=0xb7ca7890, globals=0xb62f824c, locals=0x0, args=0x9efc618, argcount=1, kws=0x9efc61c, kwcount=0, defs=0xb7c867d8, defcount=2, closure=0x0) at ../Python/ceval.c:2875
#87 0x080ce7d4 in PyEval_EvalFrameEx (f=0x9efc4dc, throwflag=0) at ../Python/ceval.c:3708
#88 0x080cfea5 in PyEval_EvalCodeEx (co=0xb7d15458, globals=0xb7d64acc, locals=0xb7d64acc, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0) at ../Python/ceval.c:2875
#89 0x080d00b7 in PyEval_EvalCode (co=0xb7d15458, globals=0xb7d64acc, locals=0xb7d64acc) at ../Python/ceval.c:514
#90 0x080edaef in PyRun_FileExFlags (fp=0x9ef0008, filename=0xbff6b6da "main.py", start=257, globals=0xb7d64acc, locals=0xb7d64acc, closeit=1, flags=0xbff6b408) at ../Python/pythonrun.c:1275
#91 0x080eddc2 in PyRun_SimpleFileExFlags (fp=0x9ef0008, filename=0xbff6b6da "main.py", closeit=1, flags=0xbff6b408) at ../Python/pythonrun.c:881
#92 0x08059617 in Py_Main (argc=1, argv=0xbff6b4d4) at ../Modules/main.c:532
#93 0x08058992 in main (argc=512, argv=0x0) at ../Modules/python.c:23


(gdb) up 37
#37 0x080cfea5 in PyEval_EvalCodeEx (co=0xa493068, globals=0xa185604, locals=0x0, args=0xcb365b8, argcount=2, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0) at ../Python/ceval.c:2875
2875	../Python/ceval.c: No such file or directory.
	in ../Python/ceval.c
(gdb) pyframe
/home/tw55413/workspaces/partnerplan/Partnerplan/camelot/view/mainwindow.py (633): createMdiChild
(gdb) 

---> child.showMaximized()
-------------- next part --------------
(gdb) bt
#0  0xb80b8430 in __kernel_vsyscall ()
#1  0xb7fd37b1 in select () from /lib/tls/i686/cmov/libc.so.6
#2  0xb64dbca7 in ?? () from /usr/lib/libxcb.so.1
#3  0xb64dda12 in xcb_wait_for_reply () from /usr/lib/libxcb.so.1
#4  0xb65b2cae in _XReply () from /usr/lib/libX11.so.6
#5  0xb65a027d in XQueryPointer () from /usr/lib/libX11.so.6
#6  0xb697f800 in QCursor::pos () from /usr/lib/libQtGui.so.4
#7  0xb6904f54 in QApplicationPrivate::sendSyntheticEnterLeave () from /usr/lib/libQtGui.so.4
#8  0xb69596f7 in QWidget::setVisible () from /usr/lib/libQtGui.so.4
#9  0xb7354c8d in sipQTabWidget::setVisible (this=0xe4e7240, a0=254) at sipQtGuipart1.cpp:35687
#10 0xb694ba06 in QWidgetPrivate::_q_showIfNotHidden () from /usr/lib/libQtGui.so.4
#11 0xb6959c72 in QWidget::qt_metacall () from /usr/lib/libQtGui.so.4
#12 0xb6daf61a in QTabWidget::qt_metacall () from /usr/lib/libQtGui.so.4
#13 0xb7355064 in sipQTabWidget::qt_metacall (this=0xe4e7240, _c=QMetaObject::InvokeMetaMethod, _id=26, _a=0xba2ff80) at sipQtGuipart1.cpp:35477
#14 0xb7a5e8fb in QMetaCallEvent::placeMetaCall () from /usr/lib/libQtCore.so.4
#15 0xb7a603a0 in QObject::event () from /usr/lib/libQtCore.so.4
#16 0xb6953440 in QWidget::event () from /usr/lib/libQtGui.so.4
#17 0xb6dae533 in QTabWidget::event () from /usr/lib/libQtGui.so.4
#18 0xb7352885 in sipQTabWidget::event (this=0xe4e7240, a0=0xc44a280) at sipQtGuipart1.cpp:35566
#19 0xb68fce9c in QApplicationPrivate::notify_helper () from /usr/lib/libQtGui.so.4
#20 0xb6905282 in QApplication::notify () from /usr/lib/libQtGui.so.4
#21 0xb75d4613 in sipQApplication::notify (this=0xa2bcd48, a0=0xe4e7240, a1=0xc44a280) at sipQtGuipart9.cpp:20607
#22 0xb7a4fa3b in QCoreApplication::notifyInternal () from /usr/lib/libQtCore.so.4
#23 0xb7a50695 in QCoreApplicationPrivate::sendPostedEvents () from /usr/lib/libQtCore.so.4
#24 0xb7a5088d in QCoreApplication::sendPostedEvents () from /usr/lib/libQtCore.so.4
#25 0xb7a7b7ef in ?? () from /usr/lib/libQtCore.so.4
#26 0xb7861b88 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#27 0xb78650eb in ?? () from /usr/lib/libglib-2.0.so.0
#28 0xb7865268 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#29 0xb7a7b438 in QEventDispatcherGlib::processEvents () from /usr/lib/libQtCore.so.4
#30 0xb699e365 in ?? () from /usr/lib/libQtGui.so.4
#31 0xb7a4e06a in QEventLoop::processEvents () from /usr/lib/libQtCore.so.4
#32 0xb7a4e4aa in QEventLoop::exec () from /usr/lib/libQtCore.so.4
#33 0xb7a50959 in QCoreApplication::exec () from /usr/lib/libQtCore.so.4
#34 0xb68fcd17 in QApplication::exec () from /usr/lib/libQtGui.so.4
#35 0xb75d5116 in meth_QApplication_exec_ (sipArgs=0xb7eb602c) at sipQtGuipart9.cpp:22662
#36 0x080ceb42 in PyEval_EvalFrameEx (f=0xa4af554, throwflag=0) at ../Python/ceval.c:3612
#37 0x080cfea5 in PyEval_EvalCodeEx (co=0xb7e106e0, globals=0xa08e24c, locals=0x0, args=0x9f3b618, argcount=1, kws=0x9f3b61c, kwcount=0, defs=0xb7e00798, defcount=2, closure=0x0) at ../Python/ceval.c:2875
#38 0x080ce7d4 in PyEval_EvalFrameEx (f=0x9f3b4dc, throwflag=0) at ../Python/ceval.c:3708
#39 0x080cfea5 in PyEval_EvalCodeEx (co=0xb7e80458, globals=0xb7ecfacc, locals=0xb7ecfacc, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0) at ../Python/ceval.c:2875
#40 0x080d00b7 in PyEval_EvalCode (co=0xb7e80458, globals=0xb7ecfacc, locals=0xb7ecfacc) at ../Python/ceval.c:514
#41 0x080edaef in PyRun_FileExFlags (fp=0x9f2f008, filename=0xbfbd56da "main.py", start=257, globals=0xb7ecfacc, locals=0xb7ecfacc, closeit=1, flags=0xbfbd4068) at ../Python/pythonrun.c:1275
#42 0x080eddc2 in PyRun_SimpleFileExFlags (fp=0x9f2f008, filename=0xbfbd56da "main.py", closeit=1, flags=0xbfbd4068) at ../Python/pythonrun.c:881
#43 0x08059617 in Py_Main (argc=1, argv=0xbfbd4134) at ../Modules/main.c:532
#44 0x08058992 in main (argc=1024, argv=0x0) at ../Modules/python.c:23



More information about the PyQt mailing list