If you for some reason create CMake project that has two targets and each one of them has other in dependencies, KDevelop crashes because of tons of recursive procesDependencies calls. An example CMakeLists.txt file that crashes KDevelop: cmake_minimum_required(VERSION 2.8) add_library(lib1 STATIC file1.cpp) add_library(lib2 STATIC file2.cpp) target_link_libraries(lib2 lib1) target_link_libraries(lib1 lib2)
Andras had the same problem. That needs to be fixed before release.
*** Bug 330755 has been marked as a duplicate of this bug. ***
Hack to make this work for the moment: diff --git a/projectmanagers/cmake/cmakecommitchangesjob.cpp b/projectmanagers/cmake/cmakecommitchangesjob.cpp index e7b9d4e..82abd2c 100644 --- a/projectmanagers/cmake/cmakecommitchangesjob.cpp +++ b/projectmanagers/cmake/cmakecommitchangesjob.cpp @@ -135,8 +135,8 @@ void processDependencies(ProcessedTarget &target, const QString& dep, const CMak target.includes += depData["INTERFACE_INCLUDE_DIRECTORIES"]; target.defines += depData["INTERFACE_COMPILE_DEFINITIONS"]; - foreach(const QString& d, depData["INTERFACE_LINK_LIBRARIES"]) - processDependencies(target, d, data); +// foreach(const QString& d, depData["INTERFACE_LINK_LIBRARIES"]) +// processDependencies(target, d, data); } Raising importance, this makes KDevelop completely useless for some projects.
A simple QSet recursion guard should be added to ensure we do not recurse into already handled dependencies to fix this. How hard can it beâ„¢
Created attachment 86018 [details] New crash information added by DrKonqi kdevelop (4.6.0) on KDE Platform 4.11.5 using Qt 4.8.5 - What I was doing when the application crashed: I was just closing KDevelop after opening it and creating a dummy "hello world" c++ cmake project. -- Backtrace (Reduced): #7 0xa637430d in CMakeImportJob::initialize() () from /usr/lib/kde4/kdevcmakemanager.so #8 0xa6374691 in QtConcurrent::VoidStoredMemberFunctionPointerCall0<void, CMakeImportJob>::runFunctor() () from /usr/lib/kde4/kdevcmakemanager.so #9 0xa6374719 in QtConcurrent::RunFunctionTask<void>::run() () from /usr/lib/kde4/kdevcmakemanager.so #10 0xb6432170 in QThreadPoolThread::run() () from /lib/libQtCore.so.4 #11 0xb643f380 in QThreadPrivate::start(void*) () from /lib/libQtCore.so.4
This now works for me in current master / kdevelop 4.7 with the example provided above. Can someone still reproduce it with a recent checkout?