Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-281

Creating connections and emitting signals simultaneously on threads causes deadlocks.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • Not Evaluated
    • None
    • 1.2.2
    • PySide
    • None

    Description

      I've been able to reliably reproduce the issue with the attached deadlock.py which produces the following backtraces in gdb:

      Main Thread

      (gdb) py-bt
      #21 Frame 0x127ff70, for file ./deadlock.py, line 34, in runTest (runnables=[<type unknown at remote 0x11e2368>, <type unknown at remote 0x11e2488>, <type unknown at remote 0x11e2560>, <type unknown at remote 0x11e2638>, <type unknown at remote 0x11e2710>, <type unknown at remote 0x11e27e8>, <type unknown at remote 0x11e28c0>, <type unknown at remote 0x11e2998>, <type unknown at remote 0x11e2a70>, <type unknown at remote 0x11e2b48>, <type unknown at remote 0x11e2c20>, <type unknown at remote 0x11e2cf8>, <type unknown at remote 0x11e2dd0>, <type unknown at remote 0x11e2ea8>, <type unknown at remote 0x11e2f80>, <type unknown at remote 0x11e3098>, <type unknown at remote 0x11e3170>, <type unknown at remote 0x11e3248>, <type unknown at remote 0x11e33b0>], x=18, sr=<...>)
              sr.signal.connect(responder)
      #54 Frame 0x6eb380, for file ./deadlock.py, line 44, in <module> ()
          sys.exit(qApp.exec_())
      (gdb) bt      
      #0  0x0000003f1d4e5159 in syscall () from /lib64/libc.so.6                                                                                                                                       
      #1  0x00007ffff0ca78eb in _q_futex (addr=0x12b13e0, op=0, val=2, timeout=0x0, addr2=0x0, val2=0) at thread/qmutex_unix.cpp:99                                                                    
      #2  0x00007ffff0ca79a8 in QMutexPrivate::wait (this=0x12b13e0, timeout=-1) at thread/qmutex_unix.cpp:113                                                                                         
      #3  0x00007ffff0ca225d in QMutex::lockInternal (this=0x12b1060) at thread/qmutex.cpp:450                                                                                                         
      #4  0x00007ffff0ca1e48 in QMutex::lock (this=0x12b1060) at thread/qmutex.cpp:177                                                                                                                 
      #5  0x00007ffff0c84cc2 in QMutex::lockInline (this=0x12b1060) at ../../include/QtCore/../../src/corelib/thread/qmutex.h:198                                                                      
      #6  0x00007ffff0d9079f in QOrderedMutexLocker::relock (this=0x7fffffffad00) at ../../include/QtCore/private/../../../src/corelib/thread/qorderedmutexlocker_p.h:83                               
      #7  0x00007ffff0d90730 in QOrderedMutexLocker::QOrderedMutexLocker (this=0x7fffffffad00, m1=0x12b1060, m2=0x12aebb0)                                                                             
          at ../../include/QtCore/private/../../../src/corelib/thread/qorderedmutexlocker_p.h:72                                                                                                       
      #8  0x00007ffff0e05437 in QMetaObjectPrivate::disconnect (sender=0x12af540, signal_index=0, receiver=0x12ae910, method_index=4, disconnectType=QMetaObjectPrivate::DisconnectAll)                
          at kernel/qobject.cpp:3292                                                                                                                                                                   
      #9  0x00007ffff0e05354 in QMetaObject::disconnect (sender=0x12af540, signal_index=0, receiver=0x12ae910, method_index=4) at kernel/qobject.cpp:3220                                              
      #10 0x00007ffff14426d5 in PySide::GlobalReceiverV2::notify() () from /opt/pyside/1.2.2.2/Linux/qt-4.8/python-2.7/lib/libpyside-python2.7.so.1.2                                          
      #11 0x00007ffff143b94e in PySide::SignalManager::notifyGlobalReceiver(QObject*) () from /opt/pyside/1.2.2.2/Linux/qt-4.8/python-2.7/lib/libpyside-python2.7.so.1.2                       
      #12 0x00007ffff17ac49d in qobjectConnectCallback(QObject*, char const*, _object*, Qt::ConnectionType) ()                                                                                         
         from /opt/pyside/1.2.2.2/Linux/qt-4.8/python-2.7/lib/python2.7/site-packages/PySide/QtCore.so                                                                                         
      #13 0x00007ffff17af0d9 in Sbk_QObjectFunc_connect () from /opt/pyside/1.2.2.2/Linux/qt-4.8/python-2.7/lib/python2.7/site-packages/PySide/QtCore.so                                       
      #14 0x00007ffff7c785ac in PyCFunction_Call (func=<built-in method connect of SignalCls object at remote 0x11e3440>, arg=                                                                         
          (<type unknown at remote 0x11e3440>, '2signal(QString)', <function at remote 0x7ffff1bf49b0>), kw=0x0) at Objects/methodobject.c:85                                                          
      #15 0x00007ffff7c2b24a in PyObject_Call (func=<built-in method connect of SignalCls object at remote 0x11e3440>, arg=                                                                            
          (<type unknown at remote 0x11e3440>, '2signal(QString)', <function at remote 0x7ffff1bf49b0>), kw=0x0) at Objects/abstract.c:2529                                                            
      #16 0x00007ffff7cfbf3e in PyEval_CallObjectWithKeywords (func=<built-in method connect of SignalCls object at remote 0x11e3440>, arg=                                                            
          (<type unknown at remote 0x11e3440>, '2signal(QString)', <function at remote 0x7ffff1bf49b0>), kw=0x0) at Python/ceval.c:3890                                                                
      #17 0x00007ffff7c2b1c0 in PyObject_CallObject (o=<built-in method connect of SignalCls object at remote 0x11e3440>, a=                                                                           
          (<type unknown at remote 0x11e3440>, '2signal(QString)', <function at remote 0x7ffff1bf49b0>)) at Objects/abstract.c:2517                                                                    
      #18 0x00007ffff1446782 in signalInstanceConnect () from /opt/pyside/1.2.2.2/Linux/qt-4.8/python-2.7/lib/libpyside-python2.7.so.1.2                                                       
      #19 0x00007ffff7c785ac in PyCFunction_Call (func=<built-in method connect of PySide.QtCore.SignalInstance object at remote 0x7ffff8002900>, arg=(<function at remote 0x7ffff1bf49b0>,), kw=0x0)  
          at Objects/methodobject.c:85                                                                                                                                                                 
      #20 0x00007ffff7cfc6fb in call_function (pp_stack=0x7fffffffb478, oparg=1) at Python/ceval.c:4021                                                                                                
      #21 0x00007ffff7cf8b6c in PyEval_EvalFrameEx (f=                                                                                                                                                 
          Frame 0x127ff70, for file ./deadlock.py, line 34, in runTest (runnables=[<type unknown at remote 0x11e2368>, <type unknown at remote 0x11e2488>, <type unknown at remote 0x11e2560>, <type unknown at remote 0x11e2638>, <type unknown at remote 0x11e2710>, <type unknown at remote 0x11e27e8>, <type unknown at remote 0x11e28c0>, <type unknown at remote 0x11e2998>, <type unknown at remote 0x11e2a70>, <type unknown at remote 0x11e2b48>, <type unknown at remote 0x11e2c20>, <type unknown at remote 0x11e2cf8>, <type unknown at remote 0x11e2dd0>, <type unknown at remote 0x11e2ea8>, <type unknown at remote 0x11e2f80>, <type unknown at remote 0x11e3098>, <type unknown at remote 0x11e3170>, <type unknown at remote 0x11e3248>, <type unknown at remote 0x11e33b0>], x=18, sr=<...>), throwflag=0) at Python/ceval.c:2666                                                                                                                                                       
      #22 0x00007ffff7cfa825 in PyEval_EvalCodeEx (co=<code at remote 0x7ffff7afb7b0>, globals=                                                                                                        
          {'runTest': <function at remote 0x11e0a28>, 'QtGui': <module at remote 0x872c58>, 'qApp': <PySide.QtGui.QApplication at remote 0x11e2290>, '__builtins__': <module at remote 0x7ffff7b74ad0>, '__file__': './deadlock.py', 'responder': <function at remote 0x7ffff1bf49b0>, '__package__': None, 'sys': <module at remote 0x7ffff7b74b78>, 'SignalRunnable': <type SignalRunnable at remote 0x1217820>, 'time': <module at remote 0x7ffff1bfe050>, '__name__': '__main__', 'QtCore': <module at remote 0x7ffff1bfe2b8>, '__doc__': None}, locals=0x0, args=0x7ffff7b74068, argcount=0, kws=   
          0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:3253                                                                                                                    
      #23 0x00007ffff7c5c940 in function_call (func=<function at remote 0x11e0a28>, arg=(), kw=0x0) at Objects/funcobject.c:526                                                                        
      #24 0x00007ffff7c2b24a in PyObject_Call (func=<function at remote 0x11e0a28>, arg=(), kw=0x0) at Objects/abstract.c:2529                                                                         
      #25 0x00007ffff7cfbf3e in PyEval_CallObjectWithKeywords (func=<function at remote 0x11e0a28>, arg=(), kw=0x0) at Python/ceval.c:3890                                                             
      #26 0x00007ffff7c2b1c0 in PyObject_CallObject (o=<function at remote 0x11e0a28>, a=()) at Objects/abstract.c:2517                                                                                
      #27 0x00007ffff143bf59 in PySide::SignalManager::callPythonMetaMethod(QMetaMethod const&, void**, _object*, bool) ()                                                                             
         from /opt/pyside/1.2.2.2/Linux/qt-4.8/python-2.7/lib/libpyside-python2.7.so.1.2                                                                                                       
      #28 0x00007ffff14429b0 in PySide::GlobalReceiverV2::qt_metacall(QMetaObject::Call, int, void**) () from /opt/pyside/1.2.2.2/Linux/qt-4.8/python-2.7/lib/libpyside-python2.7.so.1.2       
      #29 0x00007ffff0def777 in QMetaObject::metacall (object=0x127c930, cl=QMetaObject::InvokeMetaMethod, idx=5, argv=0x7fffffffba60) at kernel/qmetaobject.cpp:245                                   
      #30 0x00007ffff0e065fb in QMetaObject::activate (sender=0x126d710, m=0x7ffff11a3520, local_signal_index=0, argv=0x0) at kernel/qobject.cpp:3577                                                  
      #31 0x00007ffff0e6bdab in QTimer::timeout (this=0x126d710) at .moc/debug-shared/moc_qtimer.cpp:147                                                                                               
      #32 0x00007ffff0e0fca1 in QTimer::timerEvent (this=0x126d710, e=0x7fffffffc5b0) at kernel/qtimer.cpp:280                                                                                         
      #33 0x00007ffff1870690 in QTimerWrapper::timerEvent(QTimerEvent*) () from /opt/pyside/1.2.2.2/Linux/qt-4.8/python-2.7/lib/python2.7/site-packages/PySide/QtCore.so                       
      #34 0x00007ffff0e00bad in QObject::event (this=0x126d710, e=0x7fffffffc5b0) at kernel/qobject.cpp:1156                                                                                           
      #35 0x00007ffff18700dc in QTimerWrapper::event(QEvent*) () from /opt/pyside/1.2.2.2/Linux/qt-4.8/python-2.7/lib/python2.7/site-packages/PySide/QtCore.so                                 
      #36 0x00007fffeed67a06 in QApplicationPrivate::notify_helper (this=0x1201290, receiver=0x126d710, e=0x7fffffffc5b0) at kernel/qapplication.cpp:4562                                              
      #37 0x00007fffeed64ef3 in QApplication::notify (this=0xfbdb90, receiver=0x126d710, e=0x7fffffffc5b0) at kernel/qapplication.cpp:3944                                                             
      #38 0x00007fffefd2b2f2 in QApplicationWrapper::notify(QObject*, QEvent*) () from /opt/pyside/1.2.2.2/Linux/qt-4.8/python-2.7/lib/python2.7/site-packages/PySide/QtGui.so                 
      #39 0x00007ffff0de6e76 in QCoreApplication::notifyInternal (this=0xfbdb90, receiver=0x126d710, event=0x7fffffffc5b0) at kernel/qcoreapplication.cpp:949                                          
      #40 0x00007ffff0deabc7 in QCoreApplication::sendEvent (receiver=0x126d710, event=0x7fffffffc5b0) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231                         
      #41 0x00007ffff0e28b6d in QTimerInfoList::activateTimers (this=0x644c60) at kernel/qeventdispatcher_unix.cpp:621                                                                                 
      #42 0x00007ffff0e24cee in timerSourceDispatch (source=0x644c00) at kernel/qeventdispatcher_glib.cpp:186                                                                                          
      #43 0x0000003f1ec38f0e in g_main_context_dispatch () from /lib64/libglib-2.0.so.0                                                                                                                
      #44 0x0000003f1ec3c938 in ?? () from /lib64/libglib-2.0.so.0                                                                                                                                     
      #45 0x0000003f1ec3ca3a in g_main_context_iteration () from /lib64/libglib-2.0.so.0                                                                                                               
      #46 0x00007ffff0e25803 in QEventDispatcherGlib::processEvents (this=0x11a4080, flags=...) at kernel/qeventdispatcher_glib.cpp:425                                                                
      #47 0x00007fffeee46e0c in QGuiEventDispatcherGlib::processEvents (this=0x11a4080, flags=...) at kernel/qguieventdispatcher_glib.cpp:204                                                          
      #48 0x00007ffff0de411c in QEventLoop::processEvents (this=0x7fffffffc930, flags=...) at kernel/qeventloop.cpp:149                                                                                
      #49 0x00007ffff0de42a8 in QEventLoop::exec (this=0x7fffffffc930, flags=...) at kernel/qeventloop.cpp:204                                                                                         
      #50 0x00007ffff0de7500 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1221                                                                                                          
      #51 0x00007fffeed64ada in QApplication::exec () at kernel/qapplication.cpp:3823                                                                                                                  
      #52 0x00007fffefd2d3cb in Sbk_QApplicationFunc_exec_ () from /opt/pyside/1.2.2.2/Linux/qt-4.8/python-2.7/lib/python2.7/site-packages/PySide/QtGui.so                                     
      #53 0x00007ffff7cfc3a0 in call_function (pp_stack=0x7fffffffcb08, oparg=0) at Python/ceval.c:4005                                                                                                
      #54 0x00007ffff7cf8b6c in PyEval_EvalFrameEx (f=Frame 0x6eb380, for file ./deadlock.py, line 44, in <module> (), throwflag=0) at Python/ceval.c:2666                                             
      #55 0x00007ffff7cfa825 in PyEval_EvalCodeEx (co=<code at remote 0x7ffff7afc4b0>, globals=                                                                                                        
          {'runTest': <function at remote 0x11e0a28>, 'QtGui': <module at remote 0x872c58>, 'qApp': <PySide.QtGui.QApplication at remote 0x11e2290>, '__builtins__': <module at remote 0x7ffff7b74ad0>, '__file__': './deadlock.py', 'responder': <function at remote 0x7ffff1bf49b0>, '__package__': None, 'sys': <module at remote 0x7ffff7b74b78>, 'SignalRunnable': <type SignalRunnable at remote 0x1217820>, 'time': <module at remote 0x7ffff1bfe050>, '__name__': '__main__', 'QtCore': <module at remote 0x7ffff1bfe2b8>, '__doc__': None}, locals=                                             
          {'runTest': <function at remote 0x11e0a28>, 'QtGui': <module at remote 0x872c58>, 'qApp': <PySide.QtGui.QApplication at remote 0x11e2290>, '__builtins__': <module at remote 0x7ffff7b74ad0>, '__file__': './deadlock.py', 'responder': <function at remote 0x7ffff1bf49b0>, '__package__': None, 'sys': <module at remote 0x7ffff7b74b78>, 'SignalRunnable': <type SignalRunnable at remote 0x1217820>, 'time': <module at remote 0x7ffff1bfe050>, '__name__': '__main__', 'QtCore': <module at remote 0x7ffff1bfe2b8>, '__doc__': None}, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=     
          0x0, defcount=0, closure=0x0) at Python/ceval.c:3253                                                                                                                                         
      #56 0x00007ffff7cf470f in PyEval_EvalCode (co=<code at remote 0x7ffff7afc4b0>, globals=
          {'runTest': <function at remote 0x11e0a28>, 'QtGui': <module at remote 0x872c58>, 'qApp': <PySide.QtGui.QApplication at remote 0x11e2290>, '__builtins__': <module at remote 0x7ffff7b74ad0>, '__file__': './deadlock.py', 'responder': <function at remote 0x7ffff1bf49b0>, '__package__': None, 'sys': <module at remote 0x7ffff7b74b78>, 'SignalRunnable': <type SignalRunnable at remote 0---Type <return> to continue, or q <return> to quit---
      x1217820>, 'time': <module at remote 0x7ffff1bfe050>, '__name__': '__main__', 'QtCore': <module at remote 0x7ffff1bfe2b8>, '__doc__': None}, locals=
          {'runTest': <function at remote 0x11e0a28>, 'QtGui': <module at remote 0x872c58>, 'qApp': <PySide.QtGui.QApplication at remote 0x11e2290>, '__builtins__': <module at remote 0x7ffff7b74ad0>, '__file__': './deadlock.py', 'responder': <function at remote 0x7ffff1bf49b0>, '__package__': None, 'sys': <module at remote 0x7ffff7b74b78>, 'SignalRunnable': <type SignalRunnable at remote 0x1217820>, 'time': <module at remote 0x7ffff1bfe050>, '__name__': '__main__', 'QtCore': <module at remote 0x7ffff1bfe2b8>, '__doc__': None}) at Python/ceval.c:667
      #57 0x00007ffff7d260f6 in run_mod (mod=0x6e6f50, filename=0x7fffffffd764 "./deadlock.py", globals=
          {'runTest': <function at remote 0x11e0a28>, 'QtGui': <module at remote 0x872c58>, 'qApp': <PySide.QtGui.QApplication at remote 0x11e2290>, '__builtins__': <module at remote 0x7ffff7b74ad0>, '__file__': './deadlock.py', 'responder': <function at remote 0x7ffff1bf49b0>, '__package__': None, 'sys': <module at remote 0x7ffff7b74b78>, 'SignalRunnable': <type SignalRunnable at remote 0x1217820>, 'time': <module at remote 0x7ffff1bfe050>, '__name__': '__main__', 'QtCore': <module at remote 0x7ffff1bfe2b8>, '__doc__': None}, locals=
          {'runTest': <function at remote 0x11e0a28>, 'QtGui': <module at remote 0x872c58>, 'qApp': <PySide.QtGui.QApplication at remote 0x11e2290>, '__builtins__': <module at remote 0x7ffff7b74ad0>, '__file__': './deadlock.py', 'responder': <function at remote 0x7ffff1bf49b0>, '__package__': None, 'sys': <module at remote 0x7ffff7b74b78>, 'SignalRunnable': <type SignalRunnable at remote 0x1217820>, 'time': <module at remote 0x7ffff1bfe050>, '__name__': '__main__', 'QtCore': <module at remote 0x7ffff1bfe2b8>, '__doc__': None}, flags=0x7fffffffd070, arena=0x6b9d60)
          at Python/pythonrun.c:1353
      #58 0x00007ffff7d26076 in PyRun_FileExFlags (fp=0x6d68b0, filename=0x7fffffffd764 "./deadlock.py", start=257, globals=
          {'runTest': <function at remote 0x11e0a28>, 'QtGui': <module at remote 0x872c58>, 'qApp': <PySide.QtGui.QApplication at remote 0x11e2290>, '__builtins__': <module at remote 0x7ffff7b74ad0>, '__file__': './deadlock.py', 'responder': <function at remote 0x7ffff1bf49b0>, '__package__': None, 'sys': <module at remote 0x7ffff7b74b78>, 'SignalRunnable': <type SignalRunnable at remote 0x1217820>, 'time': <module at remote 0x7ffff1bfe050>, '__name__': '__main__', 'QtCore': <module at remote 0x7ffff1bfe2b8>, '__doc__': None}, locals=
          {'runTest': <function at remote 0x11e0a28>, 'QtGui': <module at remote 0x872c58>, 'qApp': <PySide.QtGui.QApplication at remote 0x11e2290>, '__builtins__': <module at remote 0x7ffff7b74ad0>, '__file__': './deadlock.py', 'responder': <function at remote 0x7ffff1bf49b0>, '__package__': None, 'sys': <module at remote 0x7ffff7b74b78>, 'SignalRunnable': <type SignalRunnable at remote 0x1217820>, 'time': <module at remote 0x7ffff1bfe050>, '__name__': '__main__', 'QtCore': <module at remote 0x7ffff1bfe2b8>, '__doc__': None}, closeit=1, flags=0x7fffffffd070)
          at Python/pythonrun.c:1339
      #59 0x00007ffff7d24cfc in PyRun_SimpleFileExFlags (fp=0x6d68b0, filename=0x7fffffffd764 "./deadlock.py", closeit=1, flags=0x7fffffffd070) at Python/pythonrun.c:943
      #60 0x00007ffff7d2453e in PyRun_AnyFileExFlags (fp=0x6d68b0, filename=0x7fffffffd764 "./deadlock.py", closeit=1, flags=0x7fffffffd070) at Python/pythonrun.c:747
      #61 0x00007ffff7d3d463 in Py_Main (argc=2, argv=0x7fffffffd1f8) at Modules/main.c:639
      #62 0x0000000000400744 in main (argc=2, argv=0x7fffffffd1f8) at ./Modules/python.c:23
      

      Thread 3 (with emit() being called)

      (gdb) thread 3                                                                                                                                                                                   
      [Switching to thread 3 (Thread 0x7fffe71c8700 (LWP 31764))]#0  0x0000003f1e00d930 in sem_wait () from /lib64/libpthread.so.0                                                                     
      (gdb) py-bt                                                                                                                                                                                      
      #24 Frame 0x7fffd800a230, for file ./deadlock.py, line 20, in run (self=<type unknown at remote 0x11e2488>)                                                                                      
              self.signal.emit('running %s' % self._val)                                                                                                                                               
      (gdb) bt                                                                                                                                                                                         
      #0  0x0000003f1e00d930 in sem_wait () from /lib64/libpthread.so.0                                                                                                                                
      #1  0x00007ffff7d3ac36 in PyThread_acquire_lock (lock=0x6885a0, waitflag=1) at Python/thread_pthread.h:321                                                                                       
      #2  0x00007ffff7cf4363 in PyEval_RestoreThread (tstate=0x7fffd800a140) at Python/ceval.c:357                                                                                                     
      #3  0x00007ffff7d234c9 in PyGILState_Ensure () at Python/pystate.c:609                                                                                                                           
      #4  0x00007ffff11dbed3 in Shiboken::GilState::GilState() () from /opt/pyside/1.2.2.2/Linux/qt-4.8/python-2.7/lib/libshiboken-python2.7.so.1.2                                            
      #5  0x00007ffff143c367 in PySide::SignalManager::retriveMetaObject(_object*) () from /opt/pyside/1.2.2.2/Linux/qt-4.8/python-2.7/lib/libpyside-python2.7.so.1.2                          
      #6  0x00007ffff17adcff in QObjectWrapper::metaObject() const () from /opt/pyside/1.2.2.2/Linux/qt-4.8/python-2.7/lib/python2.7/site-packages/PySide/QtCore.so                            
      #7  0x00007ffff0e05c14 in queued_activate (sender=0x12af540, signal=4, c=0x12b1600, argv=0x7fffd800a4e0) at kernel/qobject.cpp:3401                                                              
      #8  0x00007ffff0e0617a in QMetaObject::activate (sender=0x12af540, m=0x12aeda0, local_signal_index=0, argv=0x7fffd800a4e0) at kernel/qobject.cpp:3503                                            
      #9  0x00007ffff0e0692c in QMetaObject::activate (sender=0x12af540, signal_index=4, argv=0x7fffd800a4e0) at kernel/qobject.cpp:3634                                                               
      #10 0x00007ffff143c4cc in (anonymous namespace)::callMethod(QObject*, int, void**) () from /opt/pyside/1.2.2.2/Linux/qt-4.8/python-2.7/lib/libpyside-python2.7.so.1.2                    
      #11 0x00007ffff143bcd2 in PySide::SignalManager::qt_metacall(QObject*, QMetaObject::Call, int, void**) ()                                                                                        
         from /opt/pyside/1.2.2.2/Linux/qt-4.8/python-2.7/lib/libpyside-python2.7.so.1.2                                                                                                       
      #12 0x00007ffff17add52 in QObjectWrapper::qt_metacall(QMetaObject::Call, int, void**) () from /opt/pyside/1.2.2.2/Linux/qt-4.8/python-2.7/lib/python2.7/site-packages/PySide/QtCore.so   
      #13 0x00007ffff0def777 in QMetaObject::metacall (object=0x12af540, cl=QMetaObject::InvokeMetaMethod, idx=4, argv=0x7fffd800a4e0) at kernel/qmetaobject.cpp:245                                   
      #14 0x00007ffff1445670 in PySide::MetaFunction::call(QObject*, int, _object*, _object**) () from /opt/pyside/1.2.2.2/Linux/qt-4.8/python-2.7/lib/libpyside-python2.7.so.1.2
      #15 0x00007ffff143ba7e in PySide::SignalManager::emitSignal(QObject*, char const*, _object*) () from /opt/pyside/1.2.2.2/Linux/qt-4.8/python-2.7/lib/libpyside-python2.7.so.1.2
      #16 0x00007ffff17b13d8 in Sbk_QObjectFunc_emit () from /opt/pyside/1.2.2.2/Linux/qt-4.8/python-2.7/lib/python2.7/site-packages/PySide/QtCore.so
      #17 0x00007ffff7c7858f in PyCFunction_Call (func=<built-in method emit of SignalCls object at remote 0x11e2518>, arg=('2signal(QString)', 'running 1'), kw=0x0) at Objects/methodobject.c:81
      #18 0x00007ffff7c2b24a in PyObject_Call (func=<built-in method emit of SignalCls object at remote 0x11e2518>, arg=('2signal(QString)', 'running 1'), kw=0x0) at Objects/abstract.c:2529
      #19 0x00007ffff7cfbf3e in PyEval_CallObjectWithKeywords (func=<built-in method emit of SignalCls object at remote 0x11e2518>, arg=('2signal(QString)', 'running 1'), kw=0x0)
          at Python/ceval.c:3890
      #20 0x00007ffff7c2b1c0 in PyObject_CallObject (o=<built-in method emit of SignalCls object at remote 0x11e2518>, a=('2signal(QString)', 'running 1')) at Objects/abstract.c:2517
      #21 0x00007ffff1446a27 in signalInstanceEmit () from /opt/pyside/1.2.2.2/Linux/qt-4.8/python-2.7/lib/libpyside-python2.7.so.1.2
      #22 0x00007ffff7c7858f in PyCFunction_Call (func=<built-in method emit of PySide.QtCore.SignalInstance object at remote 0x7ffff8002768>, arg=('running 1',), kw=0x0)
          at Objects/methodobject.c:81
      #23 0x00007ffff7cfc6fb in call_function (pp_stack=0x7fffe71c76b8, oparg=1) at Python/ceval.c:4021
      #24 0x00007ffff7cf8b6c in PyEval_EvalFrameEx (f=Frame 0x7fffd800a230, for file ./deadlock.py, line 20, in run (self=<type unknown at remote 0x11e2488>), throwflag=0) at Python/ceval.c:2666
      ---Type <return> to continue, or q <return> to quit---
      #25 0x00007ffff7cfa825 in PyEval_EvalCodeEx (co=<code at remote 0x7ffff7af1430>, globals=
          {'runTest': <function at remote 0x11e0a28>, 'QtGui': <module at remote 0x872c58>, 'qApp': <PySide.QtGui.QApplication at remote 0x11e2290>, '__builtins__': <module at remote 0x7ffff7b74ad0>, '__file__': './deadlock.py', 'responder': <function at remote 0x7ffff1bf49b0>, '__package__': None, 'sys': <module at remote 0x7ffff7b74b78>, 'SignalRunnable': <type SignalRunnable at remote 0x1217820>, 'time': <module at remote 0x7ffff1bfe050>, '__name__': '__main__', 'QtCore': <module at remote 0x7ffff1bfe2b8>, '__doc__': None}, locals=0x0, args=0x7ffff1bf3a28, argcount=1, kws=
          0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:3253
      #26 0x00007ffff7c5c940 in function_call (func=<function at remote 0x7ffff1bf4c80>, arg=(<type unknown at remote 0x11e2488>,), kw=0x0) at Objects/funcobject.c:526
      #27 0x00007ffff7c2b24a in PyObject_Call (func=<function at remote 0x7ffff1bf4c80>, arg=(<type unknown at remote 0x11e2488>,), kw=0x0) at Objects/abstract.c:2529
      #28 0x00007ffff7c406af in instancemethod_call (func=<function at remote 0x7ffff1bf4c80>, arg=(<type unknown at remote 0x11e2488>,), kw=0x0) at Objects/classobject.c:2578
      #29 0x00007ffff7c2b24a in PyObject_Call (func=<instancemethod at remote 0x11dbaa0>, arg=(), kw=0x0) at Objects/abstract.c:2529
      #30 0x00007ffff17eb65d in QRunnableWrapper::run() () from /opt/pyside/1.2.2.2/Linux/qt-4.8/python-2.7/lib/python2.7/site-packages/PySide/QtCore.so
      #31 0x00007ffff0c969c3 in QThreadPoolThread::run (this=0x12b1080) at concurrent/qthreadpool.cpp:107
      #32 0x00007ffff0ca834d in QThreadPrivate::start (arg=0x12b1080) at thread/qthread_unix.cpp:338
      #33 0x0000003f1e0079d1 in start_thread () from /lib64/libpthread.so.0
      #34 0x0000003f1d4e88fd in clone () from /lib64/libc.so.6
      

      Other threads are all waiting in time.sleep() with the GIL released/waiting to be acquired.

      Attachments

        1. alternate_deadlock.patch
          0.8 kB
        2. deadlock_fix.patch
          0.7 kB
        3. deadlock_v3.patch
          3 kB
        4. deadlock.py
          1 kB
        5. pyside-281-deadlock.py
          1 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            assumptionsoup Jordan Hueckstaedt
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes