Thread-safety issue in cmake support ?

Sandro Andrade sandro.andrade at gmail.com
Mon Jun 7 15:12:53 UTC 2010


Hi there,

I sent this issue some time ago regarding multiple access to KConfig
and I've been told to ask kde-core-devel guys
about KConfig thread safety. However, KConfig is neither thread-safe
nor even reentrant:

http://lists.zerezo.com/kde-devel/msg12619.html
http://lists.kde.org/?l=kde-devel&m=118037451920733&w=2

So I should take care of this. The problem raises from calling
"buildSystemManager->includeDirectories(project_item)" from multiples
threads. I need to obtain project's include directories but probably
the concurrent execution of background parser is causing such a crash
(see following backtrace).

Any suggestions ?

Thanks,
Sandro

Thread 1 (Thread 0xb4314ae0 (LWP 9798)):
[KCrash Handler]
#7  operator< (this=0x9f3ca40, aupdate=0xbf822cf0, akey=...) at
/data/kdesvn/kdelibs/kdecore/config/kconfigdata.h:122
#8  qMapLessThanKey<KEntryKey> (this=0x9f3ca40, aupdate=0xbf822cf0,
akey=...) at /data/kdesvn/install/qt4/include/QtCore/qmap.h:107
#9  QMap<KEntryKey, KEntry>::mutableFindNode (this=0x9f3ca40,
aupdate=0xbf822cf0, akey=...) at
/data/kdesvn/install/qt4/include/QtCore/qmap.h:760
#10 0xb76c91e4 in QMap<KEntryKey, KEntry>::insert (this=0x9f3ca40,
group=..., key=..., value=..., options=...) at
/data/kdesvn/install/qt4/include/QtCore/qmap.h:540
#11 KEntryMap::setEntry (this=0x9f3ca40, group=..., key=...,
value=..., options=...) at
/data/kdesvn/kdelibs/kdecore/config/kconfigdata.h:284
#12 0xb76dd320 in KConfigIniBackend::parseConfig (this=0xa3f149f8,
currentLocale=..., entryMap=..., options=..., merging=false) at
/data/kdesvn/kdelibs/kdecore/config/kconfigini.cpp:252
#13 0xb76de236 in KConfigIniBackend::parseConfig (this=0xa3f149f8,
currentLocale=..., entryMap=..., options=...) at
/data/kdesvn/kdelibs/kdecore/config/kconfigini.cpp:66
#14 0xb76c45c4 in KConfigPrivate::parseGlobalFiles (this=0x9f3ca28) at
/data/kdesvn/kdelibs/kdecore/config/kconfig.cpp:484
#15 0xb76c4d04 in KConfig::reparseConfiguration (this=0xa0460f8) at
/data/kdesvn/kdelibs/kdecore/config/kconfig.cpp:451
#16 0xb75aa3ce in KDevelop::Project::projectConfiguration
(this=0xa041490) at /data/kdesvn/kdevplatform/shell/project.cpp:468
#17 0xb0a7e746 in CMake::currentBuildDir (project=0xa041490) at
/data/kdesvn/kdevelop/projectmanagers/cmake/cmakeutils.cpp:123
#18 0xb0a050bf in CMakeManager::buildDirectory (this=0xa071868,
item=0xa079108) at
/data/kdesvn/kdevelop/projectmanagers/cmake/cmakemanager.cpp:175
#19 0xa8ecd01b in IncludePathComputer::computeForeground
(this=0xa3d96738) at
/data/kdesvn/kdevelop/languages/cpp/includepathcomputer.cpp:85
#20 0xa8ec5cef in CppLanguageSupport::findIncludePathsForJob
(this=0xa857968, job=0xb2c61b0) at
/data/kdesvn/kdevelop/languages/cpp/cpplanguagesupport.cpp:396
#21 0xa8ec91f9 in CppLanguageSupport::qt_metacall (this=0xa857968,
_c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>,
_a=0xa790b30)
   at /data/kdesvn/build/kdevelop/languages/cpp/cpplanguagesupport.moc:142
#22 0xb61fc586 in QMetaObject::metacall (object=0xa857968,
cl=QMetaObject::InvokeMetaMethod, idx=11, argv=0xa790b30) at
/data/kdesvn/qt-copy/src/corelib/kernel/qmetaobject.cpp:237
#23 0xb6209729 in QMetaCallEvent::placeMetaCall (this=0xb794350,
object=0xa857968) at
/data/kdesvn/qt-copy/src/corelib/kernel/qobject.cpp:561
#24 0xb620a8c3 in QObject::event (this=0xa857968, e=0xb794350) at
/data/kdesvn/qt-copy/src/corelib/kernel/qobject.cpp:1248
#25 0xb5597398 in QApplicationPrivate::notify_helper (this=0x9e11da8,
receiver=0xa857968, e=0xb794350) at
/data/kdesvn/qt-copy/src/gui/kernel/qapplication.cpp:4304
#26 0xb5594c43 in QApplication::notify (this=0xbf823da8,
receiver=0xa857968, e=0xb794350) at
/data/kdesvn/qt-copy/src/gui/kernel/qapplication.cpp:3708
#27 0xb65b69aa in KApplication::notify (this=0xbf823da8,
receiver=0xa857968, event=0xb794350) at
/data/kdesvn/kdelibs/kdeui/kernel/kapplication.cpp:302
#28 0xb61f5683 in QCoreApplication::notifyInternal (this=0xbf823da8,
receiver=0xa857968, event=0xb794350) at
/data/kdesvn/qt-copy/src/corelib/kernel/qcoreapplication.cpp:704
#29 0xb6c86669 in QCoreApplication::sendEvent (receiver=0xa857968,
event=0xb794350) at
../../../../include/QtCore/../../../../qt-copy/src/corelib/kernel/qcoreapplication.h:215
#30 0xb61f6719 in QCoreApplicationPrivate::sendPostedEvents
(receiver=0x0, event_type=0, data=0x9dccf48) at
/data/kdesvn/qt-copy/src/corelib/kernel/qcoreapplication.cpp:1345
#31 0xb61f63d1 in QCoreApplication::sendPostedEvents (receiver=0x0,
event_type=0) at
/data/kdesvn/qt-copy/src/corelib/kernel/qcoreapplication.cpp:1238
#32 0xb622820a in QCoreApplication::sendPostedEvents () at
../../include/QtCore/../../../../qt-copy/src/corelib/kernel/qcoreapplication.h:220
#33 0xb62273a2 in postEventSourceDispatch (s=0x9e14ab0) at
/data/kdesvn/qt-copy/src/corelib/kernel/qeventdispatcher_glib.cpp:276
#34 0xb4613f72 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#35 0xb4614750 in g_main_context_iterate () from /usr/lib/libglib-2.0.so.0
#36 0xb4614a04 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#37 0xb6227b32 in QEventDispatcherGlib::processEvents (this=0x9dcc9f8,
flags=...) at /data/kdesvn/qt-copy/src/corelib/kernel/qeventdispatcher_glib.cpp:412
#38 0xb5659a64 in QGuiEventDispatcherGlib::processEvents
(this=0x9dcc9f8, flags=...) at
/data/kdesvn/qt-copy/src/gui/kernel/qguieventdispatcher_glib.cpp:204
#39 0xb61f33fd in QEventLoop::processEvents (this=0xbf823bfc,
flags=...) at /data/kdesvn/qt-copy/src/corelib/kernel/qeventloop.cpp:149
#40 0xb61f3541 in QEventLoop::exec (this=0xbf823bfc, flags=...) at
/data/kdesvn/qt-copy/src/corelib/kernel/qeventloop.cpp:201
#41 0xb61f5d58 in QCoreApplication::exec () at
/data/kdesvn/qt-copy/src/corelib/kernel/qcoreapplication.cpp:981
#42 0xb5594872 in QApplication::exec () at
/data/kdesvn/qt-copy/src/gui/kernel/qapplication.cpp:3583
#43 0x08050f37 in main (argc=<value optimized out>, argv=0xa3d67e70)
at /data/kdesvn/kdevelop/app/main.cpp:378




More information about the KDevelop-devel mailing list