Bug 290845 - Crash when debugging a launch and a working set from another area has not been visited
Summary: Crash when debugging a launch and a working set from another area has not bee...
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: 4.2.3
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-07 05:26 UTC by David E. Narvaez
Modified: 2012-03-08 19:09 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David E. Narvaez 2012-01-07 05:26:05 UTC
Application: kdevelop (4.3.60)
KDE Platform Version: 4.7.95 (4.8 RC1 (4.7.95) (Compiled from sources)
Qt Version: 4.8.0
Operating System: Linux 3.1.4-gentoo x86_64
Distribution (Platform): Gentoo Packages

-- Information about the crash:
Say you have two working sets, one called B in the Debug area and one callled A in the Code area, and your KDevelop starts in the Code area. If you try to debug before visiting the Debug area (that is, working set B is never visited), KDevelop crashes.

- What I was doing when the application crashed:

1. Get two working sets
2. Open one working set in the debug area
3. Open the other working set in the code area
4. Close KDevelop (while on the Code area)
5. Open KDevelop again
6. Start debugging right away
7. KDevelop crashes in assertion Q_ASSERT(textDoc)

The crash can be reproduced every time.

-- Backtrace:
Application: KDevelop (kdevelop), signal: Aborted
[Current thread is 1 (Thread 0x7ff5df5cb760 (LWP 22882))]

Thread 11 (Thread 0x7ff5c6499700 (LWP 22892)):
#0  0x00007ff5db2726ab in pthread_cond_timedwait () from /lib64/libpthread.so.0
#1  0x00007ff5db504dae in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib64/qt4/libQtCore.so.4
#2  0x00007ff5d7e0f30f in KDevelop::DUChainPrivate::CleanupThread::run (this=0xc3ff60) at /home/david/Projects/kdevplatform/language/duchain/duchain.cpp:282
#3  0x00007ff5db50493b in QThreadPrivate::start(void*) () from /usr/lib64/qt4/libQtCore.so.4
#4  0x00007ff5db26dc2c in start_thread () from /lib64/libpthread.so.0
#5  0x00007ff5d99297bd in clone () from /lib64/libc.so.6

Thread 10 (Thread 0x7ff5bda16700 (LWP 22893)):
#0  0x00007ff5d99231b3 in select () from /lib64/libc.so.6
#1  0x00007ff5db5d89b0 in QProcessManager::run() () from /usr/lib64/qt4/libQtCore.so.4
#2  0x00007ff5db50493b in QThreadPrivate::start(void*) () from /usr/lib64/qt4/libQtCore.so.4
#3  0x00007ff5db26dc2c in start_thread () from /lib64/libpthread.so.0
#4  0x00007ff5d99297bd in clone () from /lib64/libc.so.6

Thread 9 (Thread 0x7ff5b5755700 (LWP 22896)):
#0  0x00007ff5db27232c in pthread_cond_wait () from /lib64/libpthread.so.0
#1  0x00007ff5d8ae0fd2 in QTWTF::TCMalloc_PageHeap::scavengerThread() () from /usr/lib64/qt4/libQtScript.so.4
#2  0x00007ff5d8ae1009 in QTWTF::TCMalloc_PageHeap::runScavengerThread(void*) () from /usr/lib64/qt4/libQtScript.so.4
#3  0x00007ff5db26dc2c in start_thread () from /lib64/libpthread.so.0
#4  0x00007ff5d99297bd in clone () from /lib64/libc.so.6

Thread 8 (Thread 0x7ff5b3e7d700 (LWP 22897)):
#0  0x00007ff5d9920c83 in poll () from /lib64/libc.so.6
#1  0x00007ff5d4e0ed50 in g_main_context_iterate.clone.6 () from /usr/lib64/libglib-2.0.so.0
#2  0x00007ff5d4e0f201 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#3  0x00007ff5db62b9db in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#4  0x00007ff5db5fcc82 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#5  0x00007ff5db5fced7 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#6  0x00007ff5db5019bf in QThread::exec() () from /usr/lib64/qt4/libQtCore.so.4
#7  0x00007ff5db50493b in QThreadPrivate::start(void*) () from /usr/lib64/qt4/libQtCore.so.4
#8  0x00007ff5db26dc2c in start_thread () from /lib64/libpthread.so.0
#9  0x00007ff5d99297bd in clone () from /lib64/libc.so.6

Thread 7 (Thread 0x7ff5b367c700 (LWP 22898)):
#0  0x00007ff5d9920c83 in poll () from /lib64/libc.so.6
#1  0x00007ff5d4e0ed50 in g_main_context_iterate.clone.6 () from /usr/lib64/libglib-2.0.so.0
#2  0x00007ff5d4e0f201 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#3  0x00007ff5db62b9db in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#4  0x00007ff5db5fcc82 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#5  0x00007ff5db5fced7 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#6  0x00007ff5db5019bf in QThread::exec() () from /usr/lib64/qt4/libQtCore.so.4
#7  0x00007ff5db50493b in QThreadPrivate::start(void*) () from /usr/lib64/qt4/libQtCore.so.4
#8  0x00007ff5db26dc2c in start_thread () from /lib64/libpthread.so.0
#9  0x00007ff5d99297bd in clone () from /lib64/libc.so.6

Thread 6 (Thread 0x7ff5b1d9f700 (LWP 22909)):
#0  0x00007ff5d9920c83 in poll () from /lib64/libc.so.6
#1  0x00007ff5d4e0ed50 in g_main_context_iterate.clone.6 () from /usr/lib64/libglib-2.0.so.0
#2  0x00007ff5d4e0f201 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#3  0x00007ff5db62b9db in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#4  0x00007ff5db5fcc82 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#5  0x00007ff5db5fced7 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#6  0x00007ff5db5019bf in QThread::exec() () from /usr/lib64/qt4/libQtCore.so.4
#7  0x00007ff5db5dd65f in QInotifyFileSystemWatcherEngine::run() () from /usr/lib64/qt4/libQtCore.so.4
#8  0x00007ff5db50493b in QThreadPrivate::start(void*) () from /usr/lib64/qt4/libQtCore.so.4
#9  0x00007ff5db26dc2c in start_thread () from /lib64/libpthread.so.0
#10 0x00007ff5d99297bd in clone () from /lib64/libc.so.6

Thread 5 (Thread 0x7ff5b0553700 (LWP 22929)):
#0  0x00007ff5db2726ab in pthread_cond_timedwait () from /lib64/libpthread.so.0
#1  0x00007ff5db504dae in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib64/qt4/libQtCore.so.4
#2  0x00007ff5db4f8e56 in QThreadPoolThread::run() () from /usr/lib64/qt4/libQtCore.so.4
#3  0x00007ff5db50493b in QThreadPrivate::start(void*) () from /usr/lib64/qt4/libQtCore.so.4
#4  0x00007ff5db26dc2c in start_thread () from /lib64/libpthread.so.0
#5  0x00007ff5d99297bd in clone () from /lib64/libc.so.6

Thread 4 (Thread 0x7ff5b0d54700 (LWP 22973)):
#0  0x00007ff5db27232c in pthread_cond_wait () from /lib64/libpthread.so.0
#1  0x00007ff5d36cb794 in WTF::TCMalloc_PageHeap::scavengerThread() () from /usr/lib64/qt4/libQtWebKit.so.4
#2  0x00007ff5d36cb8b9 in WTF::TCMalloc_PageHeap::runScavengerThread(void*) () from /usr/lib64/qt4/libQtWebKit.so.4
#3  0x00007ff5db26dc2c in start_thread () from /lib64/libpthread.so.0
#4  0x00007ff5d99297bd in clone () from /lib64/libc.so.6

Thread 3 (Thread 0x7ff5af551700 (LWP 22974)):
#0  0x00007ff5d9920c83 in poll () from /lib64/libc.so.6
#1  0x00007ff5d4e0ed50 in g_main_context_iterate.clone.6 () from /usr/lib64/libglib-2.0.so.0
#2  0x00007ff5d4e0f201 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#3  0x00007ff5db62b9db in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#4  0x00007ff5db5fcc82 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#5  0x00007ff5db5fced7 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#6  0x00007ff5db5019bf in QThread::exec() () from /usr/lib64/qt4/libQtCore.so.4
#7  0x00007ff5db50493b in QThreadPrivate::start(void*) () from /usr/lib64/qt4/libQtCore.so.4
#8  0x00007ff5db26dc2c in start_thread () from /lib64/libpthread.so.0
#9  0x00007ff5d99297bd in clone () from /lib64/libc.so.6

Thread 2 (Thread 0x7ff56e905700 (LWP 22990)):
#0  0x00007ff5db2726ab in pthread_cond_timedwait () from /lib64/libpthread.so.0
#1  0x00007ff5db504dae in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib64/qt4/libQtCore.so.4
#2  0x00007ff5db4f8e56 in QThreadPoolThread::run() () from /usr/lib64/qt4/libQtCore.so.4
#3  0x00007ff5db50493b in QThreadPrivate::start(void*) () from /usr/lib64/qt4/libQtCore.so.4
#4  0x00007ff5db26dc2c in start_thread () from /lib64/libpthread.so.0
#5  0x00007ff5d99297bd in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x7ff5df5cb760 (LWP 22882)):
[KCrash Handler]
#6  0x00007ff5d9887615 in raise () from /lib64/libc.so.6
#7  0x00007ff5d98888ba in abort () from /lib64/libc.so.6
#8  0x00007ff5db4fa52c in qt_message_output(QtMsgType, char const*) () from /usr/lib64/qt4/libQtCore.so.4
#9  0x00007ff5db4fa69b in qt_message(QtMsgType, char const*, __va_list_tag*) () from /usr/lib64/qt4/libQtCore.so.4
#10 0x00007ff5db4fa804 in qFatal(char const*, ...) () from /usr/lib64/qt4/libQtCore.so.4
#11 0x00007ff5dea6855d in KDevelop::SourceFormatterController::adaptEditorIndentationMode (this=<optimized out>, doc=0x299e2d0, formatter=0xd5b9d8, ignoreModeline=false) at /home/david/Projects/kdevplatform/shell/sourceformattercontroller.cpp:381
#12 0x00007ff5dea68a23 in KDevelop::SourceFormatterController::documentLoaded (this=0xad38d0, doc=0x299e2d0) at /home/david/Projects/kdevplatform/shell/sourceformattercontroller.cpp:105
#13 0x00007ff5db616446 in QObject::event(QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
#14 0x00007ff5da7acb64 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#15 0x00007ff5da7b2203 in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#16 0x00007ff5dbe293a6 in KApplication::notify(QObject*, QEvent*) () from /usr/lib64/libkdeui.so.5
#17 0x00007ff5db5fde63 in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
#18 0x00007ff5db601579 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib64/qt4/libQtCore.so.4
#19 0x00007ff5db62b5d3 in postEventSourceDispatch(_GSource*, int (*)(void*), void*) () from /usr/lib64/qt4/libQtCore.so.4
#20 0x00007ff5d4e0e842 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#21 0x00007ff5d4e0f020 in g_main_context_iterate.clone.6 () from /usr/lib64/libglib-2.0.so.0
#22 0x00007ff5d4e0f201 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#23 0x00007ff5db62b9db in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#24 0x00007ff5da84c4ee in QGuiEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtGui.so.4
#25 0x00007ff5db5fcc82 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#26 0x00007ff5db5fced7 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#27 0x00007ff5db601855 in QCoreApplication::exec() () from /usr/lib64/qt4/libQtCore.so.4
#28 0x000000000040a804 in main (argc=<optimized out>, argv=<optimized out>) at /home/david/Projects/kdevelop/app/main.cpp:479

Possible duplicates by query: bug 288160, bug 287480, bug 287449.

Reported using DrKonqi
Comment 1 Niko Sams 2012-01-07 15:27:35 UTC
does this happen only when starting debugging or also when switching manually to debug area?
Comment 2 David E. Narvaez 2012-01-07 16:20:11 UTC
(In reply to comment #1)
> does this happen only when starting debugging or also when switching manually
> to debug area?

Switching man ually to the debug area does not result in a crash. It seems to happen only when KDevelop "automatically" changes to a new area, for whatever that means codewise (see my next comment for another example).
Comment 3 David E. Narvaez 2012-01-07 16:25:12 UTC
Another way to reproduce is:

1. Get two working sets in a versioned project
2. Open one working set in the Review area
3. Open the other working set in the Code area
4. Close KDevelop (while on the Code area)
5. Open KDevelop again
6. Right click on the project and show differences
7. KDevelop crashes in assertion Q_ASSERT(textDoc) while changing to Review area
Comment 4 David E. Narvaez 2012-01-07 18:07:47 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > does this happen only when starting debugging or also when switching manually
> > to debug area?
> 
> Switching man ually to the debug area does not result in a crash. It seems to
> happen only when KDevelop "automatically" changes to a new area, for whatever
> that means codewise (see my next comment for another example).

Just checked the code and, for the record, the difference between manually and automatically is

void MainWindowPrivate::toggleArea ( int index ) 

and 

void UiController::switchToArea(const QString &areaName, SwitchMode switchMode)
Comment 5 Andreas Pakulat 2012-03-07 16:51:33 UTC
Hmm, did you try this recently? documentLoaded protects against doc->textDocument() being null and returns instead of calling adaptEditorIndentationMode (thats where the assert happens according to you BT). So I don't see how the Q_ASSERT can happen, except if somehow something deletes the textdocument of the specific document while the call is made. But that would mean there's got to be a race and it should be reproducable only part of the time.
Comment 6 David E. Narvaez 2012-03-08 19:09:18 UTC
I can't reproduce this any more, so I'm marking this as fixed. Thanks!