Bug 369631 - KDevelop crashed at startup
Summary: KDevelop crashed at startup
Status: RESOLVED WORKSFORME
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (Clang-based) (show other bugs)
Version: 5.0.1
Platform: Appimage Linux
: NOR crash
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2016-10-02 09:51 UTC by Afief Halumi
Modified: 2018-10-27 02:30 UTC (History)
2 users (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 Afief Halumi 2016-10-02 09:51:00 UTC
Started KDevelop (project loads automatically) and got a crash in under 2 seconds.

Backtrace:
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f592e37de34 in KDevelop::ItemRepository<Utils::SetNodeData, Utils::SetNodeDataRequest, false, false, 24u, 1048576u>::deleteItem(unsigned int) () from /home/afiefh/Kdevelop5/usr/lib/libKDevPlatformLanguage.so.10
(gdb) bt
#0  0x00007f592e37de34 in KDevelop::ItemRepository<Utils::SetNodeData, Utils::SetNodeDataRequest, false, false, 24u, 1048576u>::deleteItem(unsigned int) () from /home/afiefh/Kdevelop5/usr/lib/libKDevPlatformLanguage.so.10
#1  0x00007f592e378b85 in Utils::Set::staticUnref() () from /home/afiefh/Kdevelop5/usr/lib/libKDevPlatformLanguage.so.10
#2  0x00007f592e2b5ae9 in KDevelop::ParsingEnvironmentFile::setFeatures(KDevelop::TopDUContext::Features) () from /home/afiefh/Kdevelop5/usr/lib/libKDevPlatformLanguage.so.10
#3  0x00007f592e2b605c in KDevelop::ParsingEnvironmentFile::setTopContext(KDevelop::IndexedTopDUContext) () from /home/afiefh/Kdevelop5/usr/lib/libKDevPlatformLanguage.so.10
#4  0x00007f592e27d344 in KDevelop::TopDUContext::setParsingEnvironmentFile(KDevelop::ParsingEnvironmentFile*) () from /home/afiefh/Kdevelop5/usr/lib/libKDevPlatformLanguage.so.10
#5  0x00007f592e27d50f in KDevelop::TopDUContext::TopDUContext(KDevelop::IndexedString const&, KDevelop::RangeInRevision const&, KDevelop::ParsingEnvironmentFile*) () from /home/afiefh/Kdevelop5/usr/lib/libKDevPlatformLanguage.so.10
#6  0x00007f590def7721 in ClangHelpers::buildDUChain(void*, QMultiHash<void*, Import> const&, ParseSession const&, KDevelop::TopDUContext::Features, QHash<void*, KDevelop::ReferencedTopDUContext>&, ClangIndex*, std::function<bool ()> const&) () from /home/afiefh/Kdevelop5/usr/lib/libKDevClangPrivate.so.25
#7  0x00007f590e156cf2 in ClangParseJob::run(QSharedPointer<ThreadWeaver::JobInterface>, ThreadWeaver::Thread*) () from /home/afiefh/Kdevelop5/usr/lib/qt5/plugins/kdevplatform/25/kdevclangsupport.so
#8  0x00007f593076a282 in ThreadWeaver::IdDecorator::run(QSharedPointer<ThreadWeaver::JobInterface>, ThreadWeaver::Thread*) () from /home/afiefh/Kdevelop5/usr/lib/libKF5ThreadWeaver.so.5
#9  0x00007f593076abfe in ThreadWeaver::Executor::run(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /home/afiefh/Kdevelop5/usr/lib/libKF5ThreadWeaver.so.5
#10 0x00007f5930769e7b in ThreadWeaver::Private::DefaultExecutor::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /home/afiefh/Kdevelop5/usr/lib/libKF5ThreadWeaver.so.5
#11 0x00007f593076adbb in ThreadWeaver::ExecuteWrapper::executeWrapped(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /home/afiefh/Kdevelop5/usr/lib/libKF5ThreadWeaver.so.5
#12 0x00007f5930769e1f in ThreadWeaver::Private::DebugExecuteWrapper::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /home/afiefh/Kdevelop5/usr/lib/libKF5ThreadWeaver.so.5
#13 0x00007f593076adbb in ThreadWeaver::ExecuteWrapper::executeWrapped(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /home/afiefh/Kdevelop5/usr/lib/libKF5ThreadWeaver.so.5
#14 0x00007f593076ad71 in ThreadWeaver::ExecuteWrapper::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /home/afiefh/Kdevelop5/usr/lib/libKF5ThreadWeaver.so.5
#15 0x00007f593076adbb in ThreadWeaver::ExecuteWrapper::executeWrapped(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /home/afiefh/Kdevelop5/usr/lib/libKF5ThreadWeaver.so.5
#16 0x00007f593076ad71 in ThreadWeaver::ExecuteWrapper::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /home/afiefh/Kdevelop5/usr/lib/libKF5ThreadWeaver.so.5
#17 0x00007f5930768ab7 in ThreadWeaver::Job::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /home/afiefh/Kdevelop5/usr/lib/libKF5ThreadWeaver.so.5
#18 0x00007f593076c6ed in ThreadWeaver::Collection::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /home/afiefh/Kdevelop5/usr/lib/libKF5ThreadWeaver.so.5
#19 0x00007f593076a64b in ThreadWeaver::IdDecorator::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /home/afiefh/Kdevelop5/usr/lib/libKF5ThreadWeaver.so.5
#20 0x00007f59307683b1 in ThreadWeaver::Thread::run() () from /home/afiefh/Kdevelop5/usr/lib/libKF5ThreadWeaver.so.5
#21 0x00007f593258d569 in ?? () from /home/afiefh/Kdevelop5/usr/lib/libQt5Core.so.5
#22 0x00007f592aa3f184 in start_thread (arg=0x7f590d654700) at pthread_create.c:312
#23 0x00007f59319f537d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Backtrace on all threads (too long to include in comment): https://paste.kde.org/pt0vzsvfi

Reproducible: Couldn't Reproduce




Note: Component is a guess.
Comment 1 Sven Brauch 2016-10-02 10:04:48 UTC
Can you rm -Rf ~/.cache/kdevduchain and try again? Looks like corrupted cache.
Comment 2 Afief Halumi 2016-10-02 10:53:12 UTC
The next startup gave me a popup about a possible cache corruption, so it fixed itself.
Comment 3 Afief Halumi 2016-10-02 11:15:54 UTC
I seem to be getting the same crash multiple times today (may have something to do wit the branch of the code I'm wroking with). This time it was a clean startup which cleared the cache due to previous corruption:

Core was generated by `kdevelop'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f11cb60570b in KDevelop::ItemRepository<(anonymous namespace)::IndexedStringData, (anonymous namespace)::IndexedStringRepositoryItemRequest, false, false, 0u, 1048576u>::index((anonymous namespace)::IndexedStringRepositoryItemRequest const&) [clone .constprop.89] () from /home/afiefh/Kdevelop5/usr/lib/libKDevPlatformSerialization.so.10
(gdb) bt
#0  0x00007f11cb60570b in KDevelop::ItemRepository<(anonymous namespace)::IndexedStringData, (anonymous namespace)::IndexedStringRepositoryItemRequest, false, false, 0u, 1048576u>::index((anonymous namespace)::IndexedStringRepositoryItemRequest const&) [clone .constprop.89] () from /home/afiefh/Kdevelop5/usr/lib/libKDevPlatformSerialization.so.10
#1  0x00007f11cb607ef0 in KDevelop::IndexedString::IndexedString(char const*, unsigned short, unsigned int) () from /home/afiefh/Kdevelop5/usr/lib/libKDevPlatformSerialization.so.10
#2  0x00007f11aaf004eb in ClangString::toIndexed() const () from /home/afiefh/Kdevelop5/usr/lib/libKDevClangPrivate.so.25
#3  0x00007f11aae9e6eb in (anonymous namespace)::makeId(CXCursor) () from /home/afiefh/Kdevelop5/usr/lib/libKDevClangPrivate.so.25
#4  0x00007f11aaeb77bd in CXChildVisitResult (anonymous namespace)::Visitor::buildDeclaration<(CXCursorKind)6, KDevelop::ClassMemberDeclaration, false>(CXCursor) () from /home/afiefh/Kdevelop5/usr/lib/libKDevClangPrivate.so.25
#5  0x00007f11aaec755c in (anonymous namespace)::visitCursor(CXCursor, CXCursor, void*) () from /home/afiefh/Kdevelop5/usr/lib/libKDevClangPrivate.so.25
#6  0x00007f11a855828d in clang::cxcursor::CursorVisitor::Visit(CXCursor, bool) () from /home/afiefh/Kdevelop5/usr/lib/libclang.so.3.8
#7  0x00007f11a855915a in clang::cxcursor::CursorVisitor::VisitDeclContext(clang::DeclContext*) () from /home/afiefh/Kdevelop5/usr/lib/libclang.so.3.8
#8  0x00007f11a8557d5b in clang::cxcursor::CursorVisitor::VisitChildren(CXCursor) () from /home/afiefh/Kdevelop5/usr/lib/libclang.so.3.8
#9  0x00007f11a85600d1 in clang_visitChildren () from /home/afiefh/Kdevelop5/usr/lib/libclang.so.3.8
#10 0x00007f11aaeb5e66 in CXChildVisitResult (anonymous namespace)::Visitor::buildDeclaration<(CXCursorKind)4, KDevelop::ClassDeclaration, true>(CXCursor) () from /home/afiefh/Kdevelop5/usr/lib/libKDevClangPrivate.so.25
#11 0x00007f11aaeb6245 in CXChildVisitResult (anonymous namespace)::Visitor::dispatchCursor<(CXCursorKind)4, (Decision)1, (Decision)2, (detail::enabler)0>(CXCursor, CXCursor) ()
   from /home/afiefh/Kdevelop5/usr/lib/libKDevClangPrivate.so.25
#12 0x00007f11aaec6155 in (anonymous namespace)::visitCursor(CXCursor, CXCursor, void*) () from /home/afiefh/Kdevelop5/usr/lib/libKDevClangPrivate.so.25
#13 0x00007f11a855828d in clang::cxcursor::CursorVisitor::Visit(CXCursor, bool) () from /home/afiefh/Kdevelop5/usr/lib/libclang.so.3.8
#14 0x00007f11a855915a in clang::cxcursor::CursorVisitor::VisitDeclContext(clang::DeclContext*) () from /home/afiefh/Kdevelop5/usr/lib/libclang.so.3.8
#15 0x00007f11a8557f45 in clang::cxcursor::CursorVisitor::VisitChildren(CXCursor) () from /home/afiefh/Kdevelop5/usr/lib/libclang.so.3.8
#16 0x00007f11a85600d1 in clang_visitChildren () from /home/afiefh/Kdevelop5/usr/lib/libclang.so.3.8
#17 0x00007f11aaea4ff2 in Builder::visit(CXTranslationUnitImpl*, void*, QHash<void*, KDevelop::ReferencedTopDUContext> const&, bool) () from /home/afiefh/Kdevelop5/usr/lib/libKDevClangPrivate.so.25
#18 0x00007f11aaed61ec in ClangHelpers::buildDUChain(void*, QMultiHash<void*, Import> const&, ParseSession const&, KDevelop::TopDUContext::Features, QHash<void*, KDevelop::ReferencedTopDUContext>&, ClangIndex*, std::function<bool ()> const&) () from /home/afiefh/Kdevelop5/usr/lib/libKDevClangPrivate.so.25
#19 0x00007f11aaed5cad in ClangHelpers::buildDUChain(void*, QMultiHash<void*, Import> const&, ParseSession const&, KDevelop::TopDUContext::Features, QHash<void*, KDevelop::ReferencedTopDUContext>&, ClangIndex*, std::function<bool ()> const&) () from /home/afiefh/Kdevelop5/usr/lib/libKDevClangPrivate.so.25
#20 0x00007f11ab135cf2 in ClangParseJob::run(QSharedPointer<ThreadWeaver::JobInterface>, ThreadWeaver::Thread*) () from /home/afiefh/Kdevelop5/usr/lib/qt5/plugins/kdevplatform/25/kdevclangsupport.so
#21 0x00007f11ce7d1282 in ThreadWeaver::IdDecorator::run(QSharedPointer<ThreadWeaver::JobInterface>, ThreadWeaver::Thread*) () from /home/afiefh/Kdevelop5/usr/lib/libKF5ThreadWeaver.so.5
#22 0x00007f11ce7d1bfe in ThreadWeaver::Executor::run(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /home/afiefh/Kdevelop5/usr/lib/libKF5ThreadWeaver.so.5
#23 0x00007f11ce7d0e7b in ThreadWeaver::Private::DefaultExecutor::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /home/afiefh/Kdevelop5/usr/lib/libKF5ThreadWeaver.so.5
#24 0x00007f11ce7d1dbb in ThreadWeaver::ExecuteWrapper::executeWrapped(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /home/afiefh/Kdevelop5/usr/lib/libKF5ThreadWeaver.so.5
#25 0x00007f11ce7d0e1f in ThreadWeaver::Private::DebugExecuteWrapper::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /home/afiefh/Kdevelop5/usr/lib/libKF5ThreadWeaver.so.5
#26 0x00007f11ce7d1dbb in ThreadWeaver::ExecuteWrapper::executeWrapped(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /home/afiefh/Kdevelop5/usr/lib/libKF5ThreadWeaver.so.5
#27 0x00007f11ce7d1d71 in ThreadWeaver::ExecuteWrapper::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /home/afiefh/Kdevelop5/usr/lib/libKF5ThreadWeaver.so.5
#28 0x00007f11ce7d1dbb in ThreadWeaver::ExecuteWrapper::executeWrapped(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /home/afiefh/Kdevelop5/usr/lib/libKF5ThreadWeaver.so.5
#29 0x00007f11ce7d1d71 in ThreadWeaver::ExecuteWrapper::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /home/afiefh/Kdevelop5/usr/lib/libKF5ThreadWeaver.so.5
#30 0x00007f11ce7cfab7 in ThreadWeaver::Job::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /home/afiefh/Kdevelop5/usr/lib/libKF5ThreadWeaver.so.5
#31 0x00007f11ce7d36ed in ThreadWeaver::Collection::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /home/afiefh/Kdevelop5/usr/lib/libKF5ThreadWeaver.so.5
#32 0x00007f11ce7d164b in ThreadWeaver::IdDecorator::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /home/afiefh/Kdevelop5/usr/lib/libKF5ThreadWeaver.so.5
#33 0x00007f11ce7cf3b1 in ThreadWeaver::Thread::run() () from /home/afiefh/Kdevelop5/usr/lib/libKF5ThreadWeaver.so.5
#34 0x00007f11d05f4569 in ?? () from /home/afiefh/Kdevelop5/usr/lib/libQt5Core.so.5
#35 0x00007f11c8aa6184 in start_thread (arg=0x7f112ffff700) at pthread_create.c:312
#36 0x00007f11cfa5c37d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Saving the core in case it is needed
Comment 4 Sven Brauch 2016-10-02 12:00:57 UTC
To me this crash looks quite different from the first one you posted. That could be a bug. Is the project which you are working on public?
Comment 5 Afief Halumi 2016-10-02 13:53:06 UTC
Unfortunately it isn't a free/public, it's a rather convoluted more than 20 years old codebase in some dire need for refactoring.

If I had to guess I'd say the second bug somehow pollutes the cache causing KDevelop to crash on startup the next time, which marks the cache as corrupt and prompts KDevelop to show the dialog on startup, then clear it. Then the cycle starts over again.

The good thing is that it seems to recreate (approximately 1 crash per hour), the bad thing is that there doesn't seem to be a specific pattern to to the crashes. The only odd thing I was able to see was a certain function having a lot of BOOST_PP_* code and uncode question marks in it's description instead of the doxygen string that I would have expected... Not sure how much that helps
Comment 6 Sven Brauch 2016-10-02 14:17:48 UTC
Maybe you can figure out what file it crashes on and give us the part of it that triggers the crash? That'd help a lot.
Comment 7 Afief Halumi 2016-10-03 15:45:37 UTC
Is there a way to tell which file KDevelop was processing when it crashes? As far as I understand it processes all my files in the background to support better code navigation, so if the background parser is causing the crash then I have no way of knowing which file is causing it...
Comment 8 Kevin Funk 2016-10-03 15:55:08 UTC
@Afief: Have a look at KDevelop's debug output in console. KDevelop usually prints the files it currently attempts to parse to console.
Comment 9 Sven Brauch 2016-10-03 15:56:29 UTC
Or go up in the stack with the debugger and print it, e.g. the top context is available almost everywhere and it has a url().
Comment 10 Afief Halumi 2016-10-03 19:08:35 UTC
@Kevin I don't recall there being a specific file, but I was a bit distracted by things in my own code when it happened, so I'll take another look after the new year's celebrations are over.

@Sven, don't I need the debug symbols in order to do this? The AppImage doesn't come with debug symbols so I know almost nothing other than the function names. Running bt full on all threads this is all the info I get: thread apply all backtrace full: https://paste.kde.org/prkjsppdh
Comment 11 Sven Brauch 2016-10-03 19:11:00 UTC
Ah, in that case try
export QT_LOGGING_RULES="kdevelop.plugins.clang.debug=true"
then you should see processed files.
Comment 12 Sven Brauch 2016-10-15 13:36:31 UTC
Setting state to NEEDSINFO because I don't think we can fix it with this information.
Comment 13 Andrew Crouthamel 2018-09-26 22:11:20 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days, the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please set the bug status as REPORTED so that the KDE team knows that the bug is ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 14 Andrew Crouthamel 2018-10-27 02:30:44 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 30 days. The bug is now closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!