Summary: | Crash when typing the case-label of a switch statement | ||
---|---|---|---|
Product: | [Applications] kdevelop | Reporter: | Andreas Pakulat <apaku> |
Component: | Language Support: CPP (old) | Assignee: | kdevelop-bugs-null |
Status: | RESOLVED FIXED | ||
Severity: | crash | ||
Priority: | VHI | ||
Version: | git master | ||
Target Milestone: | 4.2.3 | ||
Platform: | Debian unstable | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Andreas Pakulat
2012-01-22 09:18:49 UTC
Just tried, this also happens when no background parser is running (so the cmake-parsing in the above backtrace is irrelevant) and I can reproduce this with the older existing switch too when adding a new case-label there. Also tried with other projects (kdev-custom-buildsystem, kdevplatform itself) and everywhere typing letters for a case-label will crash kdev. This is the backtrace when no background parser is running: Application: KDevelop (kdevelop), signal: Aborted [Current thread is 1 (Thread 0xb28de950 (LWP 17682))] Thread 9 (Thread 0xad2f9b70 (LWP 17692)): #0 0xb78c7424 in __kernel_vsyscall () #1 0xb56f5703 in pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_timedwait.S:236 #2 0xb5829a74 in __pthread_cond_timedwait (cond=0xa019b28, mutex=0xa019b10, abstime=0xad2f92c8) at forward.c:152 #3 0xb656c99e in wait (time=1000, this=0xa019b10) at thread/qwaitcondition_unix.cpp:86 #4 QWaitCondition::wait (this=0xa33cde4, mutex=0xa33cde8, time=1000) at thread/qwaitcondition_unix.cpp:160 #5 0xb50ee6bf in KDevelop::DUChainPrivate::CleanupThread::run (this=0xa33cdd8) at /home/andreas/src/kdevplatform/language/duchain/duchain.cpp:282 #6 0xb656c503 in QThreadPrivate::start (arg=0xa33cdd8) at thread/qthread_unix.cpp:320 #7 0xb56f0c39 in start_thread (arg=0xad2f9b70) at pthread_create.c:304 #8 0xb581c92e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130 Backtrace stopped: Not enough registers or memory available to unwind further Thread 8 (Thread 0xa8696b70 (LWP 17695)): #0 0xb78c7424 in __kernel_vsyscall () #1 0xb56f520a in __pthread_cond_wait (cond=0xb56a8950, mutex=0xb56a8938) at pthread_cond_wait.c:153 #2 0xb5829a1d in __pthread_cond_wait (cond=0xb56a8950, mutex=0xb56a8938) at forward.c:139 #3 0xb55a3ec9 in ?? () from /usr/lib/libQtScript.so.4 #4 0xb55a3f0f in ?? () from /usr/lib/libQtScript.so.4 #5 0xb56f0c39 in start_thread (arg=0xa8696b70) at pthread_create.c:304 #6 0xb581c92e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130 Backtrace stopped: Not enough registers or memory available to unwind further Thread 7 (Thread 0xa75ebb70 (LWP 17696)): #0 0xb56f4524 in __pthread_mutex_unlock_usercnt (mutex=0xac3fe4c, decr=<optimized out>) at pthread_mutex_unlock.c:52 #1 0xb5829c26 in pthread_mutex_unlock (mutex=0xac3fe4c) at forward.c:184 #2 0xb4a95a2b in g_main_context_release () from /lib/i386-linux-gnu/libglib-2.0.so.0 #3 0xb4a970e6 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0 #4 0xb4a9740a in g_main_context_iteration () from /lib/i386-linux-gnu/libglib-2.0.so.0 #5 0xb66954d7 in QEventDispatcherGlib::processEvents (this=0xac41d40, flags=...) at kernel/qeventdispatcher_glib.cpp:424 #6 0xb666624d in QEventLoop::processEvents (this=0xa75eb2b0, flags=...) at kernel/qeventloop.cpp:149 #7 0xb6666491 in QEventLoop::exec (this=0xa75eb2b0, flags=...) at kernel/qeventloop.cpp:201 #8 0xb656969b in QThread::exec (this=0xac41a78) at thread/qthread.cpp:492 #9 0xb5201eb3 in KDevelop::CompletionWorkerThread::run (this=0xac41a78) at /home/andreas/src/kdevplatform/language/codecompletion/codecompletionmodel.cpp:84 #10 0xb656c503 in QThreadPrivate::start (arg=0xac41a78) at thread/qthread_unix.cpp:320 #11 0xb56f0c39 in start_thread (arg=0xa75ebb70) at pthread_create.c:304 #12 0xb581c92e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130 Backtrace stopped: Not enough registers or memory available to unwind further Thread 6 (Thread 0xa6deab70 (LWP 17697)): #0 0xb654daba in __i686.get_pc_thunk.bx () from /usr/lib/libQtCore.so.4 #1 0xb669612c in QTimerInfoList::repairTimersIfNeeded (this=0xac1b234) at kernel/qeventdispatcher_unix.cpp:394 #2 0xb66961c1 in QTimerInfoList::timerWait (this=0xac1b234, tm=...) at kernel/qeventdispatcher_unix.cpp:443 #3 0xb6694a03 in timerSourcePrepareHelper (src=<optimized out>, timeout=0xa6dea12c) at kernel/qeventdispatcher_glib.cpp:136 #4 0xb6694a9d in timerSourcePrepare (source=0xac1b200, timeout=<optimized out>) at kernel/qeventdispatcher_glib.cpp:169 #5 0xb4a96054 in g_main_context_prepare () from /lib/i386-linux-gnu/libglib-2.0.so.0 #6 0xb4a96e17 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0 #7 0xb4a9740a in g_main_context_iteration () from /lib/i386-linux-gnu/libglib-2.0.so.0 #8 0xb66954d7 in QEventDispatcherGlib::processEvents (this=0xac31d08, flags=...) at kernel/qeventdispatcher_glib.cpp:424 #9 0xb666624d in QEventLoop::processEvents (this=0xa6dea2b0, flags=...) at kernel/qeventloop.cpp:149 #10 0xb6666491 in QEventLoop::exec (this=0xa6dea2b0, flags=...) at kernel/qeventloop.cpp:201 #11 0xb656969b in QThread::exec (this=0xac900818) at thread/qthread.cpp:492 #12 0xb5201eb3 in KDevelop::CompletionWorkerThread::run (this=0xac900818) at /home/andreas/src/kdevplatform/language/codecompletion/codecompletionmodel.cpp:84 #13 0xb656c503 in QThreadPrivate::start (arg=0xac900818) at thread/qthread_unix.cpp:320 #14 0xb56f0c39 in start_thread (arg=0xa6deab70) at pthread_create.c:304 #15 0xb581c92e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130 Backtrace stopped: Not enough registers or memory available to unwind further Thread 5 (Thread 0xa52ffb70 (LWP 17705)): #0 0xb56b7e11 in *__GI_clock_gettime (clock_id=1, tp=0xa52ff018) at ../sysdeps/unix/clock_gettime.c:116 #1 0xb65c3635 in do_gettime (frac=0xa52ff010, sec=0xa52ff008) at tools/qelapsedtimer_unix.cpp:123 #2 qt_gettime () at tools/qelapsedtimer_unix.cpp:140 #3 0xb6695e46 in QTimerInfoList::updateCurrentTime (this=0xa57fd63c) at kernel/qeventdispatcher_unix.cpp:339 #4 0xb66961aa in QTimerInfoList::timerWait (this=0xa57fd63c, tm=...) at kernel/qeventdispatcher_unix.cpp:442 #5 0xb6694a03 in timerSourcePrepareHelper (src=<optimized out>, timeout=0xa52ff11c) at kernel/qeventdispatcher_glib.cpp:136 #6 0xb6694a9d in timerSourcePrepare (source=0xa57fd608, timeout=<optimized out>) at kernel/qeventdispatcher_glib.cpp:169 #7 0xb4a96054 in g_main_context_prepare () from /lib/i386-linux-gnu/libglib-2.0.so.0 #8 0xb4a96e17 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0 #9 0xb4a9740a in g_main_context_iteration () from /lib/i386-linux-gnu/libglib-2.0.so.0 #10 0xb66954d7 in QEventDispatcherGlib::processEvents (this=0xb4ecc28, flags=...) at kernel/qeventdispatcher_glib.cpp:424 #11 0xb666624d in QEventLoop::processEvents (this=0xa52ff2a0, flags=...) at kernel/qeventloop.cpp:149 #12 0xb6666491 in QEventLoop::exec (this=0xa52ff2a0, flags=...) at kernel/qeventloop.cpp:201 #13 0xb656969b in QThread::exec (this=0xb4ecc38) at thread/qthread.cpp:492 #14 0xb6646d8d in QInotifyFileSystemWatcherEngine::run (this=0xb4ecc38) at io/qfilesystemwatcher_inotify.cpp:248 #15 0xb656c503 in QThreadPrivate::start (arg=0xb4ecc38) at thread/qthread_unix.cpp:320 #16 0xb56f0c39 in start_thread (arg=0xa52ffb70) at pthread_create.c:304 #17 0xb581c92e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130 Backtrace stopped: Not enough registers or memory available to unwind further Thread 4 (Thread 0xa42e0b70 (LWP 17757)): #0 0xb78c7424 in __kernel_vsyscall () #1 0xb56f520a in __pthread_cond_wait (cond=0xb48cfe90, mutex=0xb48cfe78) at pthread_cond_wait.c:153 #2 0xb5829a1d in __pthread_cond_wait (cond=0xb48cfe90, mutex=0xb48cfe78) at forward.c:139 #3 0xb42b151b in ?? () from /usr/lib/libQtWebKit.so.4 #4 0xb42b163f in ?? () from /usr/lib/libQtWebKit.so.4 #5 0xb56f0c39 in start_thread (arg=0xa42e0b70) at pthread_create.c:304 #6 0xb581c92e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130 Backtrace stopped: Not enough registers or memory available to unwind further Thread 3 (Thread 0xa1bffb70 (LWP 18691)): #0 0xb78c7424 in __kernel_vsyscall () #1 0xb56f520a in __pthread_cond_wait (cond=0xa1fbb60, mutex=0xa1fbb48) at pthread_cond_wait.c:153 #2 0xb5829a1d in __pthread_cond_wait (cond=0xa1fbb60, mutex=0xa1fbb48) at forward.c:139 #3 0xb656ca10 in wait (time=4294967295, this=0xa1fbb48) at thread/qwaitcondition_unix.cpp:88 #4 QWaitCondition::wait (this=0xa1fbab8, mutex=0x9f677b0, time=4294967295) at thread/qwaitcondition_unix.cpp:160 #5 0xb70dd266 in ThreadWeaver::WeaverImpl::blockThreadUntilJobsAreBeingAssigned (this=0xa1fbaa0, th=0xc2279d0) at ../../../threadweaver/Weaver/WeaverImpl.cpp:365 #6 0xb70dfd5b in ThreadWeaver::WorkingHardState::waitForAvailableJob (this=0x9fc6570, th=0xc2279d0) at ../../../threadweaver/Weaver/WorkingHardState.cpp:80 #7 0xb70dce9a in ThreadWeaver::WeaverImpl::waitForAvailableJob (this=0xa1fbaa0, th=0xc2279d0) at ../../../threadweaver/Weaver/WeaverImpl.cpp:356 #8 0xb70dfe5c in ThreadWeaver::WorkingHardState::applyForWork (this=0x9fc6570, th=0xc2279d0) at ../../../threadweaver/Weaver/WorkingHardState.cpp:71 #9 0xb70dcdf3 in ThreadWeaver::WeaverImpl::applyForWork (this=0xa1fbaa0, th=0xc2279d0, previous=0xa02fb238) at ../../../threadweaver/Weaver/WeaverImpl.cpp:351 #10 0xb70de994 in ThreadWeaver::ThreadRunHelper::run (this=0xa1bff304, parent=0xa1fbaa0, th=0xc2279d0) at ../../../threadweaver/Weaver/Thread.cpp:87 #11 0xb70dea4a in ThreadWeaver::Thread::run (this=0xc2279d0) at ../../../threadweaver/Weaver/Thread.cpp:142 #12 0xb656c503 in QThreadPrivate::start (arg=0xc2279d0) at thread/qthread_unix.cpp:320 #13 0xb56f0c39 in start_thread (arg=0xa1bffb70) at pthread_create.c:304 #14 0xb581c92e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130 Backtrace stopped: Not enough registers or memory available to unwind further Thread 2 (Thread 0xa13feb70 (LWP 18692)): #0 0xb78c7424 in __kernel_vsyscall () #1 0xb56f520a in __pthread_cond_wait (cond=0xa1fbb60, mutex=0xa1fbb48) at pthread_cond_wait.c:153 #2 0xb5829a1d in __pthread_cond_wait (cond=0xa1fbb60, mutex=0xa1fbb48) at forward.c:139 #3 0xb656ca10 in wait (time=4294967295, this=0xa1fbb48) at thread/qwaitcondition_unix.cpp:88 #4 QWaitCondition::wait (this=0xa1fbab8, mutex=0x9f677b0, time=4294967295) at thread/qwaitcondition_unix.cpp:160 #5 0xb70dd266 in ThreadWeaver::WeaverImpl::blockThreadUntilJobsAreBeingAssigned (this=0xa1fbaa0, th=0xc221370) at ../../../threadweaver/Weaver/WeaverImpl.cpp:365 #6 0xb70dfd5b in ThreadWeaver::WorkingHardState::waitForAvailableJob (this=0x9fc6570, th=0xc221370) at ../../../threadweaver/Weaver/WorkingHardState.cpp:80 #7 0xb70dce9a in ThreadWeaver::WeaverImpl::waitForAvailableJob (this=0xa1fbaa0, th=0xc221370) at ../../../threadweaver/Weaver/WeaverImpl.cpp:356 #8 0xb70dfe5c in ThreadWeaver::WorkingHardState::applyForWork (this=0x9fc6570, th=0xc221370) at ../../../threadweaver/Weaver/WorkingHardState.cpp:71 #9 0xb70dcdf3 in ThreadWeaver::WeaverImpl::applyForWork (this=0xa1fbaa0, th=0xc221370, previous=0x0) at ../../../threadweaver/Weaver/WeaverImpl.cpp:351 #10 0xb70dfe78 in ThreadWeaver::WorkingHardState::applyForWork (this=0x9fc6570, th=0xc221370) at ../../../threadweaver/Weaver/WorkingHardState.cpp:74 #11 0xb70dcdf3 in ThreadWeaver::WeaverImpl::applyForWork (this=0xa1fbaa0, th=0xc221370, previous=0xa02d4fd8) at ../../../threadweaver/Weaver/WeaverImpl.cpp:351 #12 0xb70de994 in ThreadWeaver::ThreadRunHelper::run (this=0xa13fe304, parent=0xa1fbaa0, th=0xc221370) at ../../../threadweaver/Weaver/Thread.cpp:87 #13 0xb70dea4a in ThreadWeaver::Thread::run (this=0xc221370) at ../../../threadweaver/Weaver/Thread.cpp:142 #14 0xb656c503 in QThreadPrivate::start (arg=0xc221370) at thread/qthread_unix.cpp:320 #15 0xb56f0c39 in start_thread (arg=0xa13feb70) at pthread_create.c:304 #16 0xb581c92e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130 Backtrace stopped: Not enough registers or memory available to unwind further Thread 1 (Thread 0xb28de950 (LWP 17682)): [KCrash Handler] #7 0xb78c7424 in __kernel_vsyscall () #8 0xb577a8f1 in *__GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 #9 0xb577dd22 in *__GI_abort () at abort.c:92 #10 0xb6561626 in qt_message_output (msgType=QtFatalMsg, buf=0xa001b698 "ASSERT: \"!DUChain::lock()->currentThreadHasReadLock() && !DUChain::lock()->currentThreadHasWriteLock()\" in file /home/andreas/src/kdevelop/languages/cpp/codecompletion/context.cpp, line 133") at global/qglobal.cpp:2306 #11 0xb6561a2b in qt_message (msgType=QtFatalMsg, msg=0xb66cdc88 "ASSERT: \"%s\" in file %s, line %d", ap=0xbf8de154 " \375\207\247\334\374\207\247\205") at global/qglobal.cpp:2352 #12 0xb6561b48 in qFatal (msg=0xb66cdc88 "ASSERT: \"%s\" in file %s, line %d") at global/qglobal.cpp:2535 #13 0xb6561bd5 in qt_assert (assertion=0xa787fd20 "!DUChain::lock()->currentThreadHasReadLock() && !DUChain::lock()->currentThreadHasWriteLock()", file=0xa787fcdc "/home/andreas/src/kdevelop/languages/cpp/codecompletion/context.cpp", line=133) at global/qglobal.cpp:2030 #14 0xa78308d5 in Cpp::switchExpressionType (caseContext=...) at /home/andreas/src/kdevelop/languages/cpp/codecompletion/context.cpp:133 #15 0xa7838ec7 in Cpp::CodeCompletionContext::caseAccessCompletionItems (this=0xa02ec8f0) at /home/andreas/src/kdevelop/languages/cpp/codecompletion/context.cpp:1384 #16 0xa783cf40 in Cpp::CodeCompletionContext::completionItems (this=0xa02ec8f0, shouldAbort=@0xbf8de34b, fullCompletion=false) at /home/andreas/src/kdevelop/languages/cpp/codecompletion/context.cpp:1796 #17 0xa782eb6c in Cpp::CodeCompletionModel::foundDeclarations (this=0xac40588, item=..., completionContext=...) at /home/andreas/src/kdevelop/languages/cpp/codecompletion/model.cpp:233 #18 0xb5201950 in KDevelop::CodeCompletionModel::qt_metacall (this=0xac40588, _c=QMetaObject::InvokeMetaMethod, _id=2, _a=0xa3759d28) at /home/andreas/src/build/kdevplatform/language/codecompletionmodel.moc:91 #19 0xa782edc2 in Cpp::CodeCompletionModel::qt_metacall (this=0xac40588, _c=QMetaObject::InvokeMetaMethod, _id=28, _a=0xa3759d28) at /home/andreas/src/build/kdevelop/languages/cpp/model.moc:66 #20 0xb666d5dd in metacall (argv=0xa3759d28, idx=28, cl=QMetaObject::InvokeMetaMethod, object=0xac40588) at kernel/qmetaobject.cpp:237 #21 QMetaObject::metacall (object=0xac40588, cl=QMetaObject::InvokeMetaMethod, idx=28, argv=0xa3759d28) at kernel/qmetaobject.cpp:232 #22 0xb6677f25 in QMetaCallEvent::placeMetaCall (this=0xa073fd88, object=0xac40588) at kernel/qobject.cpp:535 #23 0xb667f43f in QObject::event (this=0xac40588, e=0xa073fd88) at kernel/qobject.cpp:1217 #24 0xb5b947a4 in notify_helper (e=0xa073fd88, receiver=0xac40588, this=0x9e1ece0) at kernel/qapplication.cpp:4467 #25 QApplicationPrivate::notify_helper (this=0x9e1ece0, receiver=0xac40588, e=0xa073fd88) at kernel/qapplication.cpp:4439 #26 0xb5b99b32 in QApplication::notify (this=0xa073fd88, receiver=0xac40588, e=0xa073fd88) at kernel/qapplication.cpp:4214 #27 0xb6a22511 in KApplication::notify (this=0xbf8ded38, receiver=0xac40588, event=0xa073fd88) at ../../kdeui/kernel/kapplication.cpp:311 #28 0xb666722e in QCoreApplication::notifyInternal (this=0xbf8ded38, receiver=0xac40588, event=0xa073fd88) at kernel/qcoreapplication.cpp:731 #29 0xb666a9f4 in sendEvent (event=<optimized out>, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215 #30 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x9df9c18) at kernel/qcoreapplication.cpp:1372 #31 0xb666ab3c in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0) at kernel/qcoreapplication.cpp:1265 #32 0xb6695044 in sendPostedEvents () at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:220 #33 postEventSourceDispatch (s=0x9e21690) at kernel/qeventdispatcher_glib.cpp:277 #34 0xb4a96a3f in g_main_context_dispatch () from /lib/i386-linux-gnu/libglib-2.0.so.0 #35 0xb4a97170 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0 #36 0xb4a9740a in g_main_context_iteration () from /lib/i386-linux-gnu/libglib-2.0.so.0 #37 0xb6695477 in QEventDispatcherGlib::processEvents (this=0x9dfab08, flags=...) at kernel/qeventdispatcher_glib.cpp:422 #38 0xb5c4972a in QGuiEventDispatcherGlib::processEvents (this=0x9dfab08, flags=...) at kernel/qguieventdispatcher_glib.cpp:204 #39 0xb666624d in QEventLoop::processEvents (this=0xbf8deb44, flags=...) at kernel/qeventloop.cpp:149 #40 0xb6666491 in QEventLoop::exec (this=0xbf8deb44, flags=...) at kernel/qeventloop.cpp:201 #41 0xb666abea in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1008 #42 0xb5b92624 in QApplication::exec () at kernel/qapplication.cpp:3741 #43 0x08052f2b in main (argc=3, argv=0xbf8df654) at /home/andreas/src/kdevelop/app/main.cpp:479 are you sure you are up2date? I thought I have fixed that with commit ec88f4a54b41e9676ed5ad020f4598293512a3ed ... *** This bug has been marked as a duplicate of bug 291468 *** Actually after reading the dupe, this is not a duplicate. Thats also matched by still reproducing the bug. So just to make the difference clearer: I'm having an int-variable that I switch on and the case-labels are using defines. I'm not completing the defines either, just starting to type their names. So something like this crashes for me: #define SUCCESS 0 #define ERROR 1 int foo = 0; switch(foo) { case S| For normal enum-variables everything is fine for me too, hence re-opening this report. Git commit 3e2013198901ae4b25322a731204a3bb51730fed by Milian Wolff. Committed on 22/01/2012 at 17:39. Pushed by mwolff into branch '4.3'. fix assertion properly M +3 -1 languages/cpp/codecompletion/context.cpp http://commits.kde.org/kdevelop/3e2013198901ae4b25322a731204a3bb51730fed |