<p style="margin: 0px; text-indent: 0px;">Hi there,</p><p style="margin: 0px; text-indent: 0px;"><br></p><p style="margin: 0px; text-indent: 0px;">I was running some problems in controlflowgraph plugin regarding cmakeutils and kconfig thread-safety stuff. Basically when I had</p>


<p style="margin: 0px; text-indent: 0px;">multiple threads generating graphs occasionally I got the crash display below. After including a QMutex in duchaincontrolflow.cpp:500 crashes were solved, multiple graph generation threads can now live together. However, the same crash (and backtrace) is occasionally produced when generating a lot of graphs while background parsing is running.</p>


<p style="margin: 0px; text-indent: 0px;"><br></p><p style="margin: 0px; text-indent: 0px;">Apparently some thread from background parser or cmakemanager stuff running along with controlflowgraph thread is causing</p><p style="margin: 0px; text-indent: 0px;">


the creash. IIRC, that would be a case for the foreground lock but, while it isn't already fully usable, how should I address this issue by now ? I wouldn't like to disable graph generation while parser is running since that might make graphs unavailable for a long time.<br>

</p><p style="margin: 0px; text-indent: 0px;"><br></p><p style="margin: 0px; text-indent: 0px;">
Thanks,<br>Sandro<br></p><p style="margin: 0px; text-indent: 0px;">
</p><p style="margin: 0px; text-indent: 0px;">-------------------------------------------------------------<br></p><p style="margin: 0px; text-indent: 0px;">Thread 5 (Thread 0xa30ffb70 (LWP 1362)):</p>
<p style="margin: 0px; text-indent: 0px;">[KCrash Handler]</p>
<p style="margin: 0px; text-indent: 0px;">#7  0xb76fa424 in __kernel_vsyscall ()</p>
<p style="margin: 0px; text-indent: 0px;">#8  0xb4fa1561 in raise () from /lib/libc.so.6</p>
<p style="margin: 0px; text-indent: 0px;">#9  0xb4fa2d62 in abort () from /lib/libc.so.6</p>
<p style="margin: 0px; text-indent: 0px;">#10 0xb4fdcc85 in __libc_message () from /lib/libc.so.6</p>
<p style="margin: 0px; text-indent: 0px;">#11 0xb4fe2b61 in malloc_printerr () from /lib/libc.so.6</p>
<p style="margin: 0px; text-indent: 0px;">#12 0xb4fe5cf8 in _int_malloc () from /lib/libc.so.6</p>
<p style="margin: 0px; text-indent: 0px;">#13 0xb4fe7583 in malloc () from /lib/libc.so.6</p>
<p style="margin: 0px; text-indent: 0px;">#14 0xb5fabad9 in qMalloc (size=60) at /data/kdesvn/qt-copy/src/corelib/global/qmalloc.cpp:55</p>
<p style="margin: 0px; text-indent: 0px;">#15 0xb6004624 in QString (this=0xa30fe4d4, unicode=0xa948be2a, size=20) at /data/kdesvn/qt-copy/src/corelib/tools/qstring.cpp:980</p>
<p style="margin: 0px; text-indent: 0px;">#16 0xb6009201 in QString::mid (this=0xa30fe640, position=4, n=20) at /data/kdesvn/qt-copy/src/corelib/tools/qstring.cpp:3267</p>
<p style="margin: 0px; text-indent: 0px;">#17 0xb75ae701 in lookupPrefix (prefix=..., relpath=..., relPart=..., regexp=..., list=..., relList=..., recursive=false, unique=false) at /data/kdesvn/kdelibs/kdecore/kernel/kstandarddirs.cpp:736</p>




<p style="margin: 0px; text-indent: 0px;">#18 0xb75aeaea in lookupPrefix (prefix=<value optimized out>, relpath=<value optimized out>, relPart=..., regexp=..., list=..., relList=..., recursive=<value optimized out>, </p>




<p style="margin: 0px; text-indent: 0px;">    unique=<value optimized out>) at /data/kdesvn/kdelibs/kdecore/kernel/kstandarddirs.cpp:815</p>
<p style="margin: 0px; text-indent: 0px;">#19 0xb75aeaea in lookupPrefix (prefix=<value optimized out>, relpath=<value optimized out>, relPart=..., regexp=..., list=..., relList=..., recursive=<value optimized out>, </p>




<p style="margin: 0px; text-indent: 0px;">    unique=<value optimized out>) at /data/kdesvn/kdelibs/kdecore/kernel/kstandarddirs.cpp:815</p>
<p style="margin: 0px; text-indent: 0px;">#20 0xb75aeaea in lookupPrefix (prefix=<value optimized out>, relpath=<value optimized out>, relPart=..., regexp=..., list=..., relList=..., recursive=<value optimized out>, </p>




<p style="margin: 0px; text-indent: 0px;">    unique=<value optimized out>) at /data/kdesvn/kdelibs/kdecore/kernel/kstandarddirs.cpp:815</p>
<p style="margin: 0px; text-indent: 0px;">#21 0xb75af23e in KStandardDirs::findAllResources (this=0x8abce00, type=0xb74620f5 "config", filter=..., options=..., relList=...) at /data/kdesvn/kdelibs/kdecore/kernel/kstandarddirs.cpp:865</p>




<p style="margin: 0px; text-indent: 0px;">#22 0xb75af57f in KStandardDirs::findAllResources (this=0x8abce00, type=0xb74620f5 "config", filter=..., options=...) at /data/kdesvn/kdelibs/kdecore/kernel/kstandarddirs.cpp:877</p>




<p style="margin: 0px; text-indent: 0px;">#23 0xb750ea10 in KConfigPrivate::parseConfigFiles (this=0x8ae6808) at /data/kdesvn/kdelibs/kdecore/config/kconfig.cpp:501</p>
<p style="margin: 0px; text-indent: 0px;">#24 0xb750ecbc in KConfig::reparseConfiguration (this=0x8c6e650) at /data/kdesvn/kdelibs/kdecore/config/kconfig.cpp:453</p>
<p style="margin: 0px; text-indent: 0px;">#25 0xb73f12fe in KDevelop::Project::projectConfiguration (this=0x8c937b0) at /data/kdesvn/extragear/sdk/kdevplatform/shell/project.cpp:468</p>
<p style="margin: 0px; text-indent: 0px;">#26 0xaf834b76 in CMake::currentInstallDir (project=0x8c937b0) at /data/kdesvn/extragear/sdk/kdevelop/projectmanagers/cmake/cmakeutils.cpp:139</p>
<p style="margin: 0px; text-indent: 0px;">#27 0xaf85244f in fetchInstallDir (project=0x8c937b0, dirs=...) at /data/kdesvn/extragear/sdk/kdevelop/projectmanagers/cmake/cmakemanager.cpp:108</p>
<p style="margin: 0px; text-indent: 0px;">#28 resolveSystemDirs (project=0x8c937b0, dirs=...) at /data/kdesvn/extragear/sdk/kdevelop/projectmanagers/cmake/cmakemanager.cpp:124</p>
<p style="margin: 0px; text-indent: 0px;">#29 0xaf8529e4 in CMakeManager::includeDirectories (this=0x8c93a80, item=0x8cb9050) at /data/kdesvn/extragear/sdk/kdevelop/projectmanagers/cmake/cmakemanager.cpp:659</p>
<p style="margin: 0px; text-indent: 0px;">#30 0xaaba7774 in DUChainControlFlow::globalNamespaceOrFolderNames (this=0x8f60810, declaration=0x9d87d78) at /data/kdesvn/controlflowgraph/duchaincontrolflow.cpp:500</p>
<p style="margin: 0px; text-indent: 0px;">#31 0xaaba8823 in DUChainControlFlow::prependFolderNames (this=0x8f60810, declaration=0x9d893a0) at /data/kdesvn/controlflowgraph/duchaincontrolflow.cpp:538</p>
<p style="margin: 0px; text-indent: 0px;">#32 0xaaba9061 in DUChainControlFlow::processFunctionCall (this=0x8f60810, source=0x9de98a0, target=0x975e9f0, use=...) at /data/kdesvn/controlflowgraph/duchaincontrolflow.cpp:239</p>




<p style="margin: 0px; text-indent: 0px;">#33 0xaabaa288 in DUChainControlFlow::useDeclarationsFromDefinition (this=0x8f60810, definition=0x9de98a0, topContext=0x98b8da0, context=0x9dd3db0)</p>
<p style="margin: 0px; text-indent: 0px;">    at /data/kdesvn/controlflowgraph/duchaincontrolflow.cpp:416</p>
<p style="margin: 0px; text-indent: 0px;">#34 0xaabaa231 in DUChainControlFlow::useDeclarationsFromDefinition (this=0x8f60810, definition=0x9de98a0, topContext=0x98b8da0, context=0x9dbbd90)</p>
<p style="margin: 0px; text-indent: 0px;">    at /data/kdesvn/controlflowgraph/duchaincontrolflow.cpp:423</p>
<p style="margin: 0px; text-indent: 0px;">#35 0xaabaa231 in DUChainControlFlow::useDeclarationsFromDefinition (this=0x8f60810, definition=0x9de98a0, topContext=0x98b8da0, context=0x9dbabc8)</p>
<p style="margin: 0px; text-indent: 0px;">    at /data/kdesvn/controlflowgraph/duchaincontrolflow.cpp:423</p>
<p style="margin: 0px; text-indent: 0px;">#36 0xaabaa675 in DUChainControlFlow::generateControlFlowForDeclaration (this=0x8f60810, idefinition=..., itopContext=..., iuppermostExecutableContext=...)</p>
<p style="margin: 0px; text-indent: 0px;">    at /data/kdesvn/controlflowgraph/duchaincontrolflow.cpp:129</p>
<p style="margin: 0px; text-indent: 0px;">#37 0xaabaa874 in DUChainControlFlow::run (this=0x8f60810) at /data/kdesvn/controlflowgraph/duchaincontrolflow.cpp:78</p>
<p style="margin: 0px; text-indent: 0px;">#38 0xb700148d in ThreadWeaver::JobRunHelper::runTheJob (this=0xa30ff24c, th=0xa480da70, job=0x8f60810) at /data/kdesvn/kdelibs/threadweaver/Weaver/Job.cpp:106</p>
<p style="margin: 0px; text-indent: 0px;">#39 0xb70017f1 in ThreadWeaver::Job::execute (this=0x8f60810, th=0xa480da70) at /data/kdesvn/kdelibs/threadweaver/Weaver/Job.cpp:135</p>
<p style="margin: 0px; text-indent: 0px;">#40 0xb70004da in ThreadWeaver::ThreadRunHelper::run (this=0xa30ff2d4, parent=0xa480be38, th=0xa480da70) at /data/kdesvn/kdelibs/threadweaver/Weaver/Thread.cpp:95</p>
<p style="margin: 0px; text-indent: 0px;">#41 0xb7000c2b in ThreadWeaver::Thread::run (this=0xa480da70) at /data/kdesvn/kdelibs/threadweaver/Weaver/Thread.cpp:142</p>
<p style="margin: 0px; text-indent: 0px;">#42 0xb5fb2dbc in QThreadPrivate::start (arg=0xa480da70) at /data/kdesvn/qt-copy/src/corelib/thread/qthread_unix.cpp:248</p>
<p style="margin: 0px; text-indent: 0px;">#43 0xb5ef994c in start_thread () from /lib/libpthread.so.0</p>
<p style="margin: 0px; text-indent: 0px;">#44 0xb5044eae in clone () from /lib/libc.so.6</p>
<p style="margin: 0px; text-indent: 0px;"></p>