Bug 222317 - Crash when closing KDevelop while debugger is running
Summary: Crash when closing KDevelop while debugger is running
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: CPP Debugger (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-12 00:49 UTC by Ludger Sprenker
Modified: 2010-01-30 23:21 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ludger Sprenker 2010-01-12 00:49:08 UTC
Application: kdevelop (3.9.97 (using KDevPlatform 0.9.97))
KDE Platform Version: 4.3.90 (KDE 4.3.90 (KDE 4.4 RC1))
Qt Version: 4.6.0
Operating System: Linux 2.6.31-17-generic i686
Distribution: Ubuntu 9.10

-- Information about the crash:
I closed KDevelop while the buildin debugger was still running.

The crash can be reproduced every time.

 -- Backtrace:
Application: KDevelop (kdevelop), signal: Segmentation fault
[Current thread is 1 (Thread 0xb77dfac0 (LWP 2966))]

Thread 5 (Thread 0xb4422b70 (LWP 2972)):
#0  0x004d7422 in __kernel_vsyscall ()
#1  0x0058b142 in pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_timedwait.S:179
#2  0x008fe28f in QWaitConditionPrivate::wait (this=0x902a8cc, mutex=0x902a8d0, time=200000) at thread/qwaitcondition_unix.cpp:85
#3  QWaitCondition::wait (this=0x902a8cc, mutex=0x902a8d0, time=200000) at thread/qwaitcondition_unix.cpp:159
#4  0x0300d645 in KDevelop::DUChainPrivate::CleanupThread::run (this=0x902a8c0) at /home/dvelop/src/kdevplatform/language/duchain/duchain.cpp:286
#5  0x008fd3ae in QThreadPrivate::start (arg=0x902a8c0) at thread/qthread_unix.cpp:244
#6  0x0058680e in start_thread (arg=0xb4422b70) at pthread_create.c:300
#7  0x04d637ee in vmsplice () from /lib/tls/i686/cmov/libc.so.6
#8  0x00000000 in ?? ()

Thread 4 (Thread 0xac126b70 (LWP 3204)):
#0  0x004d7422 in __kernel_vsyscall ()
#1  0x0058ae15 in pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_wait.S:122
#2  0x040adbb7 in WTF::TCMalloc_PageHeap::scavengerThread (this=0x41871a0) at ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:2304
#3  0x040adc01 in WTF::TCMalloc_PageHeap::runScavengerThread (context=0x41871a0) at ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:1438
#4  0x0058680e in start_thread (arg=0xac126b70) at pthread_create.c:300
#5  0x04d637ee in vmsplice () from /lib/tls/i686/cmov/libc.so.6
#6  0x00000000 in ?? ()

Thread 3 (Thread 0xa7a80b70 (LWP 3271)):
#0  0x004d7422 in __kernel_vsyscall ()
#1  0x0058ae15 in pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_wait.S:122
#2  0x008fe307 in QWaitConditionPrivate::wait (this=0x8eebdf8, mutex=0x8eec098, time=4294967295) at thread/qwaitcondition_unix.cpp:87
#3  QWaitCondition::wait (this=0x8eebdf8, mutex=0x8eec098, time=4294967295) at thread/qwaitcondition_unix.cpp:159
#4  0x005318a0 in ThreadWeaver::WeaverImpl::blockThreadUntilJobsAreBeingAssigned (this=0x8eebde0, th=0xacca330) at ../../../threadweaver/Weaver/WeaverImpl.cpp:365
#5  0x0053441c in ThreadWeaver::WorkingHardState::waitForAvailableJob (this=0x8eec158, th=0xacca330) at ../../../threadweaver/Weaver/WorkingHardState.cpp:80
#6  0x0053026b in ThreadWeaver::WeaverImpl::waitForAvailableJob (this=0x8eebde0, th=0xacca330) at ../../../threadweaver/Weaver/WeaverImpl.cpp:356
#7  0x00534512 in ThreadWeaver::WorkingHardState::applyForWork (this=0x8eec158, th=0xacca330) at ../../../threadweaver/Weaver/WorkingHardState.cpp:71
#8  0x00531b23 in ThreadWeaver::WeaverImpl::applyForWork (this=0x8eebde0, th=0xacca330, previous=0xe022300) at ../../../threadweaver/Weaver/WeaverImpl.cpp:351
#9  0x005324fe in ThreadWeaver::ThreadRunHelper::run (this=0xa7a80304, parent=0x8eebde0, th=0xacca330) at ../../../threadweaver/Weaver/Thread.cpp:87
#10 0x00532b1b in ThreadWeaver::Thread::run (this=0xacca330) at ../../../threadweaver/Weaver/Thread.cpp:142
#11 0x008fd3ae in QThreadPrivate::start (arg=0xacca330) at thread/qthread_unix.cpp:244
#12 0x0058680e in start_thread (arg=0xa7a80b70) at pthread_create.c:300
#13 0x04d637ee in vmsplice () from /lib/tls/i686/cmov/libc.so.6
#14 0x00000000 in ?? ()

Thread 2 (Thread 0xa727fb70 (LWP 3272)):
#0  0x004d7422 in __kernel_vsyscall ()
#1  0x0058ae15 in pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_wait.S:122
#2  0x008fe307 in QWaitConditionPrivate::wait (this=0x8eebdf8, mutex=0x8eec098, time=4294967295) at thread/qwaitcondition_unix.cpp:87
#3  QWaitCondition::wait (this=0x8eebdf8, mutex=0x8eec098, time=4294967295) at thread/qwaitcondition_unix.cpp:159
#4  0x005318a0 in ThreadWeaver::WeaverImpl::blockThreadUntilJobsAreBeingAssigned (this=0x8eebde0, th=0xab4b92b8) at ../../../threadweaver/Weaver/WeaverImpl.cpp:365
#5  0x0053441c in ThreadWeaver::WorkingHardState::waitForAvailableJob (this=0x8eec158, th=0xab4b92b8) at ../../../threadweaver/Weaver/WorkingHardState.cpp:80
#6  0x0053026b in ThreadWeaver::WeaverImpl::waitForAvailableJob (this=0x8eebde0, th=0xab4b92b8) at ../../../threadweaver/Weaver/WeaverImpl.cpp:356
#7  0x00534512 in ThreadWeaver::WorkingHardState::applyForWork (this=0x8eec158, th=0xab4b92b8) at ../../../threadweaver/Weaver/WorkingHardState.cpp:71
#8  0x00531b23 in ThreadWeaver::WeaverImpl::applyForWork (this=0x8eebde0, th=0xab4b92b8, previous=0x0) at ../../../threadweaver/Weaver/WeaverImpl.cpp:351
#9  0x00534531 in ThreadWeaver::WorkingHardState::applyForWork (this=0x8eec158, th=0xab4b92b8) at ../../../threadweaver/Weaver/WorkingHardState.cpp:74
#10 0x00531b23 in ThreadWeaver::WeaverImpl::applyForWork (this=0x8eebde0, th=0xab4b92b8, previous=0xe61ea58) at ../../../threadweaver/Weaver/WeaverImpl.cpp:351
#11 0x005324fe in ThreadWeaver::ThreadRunHelper::run (this=0xa727f304, parent=0x8eebde0, th=0xab4b92b8) at ../../../threadweaver/Weaver/Thread.cpp:87
#12 0x00532b1b in ThreadWeaver::Thread::run (this=0xab4b92b8) at ../../../threadweaver/Weaver/Thread.cpp:142
#13 0x008fd3ae in QThreadPrivate::start (arg=0xab4b92b8) at thread/qthread_unix.cpp:244
#14 0x0058680e in start_thread (arg=0xa727fb70) at pthread_create.c:300
#15 0x04d637ee in vmsplice () from /lib/tls/i686/cmov/libc.so.6
#16 0x00000000 in ?? ()

Thread 1 (Thread 0xb77dfac0 (LWP 2966)):
[KCrash Handler]
#5  0x015757cb in __dynamic_cast () from /usr/lib/libstdc++.so.6
#6  0x02881669 in GdbJob::model (this=0xeeebde8) at /home/dvelop/src/kdevelop/debuggers/gdb/gdblaunchconfig.cpp:237
#7  0x0288168d in GdbJob::stdoutReceived (this=0xeeebde8, l=...) at /home/dvelop/src/kdevelop/debuggers/gdb/gdblaunchconfig.cpp:232
#8  0x02881757 in GdbJob::qt_metacall (this=0xeeebde8, _c=QMetaObject::InvokeMetaMethod, _id=27, _a=0xbfe14098) at /home/dvelop/src/kdevelop/build/debuggers/gdb/gdblaunchconfig.moc:77
#9  0x00a0411a in QMetaObject::metacall (object=0xeeebde8, cl=171400296, idx=27, argv=0xbfe14098) at kernel/qmetaobject.cpp:237
#10 0x00a1289b in QMetaObject::activate (sender=0xd39f660, m=0x28a57d0, local_signal_index=1, argv=0xbfe14098) at kernel/qobject.cpp:3294
#11 0x02875ec3 in GDBDebugger::DebugSession::applicationStandardErrorLines (this=0xd39f660, _t1=...) at /home/dvelop/src/kdevelop/build/debuggers/gdb/debugsession.moc:231
#12 0x0287684c in GDBDebugger::DebugSession::programFinished (this=0xd39f660, msg=...) at /home/dvelop/src/kdevelop/debuggers/gdb/debugsession.cpp:835
#13 0x0287bee6 in GDBDebugger::DebugSession::slotProgramStopped (this=0xd39f660, r=...) at /home/dvelop/src/kdevelop/debuggers/gdb/debugsession.cpp:747
#14 0x028811e4 in GDBDebugger::DebugSession::qt_metacall (this=0xd39f660, _c=QMetaObject::InvokeMetaMethod, _id=37, _a=0xbfe14358)
    at /home/dvelop/src/kdevelop/build/debuggers/gdb/debugsession.moc:201
#15 0x00a0411a in QMetaObject::metacall (object=0xd39f660, cl=171400296, idx=58, argv=0xbfe14358) at kernel/qmetaobject.cpp:237
#16 0x00a1289b in QMetaObject::activate (sender=0x102a1fd8, m=0x28a4690, local_signal_index=2, argv=0xbfe14358) at kernel/qobject.cpp:3294
#17 0x02850c63 in GDBDebugger::GDB::programStopped (this=0x102a1fd8, _t1=...) at /home/dvelop/src/kdevelop/build/debuggers/gdb/moc_gdb.cpp:138
#18 0x0285233c in GDBDebugger::GDB::processLine (this=0x102a1fd8, line=...) at /home/dvelop/src/kdevelop/debuggers/gdb/gdb.cpp:254
#19 0x02852d5e in GDBDebugger::GDB::readyReadStandardOutput (this=0x102a1fd8) at /home/dvelop/src/kdevelop/debuggers/gdb/gdb.cpp:175
#20 0x02850ee3 in GDBDebugger::GDB::qt_metacall (this=0x102a1fd8, _c=QMetaObject::InvokeMetaMethod, _id=15, _a=0xbfe145cc) at /home/dvelop/src/kdevelop/build/debuggers/gdb/moc_gdb.cpp:111
#21 0x00a0411a in QMetaObject::metacall (object=0x102a1fd8, cl=171400296, idx=15, argv=0xbfe145cc) at kernel/qmetaobject.cpp:237
#22 0x00a1289b in QMetaObject::activate (sender=0xeae9ac0, m=0xb116c8, local_signal_index=5, argv=0x0) at kernel/qobject.cpp:3294
#23 0x00996547 in QProcess::readyReadStandardOutput (this=0xeae9ac0) at .moc/release-shared/moc_qprocess.cpp:162
#24 0x0099acaf in QProcessPrivate::_q_canReadStandardOutput (this=0xeae9df8) at io/qprocess.cpp:886
#25 0x0099b126 in QProcess::qt_metacall (this=0xeae9ac0, _c=QMetaObject::InvokeMetaMethod, _id=9, _a=0xbfe147c8) at .moc/release-shared/moc_qprocess.cpp:107
#26 0x00c3e6fa in KProcess::qt_metacall (this=0xeae9ac0, _c=QMetaObject::InvokeMetaMethod, _id=17, _a=0xbfe147c8) at ./kprocess.moc:69
#27 0x00a0411a in QMetaObject::metacall (object=0xeae9ac0, cl=171400296, idx=17, argv=0xbfe147c8) at kernel/qmetaobject.cpp:237
#28 0x00a1289b in QMetaObject::activate (sender=0xeaea2f8, m=0xb13550, local_signal_index=0, argv=0xbfe147c8) at kernel/qobject.cpp:3294
#29 0x00a64053 in QSocketNotifier::activated (this=0xeaea2f8, _t1=53) at .moc/release-shared/moc_qsocketnotifier.cpp:89
#30 0x00a19e27 in QSocketNotifier::event (this=0xeaea2f8, e=0xbfe14c04) at kernel/qsocketnotifier.cpp:317
#31 0x06d5219c in QApplicationPrivate::notify_helper (this=0x8d15168, receiver=0xeaea2f8, e=0xbfe14c04) at kernel/qapplication.cpp:4242
#32 0x06d58df7 in QApplication::notify (this=0xbfe15050, receiver=0xeaea2f8, e=0xbfe14c04) at kernel/qapplication.cpp:3661
#33 0x07e1e67a in KApplication::notify (this=0xbfe15050, receiver=0xeaea2f8, event=0xbfe14c04) at ../../kdeui/kernel/kapplication.cpp:302
#34 0x009feeab in QCoreApplication::notifyInternal (this=0xbfe15050, receiver=0xeaea2f8, event=0xbfe14c04) at kernel/qcoreapplication.cpp:704
#35 0x00a2d410 in QCoreApplication::sendEvent (this=0x8d15128) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
#36 QEventDispatcherUNIX::activateSocketNotifiers (this=0x8d15128) at kernel/qeventdispatcher_unix.cpp:878
#37 0x00a2d769 in QEventDispatcherUNIXPrivate::doSelect (this=0x8d15280, flags=..., timeout=0xbfe14d74) at kernel/qeventdispatcher_unix.cpp:304
#38 0x00a2e425 in QEventDispatcherUNIX::processEvents (this=0x8d15128, flags=...) at kernel/qeventdispatcher_unix.cpp:920
#39 0x06e10bc2 in QEventDispatcherX11::processEvents (this=0x8d15128, flags=...) at kernel/qeventdispatcher_x11.cpp:152
#40 0x009fd4c9 in QEventLoop::processEvents (this=0xbfe14f74, flags=) at kernel/qeventloop.cpp:149
#41 0x009fd91a in QEventLoop::exec (this=0xbfe14f74, flags=...) at kernel/qeventloop.cpp:201
#42 0x00a01b0f in QCoreApplication::exec () at kernel/qcoreapplication.cpp:981
#43 0x06d52237 in QApplication::exec () at kernel/qapplication.cpp:3570
#44 0x0804dd13 in main (argc=1, argv=0xbfe155a4) at /home/dvelop/src/kdevelop/app/main.cpp:209

Reported using DrKonqi
Comment 1 Niko Sams 2010-01-12 19:24:59 UTC
I couldn't reproduce, but it looks like the model is invalid; probably deleted by the removed OutputView. (TakeOwnership is set)

Any ideas how to fix this? Use a QWeakPointer?
Comment 2 Andreas Pakulat 2010-01-13 08:37:24 UTC
(In reply to comment #1)
> I couldn't reproduce, but it looks like the model is invalid; probably deleted
> by the removed OutputView. (TakeOwnership is set)
> 
> Any ideas how to fix this? Use a QWeakPointer?

So the problem is that the job runs even though the model has been deleted already? Then maybe the outputview shouldn't take ownership of the model and instead the job should take it. Or the job needs to be notified of the model-deletion.
Comment 3 Niko Sams 2010-01-30 23:21:49 UTC
SVN commit 1082598 by nsams:

Use QWeakPointer for outputModel, as it can get deleted by OutputData.
CCBUG: 222317

 M  +3 -4      outputjob.cpp  
 M  +1 -1      outputjob.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1082598
Comment 4 Niko Sams 2010-01-30 23:21:55 UTC
SVN commit 1082599 by nsams:

Append output to OutputModel only when it is still alive.
BUG: 222317

 M  +6 -2      kdevelop/debuggers/gdb/gdblaunchconfig.cpp  
 M  +13 -6     kdevplatform/plugins/execute/nativeappjob.cpp  
 M  +1 -0      kdevplatform/plugins/execute/nativeappjob.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1082599