Created attachment 166183 [details] Complete backtrace of all threads A KDevelop session with the kdevelop project open crashed once I squashed 26 last kdevelop commits into one via `git rebase -i`. The crash occurred in a KDevelop master version built 4 months ago (2023-10-17). Backtrace of the crashed thread (the complete backtrace is attached to the report): Application: KDevelop (kdevelop), signal: Segmentation fault [KCrash Handler] #4 KDevelop::QualifiedIdentifierPrivate<true>::hash (this=<optimized out>) at /home/Mint14_home/igor/Install/abs/kdevelop-git/src/kdevelop/kdevplatform/language/duchain/identifier.cpp:278 #5 KDevelop::QualifiedIdentifierItemRequest::QualifiedIdentifierItemRequest (identifier=..., this=0x7f8118e9ad20) at /home/Mint14_home/igor/Install/abs/kdevelop-git/src/kdevelop/kdevplatform/language/duchain/identifier.cpp:281 #6 KDevelop::QualifiedIdentifier::makeConstant (this=0x7f8118e9adc0) at /home/Mint14_home/igor/Install/abs/kdevelop-git/src/kdevelop/kdevplatform/language/duchain/identifier.cpp:1154 #7 KDevelop::QualifiedIdentifier::makeConstant (this=0x7f8118e9adc0) at /home/Mint14_home/igor/Install/abs/kdevelop-git/src/kdevelop/kdevplatform/language/duchain/identifier.cpp:1148 #8 0x00007f81b5b0345e in KDevelop::QualifiedIdentifier::index (this=0x7f8118e9adc0) at /home/Mint14_home/igor/Install/abs/kdevelop-git/src/kdevelop/kdevplatform/language/duchain/identifier.cpp:638 #9 0x00007f81b5b034a1 in KDevelop::IndexedQualifiedIdentifier::IndexedQualifiedIdentifier (this=0x7f8118e9adb4, id=<optimized out>) at /home/Mint14_home/igor/Install/abs/kdevelop-git/src/kdevelop/kdevplatform/language/duchain/identifier.cpp:1425 #10 0x00007f81b5b20004 in KDevelop::DeclarationId::declaration (this=this@entry=0x7f80a4d70b00, top=top@entry=0x0, instantiateIfRequired=instantiateIfRequired@entry=true) at /home/Mint14_home/igor/Install/abs/kdevelop-git/src/kdevelop/kdevplatform/language/duchain/declarationid.cpp:162 #11 0x00007f81b5ac32d9 in KDevelop::DUContext::Import::context (this=0x7f80a4d70af8, topContext=0x0, instantiateIfRequired=true) at /home/Mint14_home/igor/Install/abs/kdevelop-git/src/kdevelop/kdevplatform/language/duchain/ducontext.cpp:1669 #12 0x00007f81b5ae1300 in KDevelop::TopDUContextLocalPrivate::clearImportedContextsRecursively (this=0x7f80f88b6c80) at /home/Mint14_home/igor/Install/abs/kdevelop-git/src/kdevelop/kdevplatform/language/duchain/topducontext.cpp:161 #13 0x00007f8138a54148 in ClangHelpers::buildDUChain(void*, QMultiHash<void*, Import> const&, ParseSession const&, QFlags<KDevelop::TopDUContext::Feature>, QHash<void*, KDevelop::ReferencedTopDUContext>&, QHash<KDevelop::IndexedString, KDevelop::ModificationRevision> const&, KDevelop::IndexedString const&, ClangIndex*, std::function<bool ()> const&) (file=<optimized out>, imports=<optimized out>, session=..., features=..., includedFiles=<optimized out>, unsavedRevisions=..., parseDocument=..., index=0x55be2cd22230, abortFunction=...) at /home/Mint14_home/igor/Install/abs/kdevelop-git/src/kdevelop/plugins/clang/duchain/clanghelpers.cpp:179 #14 0x00007f8138a53ba4 in ClangHelpers::buildDUChain(void*, QMultiHash<void*, Import> const&, ParseSession const&, QFlags<KDevelop::TopDUContext::Feature>, QHash<void*, KDevelop::ReferencedTopDUContext>&, QHash<KDevelop::IndexedString, KDevelop::ModificationRevision> const&, KDevelop::IndexedString const&, ClangIndex*, std::function<bool ()> const&) (file=<optimized out>, imports=..., session=..., features=..., includedFiles=<optimized out>, unsavedRevisions=..., parseDocument=..., index=0x55be2cd22230, abortFunction=...) at /home/Mint14_home/igor/Install/abs/kdevelop-git/src/kdevelop/plugins/clang/duchain/clanghelpers.cpp:121 #15 0x00007f8138a53ba4 in ClangHelpers::buildDUChain(void*, QMultiHash<void*, Import> const&, ParseSession const&, QFlags<KDevelop::TopDUContext::Feature>, QHash<void*, KDevelop::ReferencedTopDUContext>&, QHash<KDevelop::IndexedString, KDevelop::ModificationRevision> const&, KDevelop::IndexedString const&, ClangIndex*, std::function<bool ()> const&) (file=<optimized out>, imports=..., session=..., features=..., features@entry=..., includedFiles=..., unsavedRevisions=..., parseDocument=..., index=0x55be2cd22230, abortFunction=...) at /home/Mint14_home/igor/Install/abs/kdevelop-git/src/kdevelop/plugins/clang/duchain/clanghelpers.cpp:121 #16 0x00007f8138aed243 in ClangParseJob::run (this=<optimized out>) at /home/Mint14_home/igor/Install/abs/kdevelop-git/src/kdevelop/plugins/clang/clangparsejob.cpp:322 #17 0x00007f81b43ef7cc in ThreadWeaver::IdDecorator::run(QSharedPointer<ThreadWeaver::JobInterface>, ThreadWeaver::Thread*) () at /usr/lib/libKF5ThreadWeaver.so.5 #18 0x00007f81b43ef5ae in ThreadWeaver::Executor::run(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () at /usr/lib/libKF5ThreadWeaver.so.5 #19 0x00007f81b43f04f6 in ThreadWeaver::Job::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () at /usr/lib/libKF5ThreadWeaver.so.5 #20 0x00007f81b43f3f02 in ThreadWeaver::Thread::run() () at /usr/lib/libKF5ThreadWeaver.so.5 #21 0x00007f81b7cf379a in ??? () at /usr/lib/libQt5Core.so.5 #22 0x00007f81b76a955a in ??? () at /usr/lib/libc.so.6 #23 0x00007f81b7726a3c in ??? () at /usr/lib/libc.so.6
A possibly relevant merge request was started @ https://invent.kde.org/kdevelop/kdevelop/-/merge_requests/535
Git commit 05878f92e82424df23a4e6e3c6a29883fbbedf4b by Igor Kushnir. Committed on 23/06/2024 at 09:02. Pushed by igorkushnir into branch 'master'. Remove useless [Indexed]QualifiedIdentifier conversions DeclarationId::declaration[s]() construct a QualifiedIdentifier from an IndexedQualifiedIdentifier and pass it to one of two functions. Each of the two functions takes a `const IndexedQualifiedIdentifier& id` parameter and assigns the `id` argument to a local variable before doing anything else. Eliminate the redundant explicit conversion from IndexedQualifiedIdentifier to QualifiedIdentifier and implicit conversion back. The only way this optimization can break something is if the local variable `QualifiedIdentifier id` keeps the IndexedQualifiedIdentifier valid somehow. But I do not think this is the case. For some reason, KDevelop segfaulted during the implicit conversion back from QualifiedIdentifier to IndexedQualifiedIdentifier in DeclarationId::declaration() as described in Bug 482001. Hopefully this optimization will eliminate the crash, or at least move elsewhere, facilitate understanding and fixing it. FIXED-IN: 5.15.240800 M +2 -2 kdevplatform/language/duchain/declarationid.cpp https://invent.kde.org/kdevelop/kdevelop/-/commit/05878f92e82424df23a4e6e3c6a29883fbbedf4b