Summary: | Kdevelop crash when importing cmake project | ||
---|---|---|---|
Product: | [Applications] kdevelop | Reporter: | Valentyn Pavliuchenko <valentyn.pavliuchenko> |
Component: | Build tools: CMake | Assignee: | kdevelop-bugs-null |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | aleixpol |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Unlisted Binaries | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Valentyn Pavliuchenko
2010-01-26 16:52:59 UTC
You're mixing self-built kdevelop with one installed from packages. Thats not going to work, remove the packages completely or the self-built version. Well, I'm building Kdevelop Debian PACKAGES from trunk. I don't just type 'make install', I create and install packages. And they correctly replace Debian older kdevelop packages. My packages are based on Debian kdevelop 4:3.9.97-1 and kdevplatform 0.9.97-1 packaging with appropriate changes for compiling trunk. So no mixing here. Then please compile kdevelop with debug symbols (kdevcmakemanager doesn't have any) and produce a new backtrace. Ok, I'll try. Btw, I've just reproduced this crash with Debian's 4:3.9.97-1/0.9.97-1 and Qt 4.5.3. It proves that the problem is not because of self-built packages. New backtrace: Application: KDevelop (kdevelop), signal: Segmentation fault [Current thread is 1 (Thread 0xb4345700 (LWP 30322))] Thread 6 (Thread 0xb137db70 (LWP 30323)): #0 0xb77e4424 in __kernel_vsyscall () #1 0xb4b913d2 in pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_timedwait.S:179 #2 0xb6235884 in __pthread_cond_timedwait (cond=0x868b7b0, mutex=0x868b798, abstime=0xb137d2fc) at forward.c:152 #3 0xb6e8e5dc in QWaitConditionPrivate::wait (this=0x86a664c, mutex=0x86a6650, time=200000) at thread/qwaitcondition_unix.cpp:85 #4 QWaitCondition::wait (this=0x86a664c, mutex=0x86a6650, time=200000) at thread/qwaitcondition_unix.cpp:159 #5 0xb51c7f15 in KDevelop::DUChainPrivate::CleanupThread::run (this=0x86a6640) at ../../language/duchain/duchain.cpp:286 #6 0xb6e8d70e in QThreadPrivate::start (arg=0x86a6640) at thread/qthread_unix.cpp:244 #7 0xb4b8d585 in start_thread (arg=0xb137db70) at pthread_create.c:300 #8 0xb62282be in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130 Thread 5 (Thread 0xaea3bb70 (LWP 30324)): #0 0xb77e4424 in __kernel_vsyscall () #1 0xb62215b1 in select () from /lib/i686/cmov/libc.so.6 #2 0xb6f6b861 in QProcessManager::run (this=0xb70a7390) at io/qprocess_unix.cpp:245 #3 0xb6e8d70e in QThreadPrivate::start (arg=0xb70a7390) at thread/qthread_unix.cpp:244 #4 0xb4b8d585 in start_thread (arg=0xaea3bb70) at pthread_create.c:300 #5 0xb62282be in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130 Thread 4 (Thread 0xada39b70 (LWP 30357)): #0 0xb77e4424 in __kernel_vsyscall () #1 0xb4b910a5 in pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_wait.S:122 #2 0xb623582d in __pthread_cond_wait (cond=0x8ea9580, mutex=0x8ea9568) at forward.c:139 #3 0xb6e8e602 in QWaitConditionPrivate::wait (this=0x8ea9488, mutex=0x870ec70, time=4294967295) at thread/qwaitcondition_unix.cpp:87 #4 QWaitCondition::wait (this=0x8ea9488, mutex=0x870ec70, time=4294967295) at thread/qwaitcondition_unix.cpp:159 #5 0xb45da648 in ThreadWeaver::WeaverImpl::blockThreadUntilJobsAreBeingAssigned (this=0x8ea9470, th=0x84b37c8) at ../../../threadweaver/Weaver/WeaverImpl.cpp:365 #6 0xb45dd3ac in ThreadWeaver::WorkingHardState::waitForAvailableJob (this=0x8ba2bf8, th=0x84b37c8) at ../../../threadweaver/Weaver/WorkingHardState.cpp:80 #7 0xb45d923b in ThreadWeaver::WeaverImpl::waitForAvailableJob (this=0x8ea9470, th=0x84b37c8) at ../../../threadweaver/Weaver/WeaverImpl.cpp:356 #8 0xb45dd4a2 in ThreadWeaver::WorkingHardState::applyForWork (this=0x8ba2bf8, th=0x84b37c8) at ../../../threadweaver/Weaver/WorkingHardState.cpp:71 #9 0xb45dabd3 in ThreadWeaver::WeaverImpl::applyForWork (this=0x8ea9470, th=0x84b37c8, previous=0x8e22188) at ../../../threadweaver/Weaver/WeaverImpl.cpp:351 #10 0xb45db4be in ThreadWeaver::ThreadRunHelper::run (this=0xada39330, parent=0x8ea9470, th=0x84b37c8) at ../../../threadweaver/Weaver/Thread.cpp:87 #11 0xb45dbafb in ThreadWeaver::Thread::run (this=0x84b37c8) at ../../../threadweaver/Weaver/Thread.cpp:142 #12 0xb6e8d70e in QThreadPrivate::start (arg=0x84b37c8) at thread/qthread_unix.cpp:244 #13 0xb4b8d585 in start_thread (arg=0xada39b70) at pthread_create.c:300 #14 0xb62282be in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130 Thread 3 (Thread 0xae23ab70 (LWP 30358)): [KCrash Handler] #6 QBasicAtomicInt::ref (this=0xae23a0b4, other=...) at ../../include/QtCore/../../src/corelib/arch/qatomic_i386.h:120 #7 QString::operator= (this=0xae23a0b4, other=...) at tools/qstring.cpp:1280 #8 0xac91a301 in CMakeManager::parse (this=0x8dffac8, item=0xace4c978) at ../../../projectmanagers/cmake/cmakemanager.cpp:516 #9 0xb53882a9 in KDevelop::ImportProjectJobPrivate::import (this=0x8bdf230, folder=0x8724f98) at ../../project/importprojectjob.cpp:53 #10 KDevelop::ImportProjectJobPrivate::import (this=0x8bdf230, folder=0x8724f98) at ../../project/importprojectjob.cpp:57 #11 KDevelop::ImportProjectJobPrivate::import (this=0x8bdf230, folder=0x8724f98) at ../../project/importprojectjob.cpp:57 #12 0xb5387bf4 in QtConcurrent::VoidStoredMemberFunctionPointerCall1<void, KDevelop::ImportProjectJobPrivate, KDevelop::ProjectFolderItem*, KDevelop::ProjectFolderItem*>::runFunctor (this=0x8edbab0) at /usr/include/qt4/QtCore/qtconcurrentstoredfunctioncall.h:426 #13 0xb5387f1e in QtConcurrent::RunFunctionTask<void>::run (this=0x8edbab0) at /usr/include/qt4/QtCore/qtconcurrentrunbase.h:120 #14 0xb6e831a1 in QThreadPoolThread::run (this=0x8bdf4b8) at concurrent/qthreadpool.cpp:106 #15 0xb6e8d70e in QThreadPrivate::start (arg=0x8bdf4b8) at thread/qthread_unix.cpp:244 #16 0xb4b8d585 in start_thread (arg=0xae23ab70) at pthread_create.c:300 #17 0xb62282be in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130 Thread 2 (Thread 0xab9ffb70 (LWP 30433)): #0 0xb77e4424 in __kernel_vsyscall () #1 0xb4b910a5 in pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_wait.S:122 #2 0xb623582d in __pthread_cond_wait (cond=0xb49919ec, mutex=0xb49919d4) at forward.c:139 #3 0xb48bc377 in WTF::TCMalloc_PageHeap::scavengerThread (this=0xb498c900) at ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:2304 #4 0xb48bc3c1 in WTF::TCMalloc_PageHeap::runScavengerThread (context=0xb498c900) at ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:1438 #5 0xb4b8d585 in start_thread (arg=0xab9ffb70) at pthread_create.c:300 #6 0xb62282be in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130 Thread 1 (Thread 0xb4345700 (LWP 30322)): #0 0xb77e4424 in __kernel_vsyscall () #1 0xb4b910a5 in pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_wait.S:122 #2 0xb623582d in __pthread_cond_wait (cond=0x8edbdb8, mutex=0x8edbda0) at forward.c:139 #3 0xb6e8e602 in QWaitConditionPrivate::wait (this=0x8edbcbc, mutex=0x8edbca8, time=4294967295) at thread/qwaitcondition_unix.cpp:87 #4 QWaitCondition::wait (this=0x8edbcbc, mutex=0x8edbca8, time=4294967295) at thread/qwaitcondition_unix.cpp:159 #5 0xb6e82f9a in QThreadPoolPrivate::waitForDone (this=0x8edbc58) at concurrent/qthreadpool.cpp:295 #6 0xb6e836a3 in ~QThreadPool (this=0x8857578, __in_chrg=<value optimized out>) at concurrent/qthreadpool.cpp:428 #7 0xb6e83cea in ~QGlobalStaticDeleter (this=0xb70a7100, __in_chrg=<value optimized out>) at ../../include/QtCore/../../src/corelib/global/qglobal.h:1801 #8 0xb6188481 in __run_exit_handlers (status=1, listp=0xb629c324, run_list_atexit=true) at exit.c:78 #9 0xb61884df in *__GI_exit (status=1) at exit.c:100 #10 0xb656a64b in qt_xio_errhandler () at kernel/qapplication_x11.cpp:734 #11 0xb7277fda in KApplication::xioErrhandler (this=0xbf9fd478, dpy=0x8400cf0) at ../../kdeui/kernel/kapplication.cpp:408 #12 0xb7278016 in kde_xio_errhandler (dpy=0x8400cf0) at ../../kdeui/kernel/kapplication.cpp:125 #13 0xb4c3fee6 in _XIOError () from /usr/lib/libX11.so.6 #14 0xb4c471ea in ?? () from /usr/lib/libX11.so.6 #15 0xb4c47b26 in _XEventsQueued () from /usr/lib/libX11.so.6 #16 0xb4c3065f in XEventsQueued () from /usr/lib/libX11.so.6 #17 0xb65a6b6d in x11EventSourceCheck (s=0x83f0d40) at kernel/qguieventdispatcher_glib.cpp:87 #18 0xb4afb971 in g_main_context_check () from /lib/libglib-2.0.so.0 #19 0xb4afc11c in ?? () from /lib/libglib-2.0.so.0 #20 0xb4afc503 in g_main_context_iteration () from /lib/libglib-2.0.so.0 #21 0xb6fbc4ff in QEventDispatcherGlib::processEvents (this=0x83a89e8, flags=...) at kernel/qeventdispatcher_glib.cpp:409 #22 0xb65a69a5 in QGuiEventDispatcherGlib::processEvents (this=0x83a89e8, flags=...) at kernel/qguieventdispatcher_glib.cpp:202 #23 0xb6f8ea3a in QEventLoop::processEvents (this=0xbf9fd3b0, flags=...) at kernel/qeventloop.cpp:149 #24 0xb6f8ee82 in QEventLoop::exec (this=0xbf9fd3b0, flags=...) at kernel/qeventloop.cpp:201 #25 0xb6f91599 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:981 #26 0xb64eabf7 in QApplication::exec () at kernel/qapplication.cpp:3570 #27 0x0804d94b in main (argc=1, argv=0xbf9fd9a4) at ../../app/main.cpp:209 Can you also attach the project? Or at least the cmake files from the project? Well, I've done some useful work - I've minimized my cmake project while still crashing kdevelop. Here is CMakeLists.txt (it contains no sense now, but it crashes KDevelop): add_library( ph EXCLUDE_FROM_ALL ) get_target_property( _target_output_name ph OUTPUT_NAME ) Thanks a lot for that. I can reproduce this and also get a more meaningful backtrace (I'm not sure why yours shows QString and QBasicAtomicInt, but this one makes more sense): #3 0xb6d26551 in qFatal (msg=0xb6e706d8 "ASSERT: \"%s\" in file %s, line %d") at global/qglobal.cpp:2241 #4 0xb6d26645 in qt_assert (assertion=0xb0c674a0 "!isEmpty()", file=0xb0c67480 "/usr/include/qt4/QtCore/qlist.h", line=252) at global/qglobal.cpp:1811 #5 0xb0c5aa2d in QList<QString>::first (this=0xa91fb95c) at /usr/include/qt4/QtCore/qlist.h:252 #6 0xb0c53c49 in CMakeManager::parse (this=0x8dddb98, item=0x9d7ba40) at /home/andreas/src/kdevelop/projectmanagers/cmake/cmakemanager.cpp:516 I don't know the code and I'm not a master of cmake:) This patch solves the crash but is it correct? --- projectmanagers/cmake/cmakemanager.cpp (revision 1080599) +++ projectmanagers/cmake/cmakemanager.cpp (working copy) @@ -513,7 +513,11 @@ QStringList files=t.files; QString outputName=t.name; if(data.properties[TargetProperty].contains(t.name) && data.properties[TargetProperty][t.name].contains("OUTPUT_NAME")) - outputName=data.properties[TargetProperty][t.name]["OUTPUT_NAME"].first(); + { + QStringList outputNameList=data.properties[TargetProperty][t.name]["OUTPUT_NAME"]; + if (!outputNameList.empty()) + outputName=outputNameList.first(); + } QString path; switch(t.type) You can use that to avoid the crash for now, but the proper fix is to find out why the list is empty in the first place. It shouldn't be empty if get_target_properties was parsed correctly. But I don't know the code well enough to point a finger on anything specific. Yeah, maybe I'll try to trace it. This cmake project is short, so it shouldn't be so hard.. Can you provide the cmake project source? i would track it down then, otherwise I can't help. See comment #7. It has no sense, but it worked (can't verify right now on more recent versions) ping? commit 55afd8331edd6c8d1161e1d89ab23672f97225e4 Author: Aleix Pol <aleixpol@kde.org> Date: Tue Sep 14 01:57:45 2010 +0200 Don't create an empty property when an empty one is read. BUG: 224342 diff --git a/projectmanagers/cmake/parser/cmakeprojectvisitor.cpp b/projectmanagers/cmake/parser/cmakeprojectvisitor.cpp index aca7cfa..a02ea43 100644 --- a/projectmanagers/cmake/parser/cmakeprojectvisitor.cpp +++ b/projectmanagers/cmake/parser/cmakeprojectvisitor.cpp @@ -298,15 +298,20 @@ int CMakeProjectVisitor::visit( const SetDirectoryPropsAst * dirProps) int CMakeProjectVisitor::visit( const GetTargetPropAst * prop) { kDebug(9042) << "getting target " << prop->target() << " prop " << prop->property() << prop->variableName(); - if(m_props[TargetProperty].contains(prop->target()) && !m_props[TargetProperty][prop->target()].contains(prop->property())) { - if(prop->property().startsWith("LOCATION_") && m_props[TargetProperty][prop->target()].contains("IMPORTED_"+prop->property())) - m_props[TargetProperty][prop->target()][prop->property()]=m_props[TargetProperty][prop->target()]["IMPORTED_"+prop->property()]; - -// kDebug(9032) << "unexistent property" << prop->property() << "on" << prop->target(); + QStringList value; + + if(m_props[TargetProperty].contains(prop->target())) { + QMap<QString, QStringList>& targetProps = m_props[TargetProperty][prop->target()]; + if(!targetProps.contains(prop->property())) { + if(prop->property().startsWith("LOCATION_") && targetProps.contains("IMPORTED_"+prop->property())) + targetProps[prop->property()]=targetProps["IMPORTED_"+prop->property()]; + } + value = targetProps.value(prop->property()); } -// kDebug(9042) << "current properties" << m_props[TargetProperty][prop->target()].keys(); + if(value.isEmpty()) + value += QString(prop->variableName()+"-NOTFOUND"); - m_vars->insert(prop->variableName(), m_props[TargetProperty][prop->target()][prop->property()]); + m_vars->insert(prop->variableName(), value); // kDebug(9042) << "goooooot" << m_vars->value(prop->variableName()); return 1; } |