Bug 363509 - Dead-lock in QML/JS plugin (dead-lock in QmlJS::Cache)
Summary: Dead-lock in QML/JS plugin (dead-lock in QmlJS::Cache)
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: QML/JavaScript (show other bugs)
Version: git master
Platform: Other Linux
: NOR grave
Target Milestone: 5.0.0
Assignee: kdevelop-bugs-null
URL:
Keywords: release_blocker
Depends on:
Blocks:
 
Reported: 2016-05-25 15:04 UTC by Kevin Funk
Modified: 2016-06-18 14:17 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.0.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Funk 2016-05-25 15:04:34 UTC
Backtrace:

Thread 15 (Thread 0x7f262d08b700 (LWP 22780)):
#0  0x00007f26481f9e8d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x0000000000438a4e in poll () at /usr/bin/../lib/gcc/x86_64-linux-gnu/5.3.1/../../../../include/c++/5.3.1/iostream:74
#2  0x00007f263b5b9c62 in ?? () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#3  0x00007f263b5bb8d7 in xcb_wait_for_event () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#4  0x00007f2631e50629 in QXcbEventReader::run (this=0x61600000f080) at qxcbconnection.cpp:1253
#5  0x00007f264943784e in QThreadPrivate::start (arg=0x61600000f080) at thread/qthread_unix.cpp:331
#6  0x00007f2648af16fa in start_thread (arg=0x7f262d08b700) at pthread_create.c:333
#7  0x00007f2648205b5d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 13 (Thread 0x7f260ef67700 (LWP 22797)):
#0  0x00007f26481f9e8d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x0000000000438a4e in poll () at /usr/bin/../lib/gcc/x86_64-linux-gnu/5.3.1/../../../../include/c++/5.3.1/iostream:74
#2  0x00007f263d2b231c in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f263d2b242c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007f264966ea7f in QEventDispatcherGlib::processEvents (this=0x60200025aff0, flags=...) at kernel/qeventdispatcher_glib.cpp:418
#5  0x00007f2649615dea in QEventLoop::exec (this=this@entry=0x7f260ef66c80, flags=..., flags@entry=...) at kernel/qeventloop.cpp:204
#6  0x00007f26494328a4 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:503
#7  0x00007f264943784e in QThreadPrivate::start (arg=0x7f264e2095e8 <KDevelop::(anonymous namespace)::Q_QGS_s_parsingThread::innerFunction()::holder+8>) at thread/qthread_unix.cpp:331
#8  0x00007f2648af16fa in start_thread (arg=0x7f260ef67700) at pthread_create.c:333
#9  0x00007f2648205b5d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 14 (Thread 0x7f2614023700 (LWP 22792)):
#0  0x00007f2648afac5d in nanosleep () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007f26494e7c8d in qt_nanosleep (amount=...) at tools/qelapsedtimer_unix.cpp:185
#2  0x00007f2649436c84 in QThread::usleep (usecs=<optimized out>) at thread/qthread_unix.cpp:475
#3  0x00007f2644afed91 in KDevelop::DUChainLock::lockForWrite (this=0x7f26467d6be0 <KDevelop::(anonymous namespace)::Q_QGS_sdDUChainPrivate::innerFunction()::holder+32>, timeout=0) at /home/kfunk/devel/src/kf5/kdevplatform-stable/languag
e/duchain/duchainlock.cpp:155
#4  0x00007f2644b007da in KDevelop::DUChainWriteLocker::lock (this=0x7f2614021620) at /home/kfunk/devel/src/kf5/kdevplatform-stable/language/duchain/duchainlock.cpp:249
#5  0x00007f2644b0047f in KDevelop::DUChainWriteLocker::DUChainWriteLocker (this=0x7f2614021620, duChainLock=0x7f26467d6be0 <KDevelop::(anonymous namespace)::Q_QGS_sdDUChainPrivate::innerFunction()::holder+32>, timeout=0) at /home/kfunk/
devel/src/kf5/kdevplatform-stable/language/duchain/duchainlock.cpp:233
#6  0x00007f26446962d6 in KDevelop::DUChainPrivate::doMoreCleanup (this=0x7f26467d6bc0 <KDevelop::(anonymous namespace)::Q_QGS_sdDUChainPrivate::innerFunction()::holder>, retries=1, lockFlag=KDevelop::DUChainPrivate::TryLock) at /home/kf
unk/devel/src/kf5/kdevplatform-stable/language/duchain/duchain.cpp:709
#7  0x00007f2644731ca5 in KDevelop::DUChainPrivate::CleanupThread::run (this=0x604000b9a910) at /home/kfunk/devel/src/kf5/kdevplatform-stable/language/duchain/duchain.cpp:290
#8  0x00007f264943784e in QThreadPrivate::start (arg=0x604000b9a910) at thread/qthread_unix.cpp:331
#9  0x00007f2648af16fa in start_thread (arg=0x7f2614023700) at pthread_create.c:333
#10 0x00007f2648205b5d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 12 (Thread 0x7f260cd33700 (LWP 22802)):
#0  0x00007f26481f9e8d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x0000000000438a4e in poll () at /usr/bin/../lib/gcc/x86_64-linux-gnu/5.3.1/../../../../include/c++/5.3.1/iostream:74
#2  0x00007f263d2b231c in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f263d2b242c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007f264966ea7f in QEventDispatcherGlib::processEvents (this=0x602000267ff0, flags=...) at kernel/qeventdispatcher_glib.cpp:418
#5  0x00007f2649615dea in QEventLoop::exec (this=this@entry=0x7f260cd32950, flags=..., flags@entry=...) at kernel/qeventloop.cpp:204
#6  0x00007f26494328a4 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:503
#7  0x00007f2645182bf8 in KDevelop::CompletionWorkerThread::run (this=0x603000928fc0) at /home/kfunk/devel/src/kf5/kdevplatform-stable/language/codecompletion/codecompletionmodel.cpp:89
#8  0x00007f264943784e in QThreadPrivate::start (arg=0x603000928fc0) at thread/qthread_unix.cpp:331
#9  0x00007f2648af16fa in start_thread (arg=0x7f260cd33700) at pthread_create.c:333
#10 0x00007f2648205b5d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 11 (Thread 0x7f2615dff700 (LWP 22807)):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007f264942f928 in _q_futex (op=0, val=3, timeout=0x0, addr=0x6030004f9a38) at thread/qmutex_linux.cpp:146
#2  lockInternal_helper<false> (timeout=-1, elapsedTimer=0x0, d_ptr=...) at thread/qmutex_linux.cpp:187
#3  QBasicMutex::lockInternal (this=0x6030004f9a38) at thread/qmutex_linux.cpp:203
#4  0x00007f264942fa1d in QBasicMutex::lock (this=0x6030004f9a38) at thread/qmutex.h:59
#5  QRecursiveMutexPrivate::lock (timeout=-1, this=0x6030004f9a20) at thread/qmutex.cpp:641
#6  QMutex::lock (this=<optimized out>) at thread/qmutex.cpp:215
#7  0x00007f2644465bfd in QMutexLocker::QMutexLocker (this=0x7f2615dfd060, m=0x6110009632e8) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qmutex.h:128
#8  0x00007f26445070f6 in KDevelop::BackgroundParser::trackerForUrl (this=0x6030004f9e10, url=...) at /home/kfunk/devel/src/kf5/kdevplatform-stable/language/backgroundparser/backgroundparser.cpp:751
#9  0x00007f2644671506 in KDevelop::DUChain::addDocumentChain (this=0x602000247810, chain=0x604002e12710) at /home/kfunk/devel/src/kf5/kdevplatform-stable/language/duchain/duchain.cpp:1253
#10 0x00007f261ace646d in (anonymous namespace)::createTopContext (path=..., environment=...) at /home/kfunk/devel/src/kf5/kdevelop-stable/languages/clang/duchain/clanghelpers.cpp:77
#11 ClangHelpers::buildDUChain(void*, QMultiHash<void*, Import> const&, ParseSession const&, KDevelop::TopDUContext::Features, QHash<void*, KDevelop::ReferencedTopDUContext>&, ClangIndex*, std::function<bool ()> const&) (file=<optimized
out>, imports=..., session=..., features=KDevelop::TopDUContext::Features::AllDeclarationsContextsAndUses, includedFiles={...}, index=<optimized out>, abortFunction=...) at /home/kfunk/devel/src/kf5/kdevelop-stable/languages/clang/duchai
n/clanghelpers.cpp:131
#12 0x00007f261ace607a in ClangHelpers::buildDUChain(void*, QMultiHash<void*, Import> const&, ParseSession const&, KDevelop::TopDUContext::Features, QHash<void*, KDevelop::ReferencedTopDUContext>&, ClangIndex*, std::function<bool ()> con
st&) (file=<optimized out>, imports=..., session=..., features=KDevelop::TopDUContext::Features::AllDeclarationsContextsAndUses, includedFiles={...}, index=<optimized out>, abortFunction=...) at /home/kfunk/devel/src/kf5/kdevelop-stable/
languages/clang/duchain/clanghelpers.cpp:113
#13 0x00007f261b02ce4f in ClangParseJob::run (this=<optimized out>) at /home/kfunk/devel/src/kf5/kdevelop-stable/languages/clang/clangparsejob.cpp:316
#14 0x00007f261b02f8cd in non-virtual thunk to ClangParseJob::run(QSharedPointer<ThreadWeaver::JobInterface>, ThreadWeaver::Thread*) () at /home/kfunk/devel/src/kf5/kdevelop-stable/languages/clang/clangparsejob.cpp:215
#15 0x00007f2642df1630 in ThreadWeaver::IdDecorator::run(QSharedPointer<ThreadWeaver::JobInterface>, ThreadWeaver::Thread*) () from /usr/lib/x86_64-linux-gnu/libKF5ThreadWeaver.so.5
#16 0x00007f2642df1c70 in ThreadWeaver::Executor::run(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /usr/lib/x86_64-linux-gnu/libKF5ThreadWeaver.so.5
#17 0x00007f2642df07c0 in ThreadWeaver::Job::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /usr/lib/x86_64-linux-gnu/libKF5ThreadWeaver.so.5
#18 0x00007f2642df026a in ThreadWeaver::Thread::run() () from /usr/lib/x86_64-linux-gnu/libKF5ThreadWeaver.so.5
#19 0x00007f264943784e in QThreadPrivate::start (arg=0x603000951f40) at thread/qthread_unix.cpp:331
#20 0x00007f2648af16fa in start_thread (arg=0x7f2615dff700) at pthread_create.c:333
#21 0x00007f2648205b5d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 10 (Thread 0x7f26155fe700 (LWP 22808)):
#0  0x00007f2648afa55d in read () at ../sysdeps/unix/syscall-template.S:84
#1  0x000000000044d78d in read () at /usr/bin/../lib/gcc/x86_64-linux-gnu/5.3.1/../../../../include/c++/5.3.1/iostream:74
#2  0x00007f26495b1baf in read (__nbytes=152, __buf=0x7f26155fba10, __fd=<optimized out>) at /usr/include/x86_64-linux-gnu/bits/unistd.h:44
#3  forkfd_wait (ffd=<optimized out>, info=info@entry=0x7f26155fbad0, rusage=rusage@entry=0x0) at io/../../3rdparty/forkfd/forkfd.c:723
#4  0x00007f26495adc6a in QProcessPrivate::waitForDeadChild (this=this@entry=0x615004692980) at io/qprocess_unix.cpp:1096
#5  0x00007f26495487b2 in QProcessPrivate::_q_startupNotification (this=this@entry=0x615004692980) at io/qprocess.cpp:113
#6  0x00007f26495acd90 in QProcessPrivate::waitForStarted (this=0x615004692980, msecs=3000) at io/qprocess_unix.cpp:831
#7  0x00007f2649548465 in QProcess::waitForStarted (this=this@entry=0x7f26155fbea0, msecs=msecs@entry=3000) at io/qprocess.cpp:1777
#8  0x00007f26495485a9 in QProcess::waitForFinished (this=0x7f26155fbea0, msecs=3000) at io/qprocess.cpp:1843
#9  0x00007f260a4a0a64 in QmlJS::Cache::getFileNames (this=<optimized out>, fileInfos=...) at /home/kfunk/devel/src/kf5/kdevelop-stable/languages/qmljs/duchain/cache.cpp:165
#10 0x00007f260a4dd95a in DeclarationBuilder::importDirectory (this=<optimized out>, directory="qml", node=<optimized out>) at /home/kfunk/devel/src/kf5/kdevelop-stable/languages/qmljs/duchain/declarationbuilder.cpp:1027
#11 0x00007f260a4deff2 in DeclarationBuilder::importModule (this=0x7f26155fd5f0, node=<optimized out>) at /home/kfunk/devel/src/kf5/kdevelop-stable/languages/qmljs/duchain/declarationbuilder.cpp:1078
#12 0x00007f260a4df39d in DeclarationBuilder::visit (this=<optimized out>, node=<optimized out>) at /home/kfunk/devel/src/kf5/kdevelop-stable/languages/qmljs/duchain/declarationbuilder.cpp:1084
#13 0x00007f260a4dfb1d in non-virtual thunk to DeclarationBuilder::visit(QmlJS::AST::UiImport*) () at /home/kfunk/devel/src/kf5/kdevelop-stable/languages/qmljs/duchain/declarationbuilder.cpp:1081
#14 0x00007f260a57ea4d in QmlJS::AST::UiImport::accept0 (this=<optimized out>, visitor=0x7f26155fd648) at /home/kfunk/devel/src/kf5/kdevelop-stable/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:917
#15 0x00007f260a56c5bf in QmlJS::AST::Node::accept (this=0x625008273168, visitor=0x7f26155fd648) at /home/kfunk/devel/src/kf5/kdevelop-stable/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:42
#16 0x00007f260a57f328 in QmlJS::AST::Node::accept (node=0x625008273168, visitor=0x7f26155fd648) at /home/kfunk/devel/src/kf5/kdevelop-stable/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:50
#17 QmlJS::AST::UiHeaderItemList::accept0 (this=<optimized out>, visitor=0x7f26155fd648) at /home/kfunk/devel/src/kf5/kdevelop-stable/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:944
#18 0x00007f260a56c5bf in QmlJS::AST::Node::accept (this=0x625008273200, visitor=0x7f26155fd648) at /home/kfunk/devel/src/kf5/kdevelop-stable/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:42
#19 0x00007f260a57c3a8 in QmlJS::AST::Node::accept (visitor=0x7f26155fd648, node=<optimized out>) at /home/kfunk/devel/src/kf5/kdevelop-stable/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:50
#20 QmlJS::AST::UiProgram::accept0 (this=<optimized out>, visitor=0x7f26155fd648) at /home/kfunk/devel/src/kf5/kdevelop-stable/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:813
#21 0x00007f260a56c5bf in QmlJS::AST::Node::accept (this=0x62500821a500, visitor=0x7f26155fd648) at /home/kfunk/devel/src/kf5/kdevelop-stable/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:42
#22 0x00007f260a56c778 in QmlJS::AST::Node::accept (node=0x62500821a500, visitor=0x7f26155fd648) at /home/kfunk/devel/src/kf5/kdevelop-stable/languages/qmljs/libs/qmljs/parser/qmljsast.cpp:50
#23 0x00007f260a4c648f in ContextBuilder::startVisiting (this=<optimized out>, node=0xd4) at /home/kfunk/devel/src/kf5/kdevelop-stable/languages/qmljs/duchain/contextbuilder.cpp:83
#24 0x00007f260a4c9258 in DeclarationBuilder::startVisiting (this=<optimized out>, node=0x62500821a500) at /home/kfunk/devel/src/kf5/kdevelop-stable/languages/qmljs/duchain/declarationbuilder.cpp:110
#25 0x00007f260a473820 in KDevelop::AbstractContextBuilder<QmlJS::AST::Node, QmlJS::AST::IdentifierPropertyName>::supportBuild (this=0x7f26155fd5f0, node=0x62500821a500, context=<optimized out>) at /home/kfunk/devel/install/kf5-stable/in
clude/kdevplatform/language/duchain/builders/abstractcontextbuilder.h:134
#26 0x00007f260a4857bd in KDevelop::AbstractTypeBuilder<QmlJS::AST::Node, QmlJS::AST::IdentifierPropertyName, ContextBuilder>::supportBuild (this=0x7f26155fd5f0, node=0x62500821a500, context=0x6040036ce350) at /home/kfunk/devel/install/k
f5-stable/include/kdevplatform/language/duchain/builders/abstracttypebuilder.h:85
#27 0x00007f260a4730fa in KDevelop::AbstractContextBuilder<QmlJS::AST::Node, QmlJS::AST::IdentifierPropertyName>::build (this=0x7f26155fd5f0, url=..., node=0x62500821a500, updateContext=...) at /home/kfunk/devel/install/kf5-stable/includ
e/kdevplatform/language/duchain/builders/abstractcontextbuilder.h:114
#28 0x00007f260a4c8671 in DeclarationBuilder::build (this=<optimized out>, url=..., node=0x62500821a500, updateContext=...) at /home/kfunk/devel/src/kf5/kdevelop-stable/languages/qmljs/duchain/declarationbuilder.cpp:81
#29 0x00007f260a46b80c in QmlJsParseJob::run (this=<optimized out>, pointer=..., thread=<optimized out>) at /home/kfunk/devel/src/kf5/kdevelop-stable/languages/qmljs/qmljsparsejob.cpp:145
#30 0x00007f260a46d72d in non-virtual thunk to QmlJsParseJob::run(QSharedPointer<ThreadWeaver::JobInterface>, ThreadWeaver::Thread*) () at /home/kfunk/devel/src/kf5/kdevelop-stable/languages/qmljs/qmljsparsejob.cpp:95
#31 0x00007f2642df1630 in ThreadWeaver::IdDecorator::run(QSharedPointer<ThreadWeaver::JobInterface>, ThreadWeaver::Thread*) () from /usr/lib/x86_64-linux-gnu/libKF5ThreadWeaver.so.5
#32 0x00007f2642df1c70 in ThreadWeaver::Executor::run(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /usr/lib/x86_64-linux-gnu/libKF5ThreadWeaver.so.5
#33 0x00007f2642df07c0 in ThreadWeaver::Job::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /usr/lib/x86_64-linux-gnu/libKF5ThreadWeaver.so.5
#34 0x00007f2642df026a in ThreadWeaver::Thread::run() () from /usr/lib/x86_64-linux-gnu/libKF5ThreadWeaver.so.5
#35 0x00007f264943784e in QThreadPrivate::start (arg=0x603000950f80) at thread/qthread_unix.cpp:331
#36 0x00007f2648af16fa in start_thread (arg=0x7f26155fe700) at pthread_create.c:333
#37 0x00007f2648205b5d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 9 (Thread 0x7f260dd58700 (LWP 22809)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f2649438aeb in QWaitConditionPrivate::wait (time=18446744073709551615, this=0x60800040fa20) at thread/qwaitcondition_unix.cpp:136
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x602000136a90, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:208
#3  0x00007f2642dee29f in ThreadWeaver::Weaver::takeFirstAvailableJobOrSuspendOrWait(ThreadWeaver::Thread*, bool, bool, bool) () from /usr/lib/x86_64-linux-gnu/libKF5ThreadWeaver.so.5
#4  0x00007f2642df24c8 in ?? () from /usr/lib/x86_64-linux-gnu/libKF5ThreadWeaver.so.5
#5  0x00007f2642ded46d in ThreadWeaver::Weaver::applyForWork(ThreadWeaver::Thread*, bool) () from /usr/lib/x86_64-linux-gnu/libKF5ThreadWeaver.so.5
#6  0x00007f2642df0333 in ThreadWeaver::Thread::run() () from /usr/lib/x86_64-linux-gnu/libKF5ThreadWeaver.so.5
#7  0x00007f264943784e in QThreadPrivate::start (arg=0x60300096ef80) at thread/qthread_unix.cpp:331
#8  0x00007f2648af16fa in start_thread (arg=0x7f260dd58700) at pthread_create.c:333
#9  0x00007f2648205b5d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 8 (Thread 0x7f260d557700 (LWP 22810)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f2649438aeb in QWaitConditionPrivate::wait (time=18446744073709551615, this=0x60800040fa20) at thread/qwaitcondition_unix.cpp:136
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x602000136a90, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:208
#3  0x00007f2642dee29f in ThreadWeaver::Weaver::takeFirstAvailableJobOrSuspendOrWait(ThreadWeaver::Thread*, bool, bool, bool) () from /usr/lib/x86_64-linux-gnu/libKF5ThreadWeaver.so.5
#4  0x00007f2642df24c8 in ?? () from /usr/lib/x86_64-linux-gnu/libKF5ThreadWeaver.so.5
#5  0x00007f2642ded46d in ThreadWeaver::Weaver::applyForWork(ThreadWeaver::Thread*, bool) () from /usr/lib/x86_64-linux-gnu/libKF5ThreadWeaver.so.5
#6  0x00007f2642df2522 in ?? () from /usr/lib/x86_64-linux-gnu/libKF5ThreadWeaver.so.5
#7  0x00007f2642ded46d in ThreadWeaver::Weaver::applyForWork(ThreadWeaver::Thread*, bool) () from /usr/lib/x86_64-linux-gnu/libKF5ThreadWeaver.so.5
#8  0x00007f2642df2522 in ?? () from /usr/lib/x86_64-linux-gnu/libKF5ThreadWeaver.so.5
#9  0x00007f2642ded46d in ThreadWeaver::Weaver::applyForWork(ThreadWeaver::Thread*, bool) () from /usr/lib/x86_64-linux-gnu/libKF5ThreadWeaver.so.5
#10 0x00007f2642df2522 in ?? () from /usr/lib/x86_64-linux-gnu/libKF5ThreadWeaver.so.5
#11 0x00007f2642ded46d in ThreadWeaver::Weaver::applyForWork(ThreadWeaver::Thread*, bool) () from /usr/lib/x86_64-linux-gnu/libKF5ThreadWeaver.so.5
#12 0x00007f2642df2522 in ?? () from /usr/lib/x86_64-linux-gnu/libKF5ThreadWeaver.so.5
#13 0x00007f2642ded46d in ThreadWeaver::Weaver::applyForWork(ThreadWeaver::Thread*, bool) () from /usr/lib/x86_64-linux-gnu/libKF5ThreadWeaver.so.5
#14 0x00007f2642df0333 in ThreadWeaver::Thread::run() () from /usr/lib/x86_64-linux-gnu/libKF5ThreadWeaver.so.5
#15 0x00007f264943784e in QThreadPrivate::start (arg=0x60300096bf80) at thread/qthread_unix.cpp:331
#16 0x00007f2648af16fa in start_thread (arg=0x7f260d557700) at pthread_create.c:333
#17 0x00007f2648205b5d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 7 (Thread 0x7f260bcbb700 (LWP 22811)):
#0  0x00007f2648afac5d in nanosleep () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007f26494e7c8d in qt_nanosleep (amount=...) at tools/qelapsedtimer_unix.cpp:185
#2  0x00007f2649436c84 in QThread::usleep (usecs=<optimized out>) at thread/qthread_unix.cpp:475
#3  0x00007f2644afed91 in KDevelop::DUChainLock::lockForWrite (this=0x7f26467d6be0 <KDevelop::(anonymous namespace)::Q_QGS_sdDUChainPrivate::innerFunction()::holder+32>, timeout=0) at /home/kfunk/devel/src/kf5/kdevplatform-stable/languag
e/duchain/duchainlock.cpp:155
#4  0x00007f2644b007da in KDevelop::DUChainWriteLocker::lock (this=0x7f260bcb92d0) at /home/kfunk/devel/src/kf5/kdevplatform-stable/language/duchain/duchainlock.cpp:249
#5  0x00007f2644b0047f in KDevelop::DUChainWriteLocker::DUChainWriteLocker (this=0x7f260bcb92d0, duChainLock=0x0, timeout=0) at /home/kfunk/devel/src/kf5/kdevplatform-stable/language/duchain/duchainlock.cpp:233
#6  0x00007f261ace6281 in ClangHelpers::buildDUChain(void*, QMultiHash<void*, Import> const&, ParseSession const&, KDevelop::TopDUContext::Features, QHash<void*, KDevelop::ReferencedTopDUContext>&, ClangIndex*, std::function<bool ()> con
st&) (file=<optimized out>, imports=..., session=..., features=KDevelop::TopDUContext::Features::AllDeclarationsContextsAndUses, includedFiles={...}, index=<optimized out>, abortFunction=...) at /home/kfunk/devel/src/kf5/kdevelop-stable/
languages/clang/duchain/clanghelpers.cpp:128
#7  0x00007f261ace607a in ClangHelpers::buildDUChain(void*, QMultiHash<void*, Import> const&, ParseSession const&, KDevelop::TopDUContext::Features, QHash<void*, KDevelop::ReferencedTopDUContext>&, ClangIndex*, std::function<bool ()> con
st&) (file=<optimized out>, imports=..., session=..., features=KDevelop::TopDUContext::Features::AllDeclarationsContextsAndUses, includedFiles={...}, index=<optimized out>, abortFunction=...) at /home/kfunk/devel/src/kf5/kdevelop-stable/
languages/clang/duchain/clanghelpers.cpp:113
#8  0x00007f261ace607a in ClangHelpers::buildDUChain(void*, QMultiHash<void*, Import> const&, ParseSession const&, KDevelop::TopDUContext::Features, QHash<void*, KDevelop::ReferencedTopDUContext>&, ClangIndex*, std::function<bool ()> con
st&) (file=<optimized out>, imports=..., session=..., features=KDevelop::TopDUContext::Features::AllDeclarationsContextsAndUses, includedFiles={...}, index=<optimized out>, abortFunction=...) at /home/kfunk/devel/src/kf5/kdevelop-stable/
languages/clang/duchain/clanghelpers.cpp:113
#9  0x00007f261b02ce4f in ClangParseJob::run (this=<optimized out>) at /home/kfunk/devel/src/kf5/kdevelop-stable/languages/clang/clangparsejob.cpp:316
#10 0x00007f261b02f8cd in non-virtual thunk to ClangParseJob::run(QSharedPointer<ThreadWeaver::JobInterface>, ThreadWeaver::Thread*) () at /home/kfunk/devel/src/kf5/kdevelop-stable/languages/clang/clangparsejob.cpp:215
#11 0x00007f2642df1630 in ThreadWeaver::IdDecorator::run(QSharedPointer<ThreadWeaver::JobInterface>, ThreadWeaver::Thread*) () from /usr/lib/x86_64-linux-gnu/libKF5ThreadWeaver.so.5
#12 0x00007f2642df1c70 in ThreadWeaver::Executor::run(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /usr/lib/x86_64-linux-gnu/libKF5ThreadWeaver.so.5
#13 0x00007f2642df07c0 in ThreadWeaver::Job::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /usr/lib/x86_64-linux-gnu/libKF5ThreadWeaver.so.5
#14 0x00007f2642df026a in ThreadWeaver::Thread::run() () from /usr/lib/x86_64-linux-gnu/libKF5ThreadWeaver.so.5
#15 0x00007f264943784e in QThreadPrivate::start (arg=0x60300096a780) at thread/qthread_unix.cpp:331
#16 0x00007f2648af16fa in start_thread (arg=0x7f260bcbb700) at pthread_create.c:333
#17 0x00007f2648205b5d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 6 (Thread 0x7f2609710700 (LWP 22814)):
#0  0x00007f26481f9e8d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x0000000000438a4e in poll () at /usr/bin/../lib/gcc/x86_64-linux-gnu/5.3.1/../../../../include/c++/5.3.1/iostream:74
#2  0x00007f263d2b231c in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f263d2b242c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007f264966ea9b in QEventDispatcherGlib::processEvents (this=0x602000279ff0, flags=...) at kernel/qeventdispatcher_glib.cpp:420
#5  0x00007f2649615dea in QEventLoop::exec (this=this@entry=0x7f260970f950, flags=..., flags@entry=...) at kernel/qeventloop.cpp:204
#6  0x00007f26494328a4 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:503
#7  0x00007f2645182bf8 in KDevelop::CompletionWorkerThread::run (this=0x60300098a6d0) at /home/kfunk/devel/src/kf5/kdevplatform-stable/language/codecompletion/codecompletionmodel.cpp:89
#8  0x00007f264943784e in QThreadPrivate::start (arg=0x60300098a6d0) at thread/qthread_unix.cpp:331
#9  0x00007f2648af16fa in start_thread (arg=0x7f2609710700) at pthread_create.c:333
#10 0x00007f2648205b5d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 5 (Thread 0x7f26043ee700 (LWP 22826)):
#0  0x00007f26481f9e8d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x0000000000438a4e in poll () at /usr/bin/../lib/gcc/x86_64-linux-gnu/5.3.1/../../../../include/c++/5.3.1/iostream:74
#2  0x00007f263d2b231c in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f263d2b242c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007f264966ea9b in QEventDispatcherGlib::processEvents (this=0x602000254770, flags=...) at kernel/qeventdispatcher_glib.cpp:420
#5  0x00007f2649615dea in QEventLoop::exec (this=this@entry=0x7f26043ed950, flags=..., flags@entry=...) at kernel/qeventloop.cpp:204
#6  0x00007f26494328a4 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:503
#7  0x00007f2645182bf8 in KDevelop::CompletionWorkerThread::run (this=0x603000795760) at /home/kfunk/devel/src/kf5/kdevplatform-stable/language/codecompletion/codecompletionmodel.cpp:89
#8  0x00007f264943784e in QThreadPrivate::start (arg=0x603000795760) at thread/qthread_unix.cpp:331
#9  0x00007f2648af16fa in start_thread (arg=0x7f26043ee700) at pthread_create.c:333
#10 0x00007f2648205b5d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 4 (Thread 0x7f260b4ba700 (LWP 22943)):
#0  0x00007f26481f9e8d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x0000000000438a4e in poll () at /usr/bin/../lib/gcc/x86_64-linux-gnu/5.3.1/../../../../include/c++/5.3.1/iostream:74
#2  0x00007f263d2b231c in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f263d2b242c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007f264966ea7f in QEventDispatcherGlib::processEvents (this=0x6020006ecc50, flags=...) at kernel/qeventdispatcher_glib.cpp:418
#5  0x00007f2649615dea in QEventLoop::exec (this=this@entry=0x7f260b4b9c60, flags=..., flags@entry=...) at kernel/qeventloop.cpp:204
#6  0x00007f26494328a4 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:503
#7  0x00007f264ea7b3c5 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Qml.so.5
#8  0x00007f264943784e in QThreadPrivate::start (arg=0x60c002122180) at thread/qthread_unix.cpp:331
#9  0x00007f2648af16fa in start_thread (arg=0x7f260b4ba700) at pthread_create.c:333
#10 0x00007f2648205b5d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 3 (Thread 0x7f260e766700 (LWP 23771)):
#0  0x00007f26481f9e8d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x0000000000438a4e in poll () at /usr/bin/../lib/gcc/x86_64-linux-gnu/5.3.1/../../../../include/c++/5.3.1/iostream:74
#2  0x00007f263d2b231c in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f263d2b242c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007f264966ea9b in QEventDispatcherGlib::processEvents (this=0x6020011db930, flags=...) at kernel/qeventdispatcher_glib.cpp:420
#5  0x00007f2649615dea in QEventLoop::exec (this=this@entry=0x7f260e765950, flags=..., flags@entry=...) at kernel/qeventloop.cpp:204
#6  0x00007f26494328a4 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:503
#7  0x00007f2645182bf8 in KDevelop::CompletionWorkerThread::run (this=0x603002afd690) at /home/kfunk/devel/src/kf5/kdevplatform-stable/language/codecompletion/codecompletionmodel.cpp:89
#8  0x00007f264943784e in QThreadPrivate::start (arg=0x603002afd690) at thread/qthread_unix.cpp:331
#9  0x00007f2648af16fa in start_thread (arg=0x7f260e766700) at pthread_create.c:333
#10 0x00007f2648205b5d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 2 (Thread 0x7f25d3ef9700 (LWP 25973)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f263ed02bd4 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Script.so.5
#2  0x00007f263ed02c19 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Script.so.5
#3  0x00007f2648af16fa in start_thread (arg=0x7f25d3ef9700) at pthread_create.c:333
#4  0x00007f2648205b5d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 1 (Thread 0x7f26320e5940 (LWP 22779)):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007f264942f928 in _q_futex (op=0, val=3, timeout=0x0, addr=0x6060011e5fe0) at thread/qmutex_linux.cpp:146
#2  lockInternal_helper<false> (timeout=-1, elapsedTimer=0x0, d_ptr=...) at thread/qmutex_linux.cpp:187
#3  QBasicMutex::lockInternal (this=0x6060011e5fe0) at thread/qmutex_linux.cpp:203
#4  0x00007f260a4a159d in QMutexLocker::QMutexLocker (this=<optimized out>, m=<optimized out>) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qmutex.h:128
#5  QmlJS::Cache::setFileCustomIncludes (this=0x6060011e5fe0, file=..., dirs={...}) at /home/kfunk/devel/src/kf5/kdevelop-stable/languages/qmljs/duchain/cache.cpp:196
#6  0x00007f260a46a63b in QmlJsParseJob::QmlJsParseJob (this=<optimized out>, url=..., languageSupport=<optimized out>) at /home/kfunk/devel/src/kf5/kdevelop-stable/languages/qmljs/qmljsparsejob.cpp:83
#7  0x00007f260a48e19b in non-virtual thunk to KDevQmlJsPlugin::createParseJob(KDevelop::IndexedString const&) () at /home/kfunk/devel/src/kf5/kdevelop-stable/languages/qmljs/kdevqmljsplugin.cpp:96
#8  0x00007f264452d3e1 in KDevelop::BackgroundParserPrivate::createParseJob (this=0x611000963240, url=..., features=KDevelop::TopDUContext::Features::VisibleDeclarationsAndContexts, notifyWhenReady=Python Exception <class 'TypeError'> un
supported operand type(s) for +: 'NoneType' and 'str':
, priority=10000) at /home/kfunk/devel/src/kf5/kdevplatform-stable/language/backgroundparser/backgroundparser.cpp:265
#9  0x00007f26445171e2 in KDevelop::BackgroundParserPrivate::parseDocumentsInternal (this=0x611000963240) at /home/kfunk/devel/src/kf5/kdevplatform-stable/language/backgroundparser/backgroundparser.cpp:199
#10 0x00007f26445001d2 in KDevelop::BackgroundParser::parseDocuments (this=0x6030004f9e10) at /home/kfunk/devel/src/kf5/kdevplatform-stable/language/backgroundparser/backgroundparser.cpp:598
#11 0x00007f26455120f2 in KDevelop::BackgroundParser::qt_static_metacall (_o=0x6030004f9e10, _c=QMetaObject::InvokeMetaMethod, _id=18, _a=0x602001061f70) at /home/kfunk/devel/build/kf5/kdevplatform-stable/language/moc_backgroundparser.cp
p:264
#12 0x00007f2649647ea1 in QObject::event (this=0x6030004f9e10, e=<optimized out>) at kernel/qobject.cpp:1239
#13 0x00007f2649f0b05c in QApplicationPrivate::notify_helper (this=this@entry=0x61300000de80, receiver=receiver@entry=0x6030004f9e10, e=e@entry=0x60800179e5a0) at kernel/qapplication.cpp:3716
#14 0x00007f2649f10516 in QApplication::notify (this=0x7ffdf5a01320, receiver=0x6030004f9e10, e=0x60800179e5a0) at kernel/qapplication.cpp:3499
#15 0x00007f264961862b in QCoreApplication::notifyInternal (this=0x7ffdf5a01320, receiver=0x6030004f9e10, event=event@entry=0x60800179e5a0) at kernel/qcoreapplication.cpp:965
#16 0x00007f264961aa26 in QCoreApplication::sendEvent (event=0x60800179e5a0, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:224
#17 QCoreApplicationPrivate::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0, data=0x60b00000ad80) at kernel/qcoreapplication.cpp:1593
#18 0x00007f264961af08 in QCoreApplication::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0) at kernel/qcoreapplication.cpp:1451
#19 0x00007f264966e673 in postEventSourceDispatch (s=0x60b000029860) at kernel/qeventdispatcher_glib.cpp:271
#20 0x00007f263d2b2127 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#21 0x00007f263d2b2380 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#22 0x00007f263d2b242c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#23 0x00007f264966ea7f in QEventDispatcherGlib::processEvents (this=0x603000027c10, flags=...) at kernel/qeventdispatcher_glib.cpp:418
#24 0x00007f2649615dea in QEventLoop::exec (this=this@entry=0x7ffdf59fd600, flags=..., flags@entry=...) at kernel/qeventloop.cpp:204
#25 0x00007f264961de8c in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1229
#26 0x0000000000506ea3 in main (argc=<optimized out>, argv=0x7ffdf5a03080) at /home/kfunk/devel/src/kf5/kdevelop-stable/app/main.cpp:714

Reproducible: Always
Comment 1 Denis Steckelmacher 2016-05-28 08:21:33 UTC
Hi,

For what I see in the stack trace, QmlJS::Cache calls "qmlplugindump" to import a binary QML plugin, and "qmlplugindump" somehow hangs (even though a maximum delay of 3 seconds is given to QProcess::waitForFinished). The problem is that QmlJS::Cache holds a mutex during that hang, which prevents other QmlJS parse jobs from modifying the cache (adding new files to it). The parse jobs therefore hang too, while holding the global KDevelop background mutex. This in turn hangs every parse job.

I know how to possibly fix this issue (and prevent a 3-second hang if qmlplugindump is slow), but do you have an example project against which I could test my fix? (on my computer, qmljs's testsuite passes 100%). I would like to have a zip with all the files you have open (and that produce the error), because QmlJS::Cache is used for inter-file imports and uses project-wide structures.
Comment 2 Denis Steckelmacher 2016-06-18 09:46:42 UTC
Git commit 8389fb2330207b2fa04627d47eb754342f1adc85 by Denis Steckelmacher.
Committed on 18/06/2016 at 09:42.
Pushed by dsteckelmacher into branch 'master'.

qmljs: Don't hold locks while performing filesystem accesses or calling qmlplugindump

This commit reduces the impact of a slow qmlplugindump executable, which reduces or fixes
bug #363509.
REVIEW: 128227

M  +14   -7    languages/qmljs/duchain/cache.cpp

http://commits.kde.org/kdevelop/8389fb2330207b2fa04627d47eb754342f1adc85
Comment 3 Kevin Funk 2016-06-18 14:17:35 UTC
Git commit 0ac761ce294b2ad9f3846c6dfc91872da673e795 by Kevin Funk, on behalf of Denis Steckelmacher.
Committed on 18/06/2016 at 13:55.
Pushed by kfunk into branch '5.0'.

qmljs: Don't hold locks while performing filesystem accesses or calling qmlplugindump

This commit reduces the impact of a slow qmlplugindump executable, which reduces or fixes
bug #363509.
REVIEW: 128227
(cherry picked from commit 8389fb2330207b2fa04627d47eb754342f1adc85)

M  +14   -7    languages/qmljs/duchain/cache.cpp

http://commits.kde.org/kdevelop/0ac761ce294b2ad9f3846c6dfc91872da673e795