GIL deadlocks with PySide
-
Hello,
I have some deadlocks in a multithreaded PySide app I'm writing. I saw this bug report : https://bugreports.qt.io/browse/PYSIDE-164. I don't use Qt.BlockingQueuedConnection when connecting my signals, only auto connections, so I'm wondering if this bug is general, or just for Qt.BlockingQueuedConnection.
If it sounds like I'm hit by the same problem, I wonder if there is anything I can do to minimise the risks of deadlocks until the fix is released ?Here is what let me think I'm hit by the same problem when I retrieve threads stack traces for a deadlocked process.
2578 Thread_783955 DispatchQueue_1: com.apple.main-thread (serial)
..........................................
2578 QLabel::sizeHint() const (in QtGui) + 27 [0x10db3265b]
2578 QLabel::minimumSizeHint() const (in QtGui) + 81 [0x10db32581]
2578 QLabelPrivate::sizeForWidth(int) const (in QtGui) + 461 [0x10db31e5d]
2578 QLabelPrivate::ensureTextLayouted() const (in QtGui) + 85 [0x10db30485]
2578 QLabelPrivate::ensureTextPopulated() const (in QtGui) + 563 [0x10db30393]
2578 QTextDocument::setHtml(QString const&) (in QtGui) + 89 [0x10d9b0a59]
2578 QTextDocumentPrivate::clear() (in QtGui) + 1396 [0x10d9c0574]
2578 QTextDocumentLayout::documentChanged(int, int, int) (in QtGui) + 715 [0x10d9dee5b]
2578 QAbstractTextDocumentLayout::update(QRectF const&) (in QtGui) + 38 [0x10d9d2786]
2578 QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (in QtCore) + 1566 [0x10c5f91ee]
2578 QTextControl::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (in QtGui) + 298 [0x10d97da3a]
2578 QTextControl::updateRequest(QRectF const&) (in QtGui) + 41 [0x10d977029]
2578 QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (in QtCore) + 1387 [0x10c5f913b]
2578 PySide::SignalManager::retriveMetaObject(_object*) (in libpyside-python2.7.1.1.dylib) + 23 [0x10c3faf29]
2578 Shiboken::GilState::GilState() (in libshiboken-python2.7.1.1.dylib) + 52 [0x10c436c0a]
2578 PyGILState_Ensure (in Python) + 93 [0x10a45f1f0]
2578 PyEval_RestoreThread (in Python) + 62 [0x10a440552]
2578 PyThread_acquire_lock (in Python) + 101 [0x10a46fcff]
2578 __psynch_cvwait (in libsystem_kernel.dylib) + 10 [0x7fff8c9ad136]2578 Thread_784126: Thread (pooled)
.........................
2578 PyEval_EvalFrameEx (in Python) + 14387 [0x10a4447c9]
2578 signalInstanceEmit (in libpyside-python2.7.1.1.dylib) + 159 [0x10c40245f]
2578 PyEval_CallObjectWithKeywords (in Python) + 93 [0x10a446d6b]
2578 PyObject_Call (in Python) + 99 [0x10a3c72ac]
2578 Sbk_QObjectFunc_emit (in QtCore.so) + 364 [0x10c16f53c]
2578 PySide::SignalManager::emitSignal(QObject*, char const*, _object*) (in libpyside-python2.7.1.1.dylib) + 315 [0x10c3fba4b]
2578 PySide::MetaFunction::call(QObject*, int, _object*, _object**) (in libpyside-python2.7.1.1.dylib) + 1160 [0x10c401ce8]
2578 PySide::SignalManager::qt_metacall(QObject*, QMetaObject::Call, int, void**) (in libpyside-python2.7.1.1.dylib) + 462 [0x10c3fb6ae]
2578 QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (in QtCore) + 2990 [0x10c5f977e]
2578 QMutex::lockInternal() (in QtCore) + 252 [0x10c4c165c]
2578 QMutexPrivate::wait(int) (in QtCore) + 411 [0x10c4c63ab]
2578 __psynch_cvwait (in libsystem_kernel.dylib) + 10 [0x7fff8c9ad136]thanks.