Summary: | KDevelop crashed on exit before CTest evaluation finished | ||
---|---|---|---|
Product: | [Applications] kdevelop | Reporter: | Igor Kushnir <igorkuo> |
Component: | general | Assignee: | Igor Kushnir <igorkuo> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | igorkuo |
Priority: | NOR | Keywords: | drkonqi |
Version: | git master | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/kdevelop/kdevelop/commit/ae9f45ae7451a33fe9fce66612140f9a13193bd6 | Version Fixed In: | 5.6.1 |
Attachments: |
New crash information added by DrKonqi
New crash information added by DrKonqi New crash information added by DrKonqi |
Description
Igor Kushnir
2020-06-29 11:25:49 UTC
Created attachment 129798 [details]
New crash information added by DrKonqi
kdevelop (5.5.40) using Qt 5.15.0
- What I was doing when the application crashed:
KDevelop was re-parsing code after I switched from a Release-build-type directory to a Debug-build-type directory and back again. The re-parsing process was excruciatingly slow. I decided to quit KDevelop, then start it again as this often speeds the parsing up. However KDevelop crashed during exit with the attached backtrace.
-- Backtrace (Reduced):
#5 0x00007f3799f3020a in KDevelop::DUContext::findLocalDeclarations(KDevelop::IndexedIdentifier const&, KDevelop::CursorInRevision const&, KDevelop::TopDUContext const*, KDevelop::TypePtr<KDevelop::AbstractType> const&, QFlags<KDevelop::DUContext::SearchFlag>) const (this=this@entry=0x7f36f4e7fb10, identifier=..., position=..., topContext=topContext@entry=0x0, dataType=..., flags=...) at /usr/src/debug/kdevelop/kdevplatform/language/duchain/ducontext.cpp:540
#6 0x00007f3799f3027f in KDevelop::DUContext::findLocalDeclarations(KDevelop::Identifier const&, KDevelop::CursorInRevision const&, KDevelop::TopDUContext const*, KDevelop::TypePtr<KDevelop::AbstractType> const&, QFlags<KDevelop::DUContext::SearchFlag>) const (this=this@entry=0x7f36f4e7fb10, identifier=..., position=..., topContext=topContext@entry=0x0, dataType=..., flags=...) at /usr/src/debug/kdevelop/kdevplatform/language/duchain/ducontext.cpp:549
#7 0x00007f370be54caf in CTestSuite::loadDeclarations(KDevelop::IndexedString const&, KDevelop::ReferencedTopDUContext const&) (this=0x5561bef5dbf0, document=..., ref=...) at /usr/src/debug/kdevelop/kdevplatform/language/editor/cursorinrevision.h:52
#8 0x00007f370be4fbbe in CTestFindJob::updateReady(KDevelop::IndexedString const&, KDevelop::ReferencedTopDUContext const&) (this=0x5561c003cc50, document=..., context=...) at /usr/src/debug/kdevelop/plugins/cmake/testing/ctestfindjob.cpp:82
#9 0x00007f379b58a0b2 in QObject::event(QEvent*) () at /usr/lib/libQt5Core.so.5
Created attachment 129808 [details]
New crash information added by DrKonqi
kdevelop (5.5.40) using Qt 5.15.0
- What I was doing when the application crashed:
KDevelop was re-parsing code after I switched from a Debug-build-type directory and back again. I decided to quit KDevelop, then start it again as this often speeds the parsing up. However KDevelop crashed during exit with the attached backtrace.
-- Backtrace (Reduced):
#4 0x00007fc658028987 in QExplicitlySharedDataPointer<KDevelop::ParsingEnvironmentFile>::QExplicitlySharedDataPointer(QExplicitlySharedDataPointer<KDevelop::ParsingEnvironmentFile> const&) (o=..., this=this@entry=0x7ffddcf06498) at /usr/include/qt/QtCore/qshareddata.h:187
#5 KDevelop::TopDUContext::parsingEnvironmentFile() const (this=this@entry=0x561695dcd0a0) at /usr/src/debug/kdevelop/kdevplatform/language/duchain/topducontext.cpp:566
#6 0x00007fc65807c7a1 in KDevelop::DUChainUtils::contentContextFromProxyContext(KDevelop::TopDUContext*) (top=0x561695dcd0a0) at /usr/src/debug/kdevelop/kdevplatform/language/duchain/duchainutils.cpp:251
#7 0x00007fc5dc6a2bfb in CTestSuite::loadDeclarations(KDevelop::IndexedString const&, KDevelop::ReferencedTopDUContext const&) (this=0x5616944bd050, document=..., ref=...) at /usr/src/debug/kdevelop/kdevplatform/language/duchain/topducontext.h:70
#8 0x00007fc5dc69dbbe in CTestFindJob::updateReady(KDevelop::IndexedString const&, KDevelop::ReferencedTopDUContext const&) (this=0x561699f47be0, document=..., context=...) at /usr/src/debug/kdevelop/plugins/cmake/testing/ctestfindjob.cpp:82
Created attachment 129871 [details]
New crash information added by DrKonqi
kdevelop (5.5.40) using Qt 5.15.0
Yesterday I upgraded to the latest KDevelop master and rebuilt it against my current system libraries. This did not eliminate the crash.
- What I was doing when the application crashed:
KDevelop was re-parsing code after I switched from a Release-build-type directory to a Debug-build-type directory, built, run, then switched again to Release. The reparsing has occupied my CPU core for more than a minute when I decided to restart KDevelop. However KDevelop crashed during exit with the attached backtrace.
-- Backtrace (Reduced):
#4 0x00007f9b947a4f54 in KDevelop::ParsingEnvironmentFile::indexedTopContext() const (this=this@entry=0x7f9af198a6f0) at /usr/src/debug/kdevelop/kdevplatform/language/duchain/parsingenvironment.h:210
#5 0x00007f9b947a511a in KDevelop::ParsingEnvironmentFile::isProxyContext() const (this=0x7f9af198a6f0) at /usr/src/debug/kdevelop/kdevplatform/language/duchain/parsingenvironment.cpp:179
#6 0x00007f9b947b0815 in KDevelop::DUChainUtils::contentContextFromProxyContext(KDevelop::TopDUContext*) (top=0x7f9af198a750) at /usr/include/qt/QtCore/qshareddata.h:160
#7 0x00007f9b18f71b3b in CTestSuite::loadDeclarations(KDevelop::IndexedString const&, KDevelop::ReferencedTopDUContext const&) (this=0x55726bc1a6f0, document=..., ref=...) at /usr/src/debug/kdevelop/kdevplatform/language/duchain/topducontext.h:70
#8 0x00007f9b18f6e043 in CTestFindJob::updateReady(KDevelop::IndexedString const&, KDevelop::ReferencedTopDUContext const&) (this=0x557274429280, document=..., context=...) at /usr/src/debug/kdevelop/plugins/cmake/testing/ctestfindjob.cpp:82
An alternative backtrace for the same issue: Application: KDevelop (kdevelop), signal: Aborted [KCrash Handler] #4 0x00007ff14d6d9615 in raise () at /usr/lib/libc.so.6 #5 0x00007ff14d6c2862 in abort () at /usr/lib/libc.so.6 #6 0x00007ff14dc379ac in qt_message_fatal (message=<synthetic pointer>..., context=...) at global/qlogging.cpp:1914 #7 QMessageLogger::fatal(char const*, ...) const (this=this@entry=0x7fffe0b854b8, msg=msg@entry=0x7ff14df3dea0 "ASSERT: \"%s\" in file %s, line %d") at global/qlogging.cpp:893 #8 0x00007ff14dc36d59 in qt_assert(char const*, char const*, int) (assertion=<optimized out>, file=<optimized out>, line=<optimized out>) at ../../include/QtCore/../../src/corelib/global/qlogging.h:90 #9 0x00007ff15087e67c in KDevelop::IndexedString::toUrl() const (this=0x5626cf3aa6a0) at ../kdevplatform/serialization/indexedstring.cpp:304 #10 0x00007ff0c4e52f85 in CTestFindJob::updateReady(KDevelop::IndexedString const&, KDevelop::ReferencedTopDUContext const&) (this=0x5626c31af660, document=..., context=...) at ../plugins/cmake/testing/ctestfindjob.cpp:83 #11 0x00007ff0c4e4bef9 in CTestFindJob::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=0x5626c31af660, _c=QMetaObject::InvokeMetaMethod, _id=1, _a=0x5626b5eabef8) at plugins/cmake/kdevcmakemanager_autogen/LLZHB5VKCH/moc_ctestfindjob.cpp:83 #12 0x00007ff14de861d2 in QObject::event(QEvent*) (this=0x5626c31af660, e=0x5626b5eabeb0) at kernel/qobject.cpp:1314 #13 0x00007ff14ece4702 in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0x5626c31af660, e=0x5626b5eabeb0) at kernel/qapplication.cpp:3671 #14 0x00007ff14de597ba in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x5626c31af660, event=0x5626b5eabeb0) at ../../include/QtCore/5.15.0/QtCore/private/../../../../../src/corelib/thread/qthread_p.h:325 #15 0x00007ff14de5c2a3 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (receiver=0x0, event_type=0, data=0x5626aefbc090) at kernel/qcoreapplication.cpp:1815 #16 0x00007ff14deb2cf4 in postEventSourceDispatch(GSource*, GSourceFunc, gpointer) (s=0x5626af08eb50) at kernel/qeventdispatcher_glib.cpp:277 #17 0x00007ff14a21843c in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0 #18 0x00007ff14a2661d9 in () at /usr/lib/libglib-2.0.so.0 #19 0x00007ff14a217221 in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0 #20 0x00007ff14deb2331 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x5626aefd09f0, flags=...) at kernel/qeventdispatcher_glib.cpp:423 #21 0x00007ff14de5813c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7fffe0b859b0, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:141 #22 0x00007ff14de605c4 in QCoreApplication::exec() () at ../../include/QtCore/../../src/corelib/global/qflags.h:121 #23 0x00005626ad13b81f in main(int, char**) (argc=3, argv=0x7fffe0b85e28) at ../app/main.cpp:850 [Inferior 1 (process 142157) detached] I have fixes for this and related crash in Bug 329246. Will create a merge request soon, after some testing. Git commit ae9f45ae7451a33fe9fce66612140f9a13193bd6 by Igor Kushnir. Committed on 07/10/2020 at 10:26. Pushed by igorkushnir into branch '5.6'. Early-return from CTestFindJob::updateReady() if the job is finished When a user exits KDevelop while a CTestFindJob is still working, the job is killed from RunController::cleanup() and its KJob parent calls deleteLater(). But the killed job can be still not destroyed after DUChain::shutdown() is called, which results in a crash if CTestFindJob::updateReady() is then invoked via Qt::QueuedConnection. Note that ~ParseJob() queues calls to CTestFindJob::updateReady(), which can then be invoked after DUChain::shutdown(), if ParseJob-s are running when the user exits KDevelop and no event loop is entered in the time between the ~ParseJob() and DUChain::shutdown() calls (sometimes the optional QCoreApplication::processEvents() call in BackgroundParser::waitForIdle() intervenes and prevents the crash). Core::cleanup() calls backgroundParser()->waitForIdle(), which ensures that all parse jobs finish, are destroyed and queue "updateReady" calls. FIXED-IN: 5.6.1 M +10 -0 plugins/cmake/testing/ctestfindjob.cpp https://invent.kde.org/kdevelop/kdevelop/commit/ae9f45ae7451a33fe9fce66612140f9a13193bd6 |