Possible thread-safety issue in cmakemanager ?

Sandro Andrade sandro.andrade at gmail.com
Mon Apr 19 02:58:54 UTC 2010


Hi there,


I was running some problems in controlflowgraph plugin regarding cmakeutils
and kconfig thread-safety stuff. Basically when I had

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.


Apparently some thread from background parser or cmakemanager stuff running
along with controlflowgraph thread is causing

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.


Thanks,
Sandro

-------------------------------------------------------------

Thread 5 (Thread 0xa30ffb70 (LWP 1362)):

[KCrash Handler]

#7 0xb76fa424 in __kernel_vsyscall ()

#8 0xb4fa1561 in raise () from /lib/libc.so.6

#9 0xb4fa2d62 in abort () from /lib/libc.so.6

#10 0xb4fdcc85 in __libc_message () from /lib/libc.so.6

#11 0xb4fe2b61 in malloc_printerr () from /lib/libc.so.6

#12 0xb4fe5cf8 in _int_malloc () from /lib/libc.so.6

#13 0xb4fe7583 in malloc () from /lib/libc.so.6

#14 0xb5fabad9 in qMalloc (size=60) at
/data/kdesvn/qt-copy/src/corelib/global/qmalloc.cpp:55

#15 0xb6004624 in QString (this=0xa30fe4d4, unicode=0xa948be2a, size=20) at
/data/kdesvn/qt-copy/src/corelib/tools/qstring.cpp:980

#16 0xb6009201 in QString::mid (this=0xa30fe640, position=4, n=20) at
/data/kdesvn/qt-copy/src/corelib/tools/qstring.cpp:3267

#17 0xb75ae701 in lookupPrefix (prefix=..., relpath=..., relPart=...,
regexp=..., list=..., relList=..., recursive=false, unique=false) at
/data/kdesvn/kdelibs/kdecore/kernel/kstandarddirs.cpp:736

#18 0xb75aeaea in lookupPrefix (prefix=<value optimized out>, relpath=<value
optimized out>, relPart=..., regexp=..., list=..., relList=...,
recursive=<value optimized out>,

unique=<value optimized out>) at
/data/kdesvn/kdelibs/kdecore/kernel/kstandarddirs.cpp:815

#19 0xb75aeaea in lookupPrefix (prefix=<value optimized out>, relpath=<value
optimized out>, relPart=..., regexp=..., list=..., relList=...,
recursive=<value optimized out>,

unique=<value optimized out>) at
/data/kdesvn/kdelibs/kdecore/kernel/kstandarddirs.cpp:815

#20 0xb75aeaea in lookupPrefix (prefix=<value optimized out>, relpath=<value
optimized out>, relPart=..., regexp=..., list=..., relList=...,
recursive=<value optimized out>,

unique=<value optimized out>) at
/data/kdesvn/kdelibs/kdecore/kernel/kstandarddirs.cpp:815

#21 0xb75af23e in KStandardDirs::findAllResources (this=0x8abce00,
type=0xb74620f5 "config", filter=..., options=..., relList=...) at
/data/kdesvn/kdelibs/kdecore/kernel/kstandarddirs.cpp:865

#22 0xb75af57f in KStandardDirs::findAllResources (this=0x8abce00,
type=0xb74620f5 "config", filter=..., options=...) at
/data/kdesvn/kdelibs/kdecore/kernel/kstandarddirs.cpp:877

#23 0xb750ea10 in KConfigPrivate::parseConfigFiles (this=0x8ae6808) at
/data/kdesvn/kdelibs/kdecore/config/kconfig.cpp:501

#24 0xb750ecbc in KConfig::reparseConfiguration (this=0x8c6e650) at
/data/kdesvn/kdelibs/kdecore/config/kconfig.cpp:453

#25 0xb73f12fe in KDevelop::Project::projectConfiguration (this=0x8c937b0)
at /data/kdesvn/extragear/sdk/kdevplatform/shell/project.cpp:468

#26 0xaf834b76 in CMake::currentInstallDir (project=0x8c937b0) at
/data/kdesvn/extragear/sdk/kdevelop/projectmanagers/cmake/cmakeutils.cpp:139

#27 0xaf85244f in fetchInstallDir (project=0x8c937b0, dirs=...) at
/data/kdesvn/extragear/sdk/kdevelop/projectmanagers/cmake/cmakemanager.cpp:108

#28 resolveSystemDirs (project=0x8c937b0, dirs=...) at
/data/kdesvn/extragear/sdk/kdevelop/projectmanagers/cmake/cmakemanager.cpp:124

#29 0xaf8529e4 in CMakeManager::includeDirectories (this=0x8c93a80,
item=0x8cb9050) at
/data/kdesvn/extragear/sdk/kdevelop/projectmanagers/cmake/cmakemanager.cpp:659

#30 0xaaba7774 in DUChainControlFlow::globalNamespaceOrFolderNames
(this=0x8f60810, declaration=0x9d87d78) at
/data/kdesvn/controlflowgraph/duchaincontrolflow.cpp:500

#31 0xaaba8823 in DUChainControlFlow::prependFolderNames (this=0x8f60810,
declaration=0x9d893a0) at
/data/kdesvn/controlflowgraph/duchaincontrolflow.cpp:538

#32 0xaaba9061 in DUChainControlFlow::processFunctionCall (this=0x8f60810,
source=0x9de98a0, target=0x975e9f0, use=...) at
/data/kdesvn/controlflowgraph/duchaincontrolflow.cpp:239

#33 0xaabaa288 in DUChainControlFlow::useDeclarationsFromDefinition
(this=0x8f60810, definition=0x9de98a0, topContext=0x98b8da0,
context=0x9dd3db0)

at /data/kdesvn/controlflowgraph/duchaincontrolflow.cpp:416

#34 0xaabaa231 in DUChainControlFlow::useDeclarationsFromDefinition
(this=0x8f60810, definition=0x9de98a0, topContext=0x98b8da0,
context=0x9dbbd90)

at /data/kdesvn/controlflowgraph/duchaincontrolflow.cpp:423

#35 0xaabaa231 in DUChainControlFlow::useDeclarationsFromDefinition
(this=0x8f60810, definition=0x9de98a0, topContext=0x98b8da0,
context=0x9dbabc8)

at /data/kdesvn/controlflowgraph/duchaincontrolflow.cpp:423

#36 0xaabaa675 in DUChainControlFlow::generateControlFlowForDeclaration
(this=0x8f60810, idefinition=..., itopContext=...,
iuppermostExecutableContext=...)

at /data/kdesvn/controlflowgraph/duchaincontrolflow.cpp:129

#37 0xaabaa874 in DUChainControlFlow::run (this=0x8f60810) at
/data/kdesvn/controlflowgraph/duchaincontrolflow.cpp:78

#38 0xb700148d in ThreadWeaver::JobRunHelper::runTheJob (this=0xa30ff24c,
th=0xa480da70, job=0x8f60810) at
/data/kdesvn/kdelibs/threadweaver/Weaver/Job.cpp:106

#39 0xb70017f1 in ThreadWeaver::Job::execute (this=0x8f60810, th=0xa480da70)
at /data/kdesvn/kdelibs/threadweaver/Weaver/Job.cpp:135

#40 0xb70004da in ThreadWeaver::ThreadRunHelper::run (this=0xa30ff2d4,
parent=0xa480be38, th=0xa480da70) at
/data/kdesvn/kdelibs/threadweaver/Weaver/Thread.cpp:95

#41 0xb7000c2b in ThreadWeaver::Thread::run (this=0xa480da70) at
/data/kdesvn/kdelibs/threadweaver/Weaver/Thread.cpp:142

#42 0xb5fb2dbc in QThreadPrivate::start (arg=0xa480da70) at
/data/kdesvn/qt-copy/src/corelib/thread/qthread_unix.cpp:248

#43 0xb5ef994c in start_thread () from /lib/libpthread.so.0

#44 0xb5044eae in clone () from /lib/libc.so.6
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20100418/2696ef06/attachment.html>


More information about the KDevelop-devel mailing list