Version: 1.7.0-1 (using KDE 4.3.4) OS: Linux Installed from: Debian testing/unstable Packages I do not remember what I did exactly but I was editing lowpass filter dialog properties. I set cutoff frequency to 0.0001 and hit Ok. After that the UI stopped responding and gdb shows the following deadlock: (gdb) thread apply all bt full Thread 2 (Thread 0x7fffe78e8910 (LWP 12673)): #0 pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:261 No locals. #1 0x00007ffff4ebca99 in KstWaitCondition::wait (this=0x13fb020, mutex=0x13fb000, time=18446744073709551615) at kstwaitcondition_unix.cpp:313 ret = 0 #2 0x00007ffff4e8e1fa in KstRWLock::writeLock (this=0x13faff8) at rwlock.cpp:100 lock = {mtx = 0x13fb000} me = 140737078266128 #3 0x00007ffff4b5d48a in KstDataObject::writeLock (this=0x13faf90) at kstdataobject.cpp:323 No locals. #4 0x00007ffff78ef1a6 in KstWriteLocker (this=0x7fffe78e7b70, l=0x13faff8) at ../../../kst/src/libkst/rwlock.h:78 No locals. #5 0x00007ffff4ebb7fd in KstPrimitive::update (this=0x12c9ff0, update_counter=22349) at kstprimitive.cpp:58 pl = {_l = 0x13faff8} prov = {ptr = 0x13faf90} force = false providerRC = KstObject::NO_CHANGE rc = 32767 #6 0x00007ffff4b890de in KstVCurve::update (this=0x11d6680, update_counter=22349) at kstvcurve.cpp:236 force = false cxV = {ptr = 0x12c9ff0} depUpdated = false exV = {ptr = 0x113a020} exmV = {ptr = 0x0} cyV = {ptr = 0x11f2240} eyV = {ptr = 0x0} eymV = {ptr = 0x7fffe78e7ca0} #7 0x00007ffff7a0f9f0 in UpdateThread::doUpdates (this=0xe8e3f0, force=true, gotData=0x7fffe78e7ff2) at updatethread.cpp:212 bcp = {ptr = 0x11d6680} ut = KstObject::NO_CHANGE i = 4 cl = {<QValueList<KstSharedPtr<KstBaseCurve> >> = {sh = 0x7fffe0005160}, _vptr.KstObjectList = 0x7ffff7da9450, _lock = {_vptr.KstRWLock = 0x7ffff50d85b0, _mutex = <incomplete type>, _readerWait = {_vptr.KstWaitCondition = 0x7ffff50da5b0, d = 0x7fffe0008310}, _writerWait = {_vptr.KstWaitCondition = 0x7ffff50da5b0, d = 0x7fffe0008e20}, _readCount = 0, _writeCount = 0, _waitingReaders = 0, _waitingWriters = 0, _writeLocker = 140737345051168, _readLockers = {sh = 0x7fffe0019f50}}} dol = {<QValueList<KstSharedPtr<KstDataObject> >> = {sh = 0x7fffe000b270}, _vptr.KstObjectList = 0x7ffff7dba210, _lock = {_vptr.KstRWLock = 0x7ffff50d85b0, _mutex = <incomplete type>, _readerWait = {_vptr.KstWaitCondition = 0x7ffff50da5b0, d = 0x7fffe00157a0}, _writerWait = {_vptr.KstWaitCondition = 0x7ffff50da5b0, d = 0x7fffe0001870}, _readCount = 0, _writeCount = 0, _waitingReaders = 0, _waitingWriters = 0, _writeLocker = 53, _readLockers = {sh = 0x7fffe00daa10}}} U = KstObject::UPDATE __PRETTY_FUNCTION__ = "bool UpdateThread::doUpdates(bool, bool*)" #8 0x00007ffff7a0f613 in UpdateThread::run (this=0xe8e3f0) at updatethread.cpp:114 gotData = false force = true updateTime = 200 #9 0x00007ffff64ace5b in QThreadInstance::start(void*) () from /usr/lib/libqt-mt.so.3 No symbol table info available. #10 0x00007ffff3b2273a in start_thread (arg=<value optimized out>) at pthread_create.c:300 __res = <value optimized out> pd = 0x7fffe78e8910 unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140737078266128, -369698354882378577, 140737488344176, 140737078266128, 140737354129472, 3, 369680355303654575, 369706568745256111}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}} not_first_call = <value optimized out> #11 0x00007ffff6ceb69d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112 No locals. #12 0x0000000000000000 in ?? () No symbol table info available. Thread 1 (Thread 0x7ffff7fc9750 (LWP 12668)): #0 pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:261 No locals. #1 0x00007ffff4ebca99 in KstWaitCondition::wait (this=0x11f22c0, mutex=0x11f22b0, time=18446744073709551615) at kstwaitcondition_unix.cpp:313 ret = 0 #2 0x00007ffff4e8dfff in KstRWLock::readLock (this=0x11f22a8) at rwlock.cpp:60 it = {node = 0x1366260} lock = {mtx = 0x11f22b0} me = 140737353914192 #3 0x00007ffff79be936 in KstObjectItem::update (this=0x153e120, recursive=true, localUseCount=0) at kstdatamanager_i.cpp:293 inUse = true field = {static null = {static null = <same as static member of an already seen type>, d = 0x628e20, static shared_null = 0x628e20}, d = 0xb8a400, static shared_null = 0x628e20} x = {ptr = 0x11f2240} __PRETTY_FUNCTION__ = "void KstObjectItem::update(bool, int)" #4 0x00007ffff79bf461 in KstObjectItem::update (this=0x12bb180, recursive=true, localUseCount=0) at kstdatamanager_i.cpp:367 oi = 0x153e120 i = 0x153e170 found = false tn = {static null = {static null = <same as static member of an already seen type>, d = 0x628e20, static shared_null = 0x628e20}, d = 0x1424dc0, static shared_null = 0x628e20} p = {node = 0x15edfb0} vl = {<QMap<QString, KstSharedPtr<KstVector> >> = {sh = 0xff8600}, _vptr.KstObjectMap = 0x7ffff7dacc30} vlEnd = {node = 0x1660c10} trash = {<QGList> = {<> = {<No data fields>}, firstNode = 0x0, lastNode = 0x0, curNode = 0x0, curIndex = -1, numNodes = 0, iterators = 0x0}, <No data fields>} ml = {<QMap<QString, KstSharedPtr<KstMatrix> >> = {sh = 0xc9b940}, _vptr.KstObjectMap = 0x7ffff7db5050} mlEnd = {node = 0x15a4070} field = {static null = {static null = <same as static member of an already seen type>, d = 0x628e20, static shared_null = 0x628e20}, d = 0x159f630, static shared_null = 0x628e20} inUse = true x = {ptr = 0x13faf90} __PRETTY_FUNCTION__ = "void KstObjectItem::update(bool, int)" #5 0x00007ffff79c56a7 in KstDataManagerI::update (this=0x75df40) at kstdatamanager_i.cpp:994 oi = 0x12bb180 i = 0x12bb1d0 dol = {_l = 0x13faff8} found = false it = {node = 0x1333ed0} svl = {<QValueList<KstSharedPtr<KstSVector> >> = {sh = 0x7ffff6bbe8a0}, _vptr.KstObjectList = 0x7fffffffc740, _lock = {_vptr.KstRWLock = 0x7ffff6c1c5a0, _mutex = <incomplete type>, _readerWait = {_vptr.KstWaitCondition = 0x7ffff6bbe8a0, d = 0x7ffff6c1c5a0}, _writerWait = {_vptr.KstWaitCondition = 0xb2ff20, d = 0x0}, _readCount = 15582944, _writeCount = 0, _waitingReaders = 32, _waitingWriters = 0, _writeLocker = 140737332897952, _readLockers = {sh = 0x7ffff6c1c5a0}}} avl = {<QValueList<KstSharedPtr<KstAVector> >> = {sh = 0x159cf70}, _vptr.KstObjectList = 0x7ffff6c1c5a0, _lock = {_vptr.KstRWLock = 0x0, _mutex = <incomplete type>, _readerWait = {_vptr.KstWaitCondition = 0x7ffff6bbe8a0, d = 0x7ffff6c1c5a0}, _writerWait = {_vptr.KstWaitCondition = 0x7ffff5ebe160, d = 0x7fffffffc720}, _readCount = -155457376, _writeCount = 32767, _waitingReaders = -155073120, _waitingWriters = 32767, _writeLocker = 15798560, _readLockers = {sh = 0x0}}} rml = {<QValueList<KstSharedPtr<KstRMatrix> >> = {sh = 0x0}, _vptr.KstObjectList = 0x7ffff6c1c5a0, _lock = {_vptr.KstRWLock = 0x12, _mutex = <incomplete type>, _readerWait = {_vptr.KstWaitCondition = 0x159d750, d = 0x0}, _writerWait = {_vptr.KstWaitCondition = 0x7fffffffc820, d = 0xed6140}, _readCount = -10640, _writeCount = 32767, _waitingReaders = -155073120, _waitingWriters = 32767, _writeLocker = 0, _readLockers = {sh = 0x12}}} currentItem = 0x12465c0 trash = {<QGList> = {<> = {<No data fields>}, firstNode = 0x0, lastNode = 0x0, curNode = 0x0, curIndex = -1, numNodes = 0, iterators = 0x0}, <No data fields>} rvl = {<QValueList<KstSharedPtr<KstRVector> >> = {sh = 0x7ffff6bbe8a0}, _vptr.KstObjectList = 0x18, _lock = {_vptr.KstRWLock = 0x20, _mutex = <incomplete type>, _readerWait = {_vptr.KstWaitCondition = 0x7fffffffc8b0, d = 0x13}, _writerWait = {_vptr.KstWaitCondition = 0x18, d = 0x7ffff6c1c5a0}, _readCount = -13824, _writeCount = 32767, _waitingReaders = 32, _waitingWriters = 0, _writeLocker = 7802112, _readLockers = {sh = 0x30}}} sml = {<QValueList<KstSharedPtr<KstSMatrix> >> = {sh = 0x7fffffffc780}, _vptr.KstObjectList = 0x7fffffffc610, _lock = {_vptr.KstRWLock = 0xedbd50, _mutex = <incomplete type>, _readerWait = {_vptr.KstWaitCondition = 0x0, d = 0x12}, _writerWait = {_vptr.KstWaitCondition = 0x7ffff5ebe4a4, d = 0x7ffff6c1c5a0}, _readCount = 17110624, _writeCount = 0, _waitingReaders = 0, _waitingWriters = 0, _writeLocker = 140737488340944, _readLockers = {sh = 0xed8650}}} aml = {<QValueList<KstSharedPtr<KstAMatrix> >> = {sh = 0x7ffff5ebe4a4}, _vptr.KstObjectList = 0x12, _lock = {_vptr.KstRWLock = 0x0, _mutex = <incomplete type>, _readerWait = {_vptr.KstWaitCondition = 0x7fffffffc730, d = 0xedc490}, _writerWait = {_vptr.KstWaitCondition = 0x7fffffffd670, d = 0x7ffff6c1c5a0}, _readCount = 0, _writeCount = 0, _waitingReaders = 18, _waitingWriters = 0, _writeLocker = 140737319265444, _readLockers = {sh = 0x7fffffffc610}}} #6 0x00007ffff7a81ff2 in KstApp::updateDataManager (this=0x69ef20, onlyVisible=true) at kst.cpp:2241 No locals. #7 0x00007ffff7a81e4c in KstApp::updateDialogs (this=0x69ef20, onlyVisible=true) at kst.cpp:2200 No locals. #8 0x00007ffff7a85d1f in KstApp::qt_invoke (this=0x69ef20, _id=237, _o=0x7fffffffcdb0) at kst.moc:634 No locals. #9 0x00007ffff650f5aa in QObject::activate_signal(QConnectionList*, QUObject*) () from /usr/lib/libqt-mt.so.3 No symbol table info available. #10 0x00007ffff651185a in QObject::activate_signal(int) () from /usr/lib/libqt-mt.so.3 No symbol table info available. #11 0x00007ffff7a62046 in KstDoc::updateDialogs (this=0x76ea70) at kstdoc.moc:132 No locals. #12 0x00007ffff7a62343 in KstDoc::qt_emit (this=0x76ea70, _id=3, _o=0x7fffffffcea0) at kstdoc.moc:182 No locals. #13 0x00007ffff650f64f in QObject::activate_signal(QConnectionList*, QUObject*) () from /usr/lib/libqt-mt.so.3 No symbol table info available. #14 0x00007ffff681b42d in QSignal::signal(QVariant const&) () from /usr/lib/libqt-mt.so.3 No symbol table info available. #15 0x00007ffff6528f14 in QSignal::activate() () from /usr/lib/libqt-mt.so.3 No symbol table info available. #16 0x00007ffff652f468 in QSingleShotTimer::event(QEvent*) () from /usr/lib/libqt-mt.so.3 No symbol table info available. #17 0x00007ffff64b2725 in QApplication::internalNotify(QObject*, QEvent*) () from /usr/lib/libqt-mt.so.3 No symbol table info available. #18 0x00007ffff64b34aa in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libqt-mt.so.3 No symbol table info available. #19 0x00007ffff5ebe4a4 in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdecore.so.4 No symbol table info available. #20 0x00007ffff64a9023 in QEventLoop::activateTimers() () from /usr/lib/libqt-mt.so.3 No symbol table info available. #21 0x00007ffff6463abe in QEventLoop::processEvents(unsigned int) () from /usr/lib/libqt-mt.so.3 No symbol table info available. #22 0x00007ffff64c8fa1 in QEventLoop::enterLoop() () from /usr/lib/libqt-mt.so.3 No symbol table info available. #23 0x00007ffff64c8e62 in QEventLoop::exec() () from /usr/lib/libqt-mt.so.3 No symbol table info available. #24 0x000000000041523c in main (argc=1, argv=0x7fffffffe998) at main.cpp:850 color = {static color_init = true, static globals_init = true, static colormodel = QColor::d32, d = {argb = 1224736768, d8 = {argb = 1224736768, pix = 84 'T', invalid = 82 'R', dirty = 73 'I', direct = 68 'D'}, d32 = {argb = 1224736768, pix = 1145655892}}} pngfile = {static null = {static null = <same as static member of an already seen type>, d = 0x628e20, static shared_null = 0x628e20}, d = 0xe98bb0, static shared_null = 0x628e20} bCaption = false hsList = {sh = 0xe98a30} nOK = false wizardfile = {static null = {static null = <same as static member of an already seen type>, d = 0x628e20, static shared_null = 0x628e20}, d = 0x752110, static shared_null = 0x628e20} psdList = {sh = 0xe989f0} eq_i = {node = 0x0} printfile = {static null = {static null = <same as static member of an already seen type>, d = 0x628e20, static shared_null = 0x628e20}, d = 0xe97580, static shared_null = 0x628e20} print_and_exit = false bIcon = false kst = 0x69ef20 ycolList = {sh = 0x6a25b0} errorList = {sh = 0xe98a70} i_ycol = 32767 mat_i = {node = 0x0} n_y = 0 bMiniIcon = false yEqList = {sh = 0xe989b0} hs_string = {node = 0x0} showQuickStart = true showDataWizard = false in = {skip = 1, doskip = 255, doave = 127, dolegend = false, n = -134393856, f = 32767, rate = 6.9533558073488437e-310, len = 0, has_points = false, sep_plots = false, n_plots = -155159992, n_cols = 32767, n_rows = -136394588, VUnits = {static null = {static null = <same as static member of an already seen type>, d = 0x628e20, static shared_null = 0x628e20}, d = 0x628e20, static shared_null = 0x628e20}, RUnits = {static null = {static null = <same as static member of an already seen type>, d = 0x628e20, static shared_null = 0x628e20}, d = 0x628e20, static shared_null = 0x628e20}} matrixList = {sh = 0xe98890} args = 0x6402f0 rc = 0 i_file = 32767 i_curve = 1 fullPath = {static null = {static null = <same as static member of an already seen type>, d = 0x628e20, static shared_null = 0x628e20}, d = 0x628e20, static shared_null = 0x628e20} aboutData = {mAppName = 0x41e0bb "kst", mProgramName = 0x41e0b7 "Kst", mVersion = 0x41e0b1 "1.7.0", mShortDescription = 0x41e750 "Kst: a data viewing program.", mLicenseKey = 1, mCopyrightStatement = 0x41e0e8 "(c) 2000-2007 Barth Netterfield", mOtherText = 0x0, mHomepageAddress = 0x41e0d3 "http://kst.kde.org/", mBugEmailAddress = 0x41e0bf "submit@bugs.kde.org", mAuthorList = {sh = 0x63eed0}, mCreditList = {sh = 0x63ef30}, mLicenseText = 0x0, d = 0x63ef90} app = <incomplete type> i_v = 65535 i_plot = -6080
This is indeed a classic deadlock. The update thread, in updating a curve, holds a writeLock on the input vectors to the curve, and attempts to get a writeLock on the filter output. The user-interface thread, in updating the data manager, holds a readLock on the filter, and attempts to get a readLock on the output vector of the filter (also the input vector to the curve). This could happen with any of the plugins and is not specific to the filter used.
Or to express it another way, one thread is locking the parent and then the child, while the second thread is locking in the reverse order.
SVN commit 1108735 by arwalker: BUG:232159 Prevent potential deadlock when updating data manager and processing update thread M +18 -2 kstdatamanager_i.cpp M +1 -1 kstdatamanager_i.h WebSVN link: http://websvn.kde.org/?view=rev&revision=1108735
Thank you very much for the detailed analysis and timely fix! I'll try to remember to run kst under GDB also in the future.