Application: kdevelop (5.6.40) (Compiled from sources) Qt Version: 5.15.2 Frameworks Version: 5.83.0 Operating System: Linux 5.13.0-gentoo x86_64 Windowing System: X11 Drkonqi Version: 5.22.1 Distribution: Gentoo/Linux -- Information about the crash: - What I was doing when the application crashed: 1. Clone and open the CMake project (master branch) 2. Wait for parser to crash 3. Requesting for a help tooltip at almost any place in Source/cmFindPackageCommand.cxx also leads to a crash, whether the parsing is finished or not yet. The crash can be reproduced every time. -- Backtrace: Application: KDevelop (kdevelop), signal: Aborted [KCrash Handler] #4 0x00007fc50679820e in raise () at /lib64/libc.so.6 #5 0x00007fc506782536 in abort () at /lib64/libc.so.6 #6 0x00007fc5067d94b8 in __libc_message () at /lib64/libc.so.6 #7 0x00007fc5067e0eba in () at /lib64/libc.so.6 #8 0x00007fc5067e216b in _int_free () at /lib64/libc.so.6 #9 0x00007fc5067e5e74 in free () at /lib64/libc.so.6 #10 0x00007fc506e530b2 in QMetaType::destroy(int, void*) () at /usr/lib64/libQt5Core.so.5 #11 0x00007fc506e61c7e in QMetaCallEvent::~QMetaCallEvent() () at /usr/lib64/libQt5Core.so.5 #12 0x00007fc506e61cd9 in QMetaCallEvent::~QMetaCallEvent() () at /usr/lib64/libQt5Core.so.5 #13 0x00007fc506e3febc in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /usr/lib64/libQt5Core.so.5 #14 0x00007fc506e860c3 in postEventSourceDispatch(_GSource*, int (*)(void*), void*) () at /usr/lib64/libQt5Core.so.5 #15 0x00007fc5034c144b in g_main_context_dispatch () at /usr/lib64/libglib-2.0.so.0 #16 0x00007fc50351b108 in g_main_context_iterate.constprop () at /usr/lib64/libglib-2.0.so.0 #17 0x00007fc5034bb5df in g_main_context_iteration () at /usr/lib64/libglib-2.0.so.0 #18 0x00007fc506e8a328 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5 #19 0x00007fc506e379a3 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5 #20 0x00007fc506e42d90 in QCoreApplication::exec() () at /usr/lib64/libQt5Core.so.5 #21 0x0000562c76a444f1 in main () [Inferior 1 (process 1817371) detached] Possible duplicates by query: bug 439386, bug 439305, bug 438235, bug 437773, bug 437110. Reported using DrKonqi
that looks pretty odd as it doesn't hint at anything from kdevelop directly can you please try to reproduce this with valgrind and show the report here then?
Unfortunately, under Valgrind C++ parsing does not work at all: KDevelop can not find any include file even those from C++ stdlib. I see many messages from Valgring with the following content: Thread 1: status = VgTs_Runnable syscall 56 (lwpid 2096983) ==2096983== at 0x6818299: syscall (in /lib64/libc-2.33.so) ==2096983== by 0x613B4D3: QProcessPrivate::start(QFlags<QIODevice::OpenModeFlag>) (in /usr/lib64/libQt5Core.so.5.15.2) ==2096983== by 0x26F4953E: .LTHUNK0.lto_priv.1 (in /usr/lib64/qt5/plugins/kdevplatform/35/kdevdefinesandincludesmanager.so) ==2096983== by 0x26F40BE0: .LTHUNK3.lto_priv.0 (in /usr/lib64/qt5/plugins/kdevplatform/35/kdevdefinesandincludesmanager.so) ==2096983== by 0x26F2CF29: DefinesAndIncludesManager::defines(KDevelop::ProjectBaseItem*, KDevelop::IDefinesAndIncludesManager::Type) const (in /usr/lib64/qt5/plugins/kdevplatform/35/kdevdefinesandincludesmanager.so) ==2096983== by 0x27C98CC8: ClangParseJob::ClangParseJob(KDevelop::IndexedString const&, KDevelop::ILanguageSupport*) (in /usr/lib64/qt5/plugins/kdevplatform/35/kdevclangsupport.so) ==2096983== by 0x27C99DB5: non-virtual thunk to ClangSupport::createParseJob(KDevelop::IndexedString const&) (in /usr/lib64/qt5/plugins/kdevplatform/35/kdevclangsupport.so) ==2096983== by 0x6981E22: KDevelop::BackgroundParser::parseDocuments() (in /usr/lib64/libKDevPlatformLanguage.so.5.6.40) ==2096983== by 0x61CDEE5: QObject::event(QEvent*) (in /usr/lib64/libQt5Core.so.5.15.2) ==2096983== by 0x518D4CE: QApplicationPrivate::notify_helper(QObject*, QEvent*) (in /usr/lib64/libQt5Widgets.so.5.15.2) ==2096983== by 0x61AA417: QCoreApplication::notifyInternal2(QObject*, QEvent*) (in /usr/lib64/libQt5Core.so.5.15.2) ==2096983== by 0x61AAEB1: QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (in /usr/lib64/libQt5Core.so.5.15.2) ==2096983== by 0x61F10C2: postEventSourceDispatch(_GSource*, int (*)(void*), void*) (in /usr/lib64/libQt5Core.so.5.15.2) ==2096983== by 0x9B0244A: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.6800.3) ==2096983== by 0x9B5C107: g_main_context_iterate.constprop.0 (in /usr/lib64/libglib-2.0.so.0.6800.3) ==2096983== by 0x9AFC5DE: g_main_context_iteration (in /usr/lib64/libglib-2.0.so.0.6800.3) ==2096983== by 0x61F5327: QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (in /usr/lib64/libQt5Core.so.5.15.2) ==2096983== by 0x61A29A2: QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (in /usr/lib64/libQt5Core.so.5.15.2) ==2096983== by 0x61ADD8F: QCoreApplication::exec() (in /usr/lib64/libQt5Core.so.5.15.2) ==2096983== by 0x1144F0: main (in /usr/bin/kdevelop) client stack range: [0x1FFEFE1000 0x1FFF000FFF] client SP: 0x1FFEFFDC98 valgrind stack range: [0x10029AE000 0x1002AADFFF] top usage: 19456 of 1048576
Debug build does not seem to crash. In console output I see the following: kdevelop.plugins.definesandincludes: error while fetching defines for the compiler: "clang" ("-xc", "-std=c++17", "-dM", "-E", "-") "error: invalid argument '-std=c++17' not allowed with 'C'\n" kdevelop.plugins.definesandincludes: error while fetching includes for the compiler: "clang" "clang version 12.0.0\nTarget: x86_64-pc-linux-gnu\nThread model: posix\nInstalledDir: /usr/lib/llvm/12/bin\nSelected GCC installation: /usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0\nCandidate multilib: .;@m64\nCandidate multilib: 32;@m32\nSelected multilib: .;@m64\n (in-process)\n \"/usr/lib/llvm/12/bin/clang-12\" -cc1 -triple x86_64-pc-linux-gnu -E -disable-free -disable-llvm-verifier -discard-value-names -main-file-name - -mrelocation-model static -mframe-pointer=all -fmath-errno -fno-rounding-math -mconstructor-aliases -munwind-tables -target-cpu x86-64 -tune-cpu generic -fno-split-dwarf-inlining -debugger-tuning=gdb -v -resource-dir /usr/lib/llvm/12/bin/../../../../lib/clang/12.0.0 -internal-isystem /usr/local/include -internal-isystem /usr/lib/llvm/12/bin/../../../../lib/clang/12.0.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -std=gnu++17 -fdebug-compilation-dir /home/eugene/develop/alien/cmake/cbuild/debug -ferror-limit 19 -fgnuc-version=4.2.1 -o - -x c -\nerror: invalid argument '-std=gnu++17' not allowed with 'C'\n"
that warning is harmless, ignore it please. the valgrind report looks odd and totally unrelated. if it works in debug mode, I wonder what the hell is going on with your system I have to say :D as is I don't see a way for me to help you, this is all working here locally and without more information I cannot do anything - sorry
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 mark the bug 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!
Can not reproduce it anymore, probably after updating clang to 12.0.1 and recompiling KDevelop.
Unfortunately, the problem is back. Please see the stacktrace below (I will try with debug build of kdevelop-python too). The kdevelop-python is recompiled after kdevelop updates. Application: KDevelop (kdevelop), signal: Segmentation fault [KCrash Handler] #4 0x00007f197f39a41d in KDevelop::Declaration::ownIndex() const (this=0x7f1899c7e4a0) at /var/portage/tmp/portage/dev-util/kdevelop-9999/work/kdevelop-9999/kdevplatform/language/duchain/declaration.cpp:116 #5 0x00007f18f9e833de in Python::DeclarationBuilder::assignToAttribute(Python::AttributeAst*, Python::DeclarationBuilder::SourceType const&) () at /usr/lib64/libkdevpythonduchain.so #6 0x00007f18f9e83b7e in Python::DeclarationBuilder::visitAssignment(Python::AssignmentAst*) () at /usr/lib64/libkdevpythonduchain.so #7 0x00007f18f9e80ab1 in non-virtual thunk to Python::DeclarationBuilder::visitNode(Python::Ast*) () at /usr/lib64/libkdevpythonduchain.so #8 0x00007f1960053dbc in void Python::AstVisitor::visitNodeList<Python::Ast>(QList<Python::Ast*> const&) () at /usr/lib64/libkdevpythonparser.so #9 0x00007f18f9e80ab1 in non-virtual thunk to Python::DeclarationBuilder::visitNode(Python::Ast*) () at /usr/lib64/libkdevpythonduchain.so #10 0x00007f1960054025 in Python::AstDefaultVisitor::visitTry(Python::TryAst*) () at /usr/lib64/libkdevpythonparser.so #11 0x00007f18f9e80ab1 in non-virtual thunk to Python::DeclarationBuilder::visitNode(Python::Ast*) () at /usr/lib64/libkdevpythonduchain.so #12 0x00007f1960054475 in Python::AstDefaultVisitor::visitCode(Python::CodeAst*) () at /usr/lib64/libkdevpythonparser.so #13 0x00007f18f9e789c7 in Python::ContextBuilder::visitCode(Python::CodeAst*) () at /usr/lib64/libkdevpythonduchain.so #14 0x00007f18f9e80ab1 in non-virtual thunk to Python::DeclarationBuilder::visitNode(Python::Ast*) () at /usr/lib64/libkdevpythonduchain.so #15 0x00007f18f9e915bd in KDevelop::AbstractTypeBuilder<Python::Ast, Python::Identifier, Python::ContextBuilder>::supportBuild(Python::Ast*, KDevelop::DUContext*) () at /usr/lib64/libkdevpythonduchain.so #16 0x00007f18f9e7785c in KDevelop::AbstractContextBuilder<Python::Ast, Python::Identifier>::build(KDevelop::IndexedString const&, Python::Ast*, KDevelop::ReferencedTopDUContext const&) () at /usr/lib64/libkdevpythonduchain.so #17 0x00007f18f9e743a3 in Python::ContextBuilder::build(KDevelop::IndexedString const&, Python::Ast*, KDevelop::ReferencedTopDUContext const&) () at /usr/lib64/libkdevpythonduchain.so #18 0x00007f18f9e7c260 in Python::DeclarationBuilder::build(KDevelop::IndexedString const&, Python::Ast*, KDevelop::ReferencedTopDUContext const&) () at /usr/lib64/libkdevpythonduchain.so #19 0x00007f18f9f3a103 in Python::ParseJob::run(QSharedPointer<ThreadWeaver::JobInterface>, ThreadWeaver::Thread*) () at /usr/lib64/qt5/plugins/kdevplatform/35/kdevpythonlanguagesupport.so #20 0x00007f197cfbbf38 in ThreadWeaver::IdDecorator::run(QSharedPointer<ThreadWeaver::JobInterface>, ThreadWeaver::Thread*) () at /usr/lib64/libKF5ThreadWeaver.so.5 #21 0x00007f197cfbc9a7 in ThreadWeaver::Executor::run(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () at /usr/lib64/libKF5ThreadWeaver.so.5 #22 0x00007f197cfbb6d3 in ThreadWeaver::Job::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () at /usr/lib64/libKF5ThreadWeaver.so.5 #23 0x00007f197cfb9867 in ThreadWeaver::Thread::run() () at /usr/lib64/libKF5ThreadWeaver.so.5 #24 0x00007f19808295f9 in QThreadPrivate::start(void*) () at /usr/lib64/libQt5Core.so.5 #25 0x00007f197da0ccde in start_thread () at /lib64/libpthread.so.0 #26 0x00007f19803dd69f in clone () at /lib64/libc.so.6 Thread 9 (Thread 0x7f180e7bc640 (LWP 3583379) "Queue(0x56368e2"): #1 0x00007f19803ab933 in nanosleep () at /lib64/libc.so.6 #2 0x00007f1980821d95 in QThread::usleep(unsigned long) () at /usr/lib64/libQt5Core.so.5 #3 0x00007f197f3a4326 in KDevelop::DUChainLock::lockForWrite(unsigned int) (this=<optimized out>, timeout=0) at /var/portage/tmp/portage/dev-util/kdevelop-9999/work/kdevelop-9999/kdevplatform/language/duchain/duchainlock.cpp:170 #4 0x00007f197f3a449c in KDevelop::DUChainWriteLocker::lock() (this=this@entry=0x7f180e7b9da0) at /var/portage/tmp/portage/dev-util/kdevelop-9999/work/kdevelop-9999/kdevplatform/language/duchain/duchainlock.cpp:277 #5 0x00007f197f3a71b4 in KDevelop::DUChainWriteLocker::DUChainWriteLocker(KDevelop::DUChainLock*, unsigned int) (this=0x7f180e7b9da0, duChainLock=<optimized out>, timeout=0, this=<optimized out>, duChainLock=<optimized out>, timeout=<optimized out>) at /var/portage/tmp/portage/dev-util/kdevelop-9999/work/kdevelop-9999/kdevplatform/language/duchain/duchainlock.cpp:261 #6 0x00007f18f9e84ae5 in Python::DeclarationBuilder::addArgumentTypeHints(Python::CallAst*, KDevelop::DUChainPointer<KDevelop::Declaration>) () at /usr/lib64/libkdevpythonduchain.so #7 0x00007f18f9e85da8 in Python::DeclarationBuilder::visitCall(Python::CallAst*) () at /usr/lib64/libkdevpythonduchain.so #8 0x00007f18f9e80ab1 in non-virtual thunk to Python::DeclarationBuilder::visitNode(Python::Ast*) () at /usr/lib64/libkdevpythonduchain.so #9 0x00007f18f9e83a4c in Python::DeclarationBuilder::visitAssignment(Python::AssignmentAst*) () at /usr/lib64/libkdevpythonduchain.so #10 0x00007f18f9e80ab1 in non-virtual thunk to Python::DeclarationBuilder::visitNode(Python::Ast*) () at /usr/lib64/libkdevpythonduchain.so #11 0x00007f1960053dbc in void Python::AstVisitor::visitNodeList<Python::Ast>(QList<Python::Ast*> const&) () at /usr/lib64/libkdevpythonparser.so #12 0x00007f1960053f42 in Python::AstDefaultVisitor::visitIf(Python::IfAst*) () at /usr/lib64/libkdevpythonparser.so #13 0x00007f18f9e80ab1 in non-virtual thunk to Python::DeclarationBuilder::visitNode(Python::Ast*) () at /usr/lib64/libkdevpythonduchain.so #14 0x00007f18f9e79b40 in Python::ContextBuilder::visitFunctionBody(Python::FunctionDefinitionAst*) () at /usr/lib64/libkdevpythonduchain.so #15 0x00007f18f9e89ebf in Python::DeclarationBuilder::visitFunctionDefinition(Python::FunctionDefinitionAst*) () at /usr/lib64/libkdevpythonduchain.so #16 0x00007f18f9e80ab1 in non-virtual thunk to Python::DeclarationBuilder::visitNode(Python::Ast*) () at /usr/lib64/libkdevpythonduchain.so #17 0x00007f18f9e88728 in Python::DeclarationBuilder::visitClassDefinition(Python::ClassDefinitionAst*) () at /usr/lib64/libkdevpythonduchain.so #18 0x00007f18f9e80ab1 in non-virtual thunk to Python::DeclarationBuilder::visitNode(Python::Ast*) () at /usr/lib64/libkdevpythonduchain.so #19 0x00007f1960054475 in Python::AstDefaultVisitor::visitCode(Python::CodeAst*) () at /usr/lib64/libkdevpythonparser.so #20 0x00007f18f9e789c7 in Python::ContextBuilder::visitCode(Python::CodeAst*) () at /usr/lib64/libkdevpythonduchain.so #21 0x00007f18f9e80ab1 in non-virtual thunk to Python::DeclarationBuilder::visitNode(Python::Ast*) () at /usr/lib64/libkdevpythonduchain.so #22 0x00007f18f9e915bd in KDevelop::AbstractTypeBuilder<Python::Ast, Python::Identifier, Python::ContextBuilder>::supportBuild(Python::Ast*, KDevelop::DUContext*) () at /usr/lib64/libkdevpythonduchain.so #23 0x00007f18f9e7785c in KDevelop::AbstractContextBuilder<Python::Ast, Python::Identifier>::build(KDevelop::IndexedString const&, Python::Ast*, KDevelop::ReferencedTopDUContext const&) () at /usr/lib64/libkdevpythonduchain.so #24 0x00007f18f9e743a3 in Python::ContextBuilder::build(KDevelop::IndexedString const&, Python::Ast*, KDevelop::ReferencedTopDUContext const&) () at /usr/lib64/libkdevpythonduchain.so #25 0x00007f18f9e7c260 in Python::DeclarationBuilder::build(KDevelop::IndexedString const&, Python::Ast*, KDevelop::ReferencedTopDUContext const&) () at /usr/lib64/libkdevpythonduchain.so #26 0x00007f18f9e7c1f6 in Python::DeclarationBuilder::build(KDevelop::IndexedString const&, Python::Ast*, KDevelop::ReferencedTopDUContext const&) () at /usr/lib64/libkdevpythonduchain.so #27 0x00007f18f9f3a103 in Python::ParseJob::run(QSharedPointer<ThreadWeaver::JobInterface>, ThreadWeaver::Thread*) () at /usr/lib64/qt5/plugins/kdevplatform/35/kdevpythonlanguagesupport.so #28 0x00007f197cfbbf38 in ThreadWeaver::IdDecorator::run(QSharedPointer<ThreadWeaver::JobInterface>, ThreadWeaver::Thread*) () at /usr/lib64/libKF5ThreadWeaver.so.5 #29 0x00007f197cfbc9a7 in ThreadWeaver::Executor::run(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () at /usr/lib64/libKF5ThreadWeaver.so.5 #30 0x00007f197cfbb6d3 in ThreadWeaver::Job::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () at /usr/lib64/libKF5ThreadWeaver.so.5 #31 0x00007f197cfb9867 in ThreadWeaver::Thread::run() () at /usr/lib64/libKF5ThreadWeaver.so.5 #32 0x00007f19808295f9 in QThreadPrivate::start(void*) () at /usr/lib64/libQt5Core.so.5 #33 0x00007f197da0ccde in start_thread () at /lib64/libpthread.so.0 #34 0x00007f19803dd69f in clone () at /lib64/libc.so.6 Thread 8 (Thread 0x7f194c906640 (LWP 3583378) "Queue(0x56368e2"): #1 0x00007f19803ab933 in nanosleep () at /lib64/libc.so.6 #2 0x00007f1980821d95 in QThread::usleep(unsigned long) () at /usr/lib64/libQt5Core.so.5 #3 0x00007f197f3a4326 in KDevelop::DUChainLock::lockForWrite(unsigned int) (this=<optimized out>, timeout=0) at /var/portage/tmp/portage/dev-util/kdevelop-9999/work/kdevelop-9999/kdevplatform/language/duchain/duchainlock.cpp:170 #4 0x00007f197f3a449c in KDevelop::DUChainWriteLocker::lock() (this=this@entry=0x7f194c904760) at /var/portage/tmp/portage/dev-util/kdevelop-9999/work/kdevelop-9999/kdevplatform/language/duchain/duchainlock.cpp:277 #5 0x00007f197f3a71b4 in KDevelop::DUChainWriteLocker::DUChainWriteLocker(KDevelop::DUChainLock*, unsigned int) (this=this@entry=0x7f194c904760, duChainLock=duChainLock@entry=0x0, timeout=timeout@entry=0, this=<optimized out>, duChainLock=<optimized out>, timeout=<optimized out>) at /var/portage/tmp/portage/dev-util/kdevelop-9999/work/kdevelop-9999/kdevplatform/language/duchain/duchainlock.cpp:261 #6 0x00007f194d479e65 in (anonymous namespace)::Visitor::createDeclaration<(CXCursorKind)8, KDevelop::FunctionDeclaration> (context=0x7f18313a0d40, id=..., cursor=..., this=0x7f194c904f30) at /var/portage/tmp/portage/dev-util/kdevelop-9999/work/kdevelop-9999/plugins/clang/duchain/builder.cpp:474 #7 (anonymous namespace)::Visitor::buildDeclaration<(CXCursorKind)8, KDevelop::FunctionDeclaration, true>(CXCursor) (this=0x7f194c904f30, cursor=...) at /var/portage/tmp/portage/dev-util/kdevelop-9999/work/kdevelop-9999/plugins/clang/duchain/builder.cpp:1226 #8 0x00007f194d47a0b1 in (anonymous namespace)::Visitor::dispatchCursor<(CXCursorKind)8, (Decision)1, (Decision)1>(CXCursor, CXCursor) (this=<optimized out>, cursor=..., parent=...) at /var/portage/tmp/portage/dev-util/kdevelop-9999/work/kdevelop-9999/plugins/clang/duchain/builder.cpp:999 #9 0x00007f194d4644df in (anonymous namespace)::Visitor::dispatchCursor<(CXCursorKind)8>(CXCursor, CXCursor) (this=this@entry=0x7f194c904f30, cursor=..., parent=...) at /var/portage/tmp/portage/dev-util/kdevelop-9999/work/kdevelop-9999/plugins/clang/duchain/builder.cpp:975 #10 0x00007f194d47170a in (anonymous namespace)::visitCursor(CXCursor, CXCursor, CXClientData) (cursor=..., parent=..., data=0x7f194c904f30) at /var/portage/tmp/portage/dev-util/kdevelop-9999/work/kdevelop-9999/plugins/clang/duchain/builder.cpp:1571 #11 0x00007f1946617997 in clang::cxcursor::CursorVisitor::Visit(CXCursor, bool) () at /usr/lib/llvm/12/lib64/libclang.so.12 #12 0x00007f19466183dd in clang::cxcursor::CursorVisitor::handleDeclForVisitation(clang::Decl const*) () at /usr/lib/llvm/12/lib64/libclang.so.12 #13 0x00007f19466186e0 in clang::cxcursor::CursorVisitor::VisitDeclContext(clang::DeclContext*) () at /usr/lib/llvm/12/lib64/libclang.so.12 #14 0x00007f194661779a in clang::cxcursor::CursorVisitor::VisitChildren(CXCursor) () at /usr/lib/llvm/12/lib64/libclang.so.12 #15 0x00007f194661f4f0 in clang_visitChildren () at /usr/lib/llvm/12/lib64/libclang.so.12 #16 0x00007f194d47050e in (anonymous namespace)::Visitor::Visitor(CXTranslationUnit, CXFile, IncludeFileContexts const&, bool) (this=0x7f194c904f30, tu=<optimized out>, file=<optimized out>, includes=<optimized out>, update=<optimized out>, this=<optimized out>, tu=<optimized out>, file=<optimized out>, includes=<optimized out>, update=<optimized out>) at /var/portage/tmp/portage/dev-util/kdevelop-9999/work/kdevelop-9999/plugins/clang/duchain/builder.cpp:1486 #17 0x00007f194d470bd1 in Builder::visit(CXTranslationUnitImpl*, void*, QHash<void*, KDevelop::ReferencedTopDUContext> const&, bool) (tu=<optimized out>, file=<optimized out>, includes=<optimized out>, update=<optimized out>) at /var/portage/tmp/portage/dev-util/kdevelop-9999/work/kdevelop-9999/plugins/clang/duchain/builder.cpp:1633 #18 0x00007f194d4b3b3c 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=..., unsavedRevisions=..., parseDocument=..., index=0x56368f14b140, abortFunction=...) at /var/portage/tmp/portage/dev-util/kdevelop-9999/work/kdevelop-9999/plugins/clang/duchain/clanghelpers.cpp:221 #19 0x00007f194d4b3437 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=0x56368f14b140, abortFunction=...) at /var/portage/tmp/portage/dev-util/kdevelop-9999/work/kdevelop-9999/plugins/clang/duchain/clanghelpers.cpp:135 #20 0x00007f194d55c1ac in ClangParseJob::run(QSharedPointer<ThreadWeaver::JobInterface>, ThreadWeaver::Thread*) (this=0x56369adbfc40) at /var/portage/tmp/portage/dev-util/kdevelop-9999/work/kdevelop-9999/plugins/clang/clangparsejob.cpp:341 #21 0x00007f197cfbbf38 in ThreadWeaver::IdDecorator::run(QSharedPointer<ThreadWeaver::JobInterface>, ThreadWeaver::Thread*) () at /usr/lib64/libKF5ThreadWeaver.so.5 #22 0x00007f197cfbc9a7 in ThreadWeaver::Executor::run(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () at /usr/lib64/libKF5ThreadWeaver.so.5 #23 0x00007f197cfbb6d3 in ThreadWeaver::Job::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () at /usr/lib64/libKF5ThreadWeaver.so.5 #24 0x00007f197cfb9867 in ThreadWeaver::Thread::run() () at /usr/lib64/libKF5ThreadWeaver.so.5 #25 0x00007f19808295f9 in QThreadPrivate::start(void*) () at /usr/lib64/libQt5Core.so.5 #26 0x00007f197da0ccde in start_thread () at /lib64/libpthread.so.0 #27 0x00007f19803dd69f in clone () at /lib64/libc.so.6 Thread 7 (Thread 0x7f19451a8640 (LWP 3583148) "QQuickXmlQueryE"): #1 0x00007f197d0890a7 in g_main_context_iterate.constprop () at /usr/lib64/libglib-2.0.so.0 #2 0x00007f197d0295df in g_main_context_iteration () at /usr/lib64/libglib-2.0.so.0 #3 0x00007f1980a0f39e in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5 #4 0x00007f19809bc9a3 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5 #5 0x00007f198082975e in QThread::exec() () at /usr/lib64/libQt5Core.so.5 #6 0x00007f1945e9fbe5 in QQuickXmlQueryEngine::run() () at /usr/lib64/qt5/qml/QtQuick/XmlListModel/libqmlxmllistmodelplugin.so #7 0x00007f19808295f9 in QThreadPrivate::start(void*) () at /usr/lib64/libQt5Core.so.5 #8 0x00007f197da0ccde in start_thread () at /lib64/libpthread.so.0 #9 0x00007f19803dd69f in clone () at /lib64/libc.so.6 Thread 6 (Thread 0x7f194d3c5640 (LWP 3582489) "KDevelop::Compl"): #1 0x00007f197d02dd61 in g_main_context_prepare () at /usr/lib64/libglib-2.0.so.0 #2 0x00007f197d088fcb in g_main_context_iterate.constprop () at /usr/lib64/libglib-2.0.so.0 #3 0x00007f197d0295df in g_main_context_iteration () at /usr/lib64/libglib-2.0.so.0 #4 0x00007f1980a0f39e in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5 #5 0x00007f19809bc9a3 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5 #6 0x00007f198082975e in QThread::exec() () at /usr/lib64/libQt5Core.so.5 #7 0x00007f197f430ad9 in KDevelop::CompletionWorkerThread::run() (this=0x56368f154da0) at /var/portage/tmp/portage/dev-util/kdevelop-9999/work/kdevelop-9999/kdevplatform/language/codecompletion/codecompletionmodel.cpp:88 #8 0x00007f19808295f9 in QThreadPrivate::start(void*) () at /usr/lib64/libQt5Core.so.5 #9 0x00007f197da0ccde in start_thread () at /lib64/libpthread.so.0 #10 0x00007f19803dd69f in clone () at /lib64/libc.so.6 Thread 5 (Thread 0x7f194effd640 (LWP 3582446) "QQmlThread"): #1 0x00007f197d0890a7 in g_main_context_iterate.constprop () at /usr/lib64/libglib-2.0.so.0 #2 0x00007f197d0295df in g_main_context_iteration () at /usr/lib64/libglib-2.0.so.0 #3 0x00007f1980a0f39e in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5 #4 0x00007f19809bc9a3 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5 #5 0x00007f198082975e in QThread::exec() () at /usr/lib64/libQt5Core.so.5 #6 0x00007f197dff9f48 in QQmlThreadPrivate::run() () at /usr/lib64/libQt5Qml.so.5 #7 0x00007f19808295f9 in QThreadPrivate::start(void*) () at /usr/lib64/libQt5Core.so.5 #8 0x00007f197da0ccde in start_thread () at /lib64/libpthread.so.0 #9 0x00007f19803dd69f in clone () at /lib64/libc.so.6 Thread 4 (Thread 0x7f1955294640 (LWP 3582436) "Qt bearer threa"): #1 0x00007f197d0890a7 in g_main_context_iterate.constprop () at /usr/lib64/libglib-2.0.so.0 #2 0x00007f197d0295df in g_main_context_iteration () at /usr/lib64/libglib-2.0.so.0 #3 0x00007f1980a0f39e in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5 #4 0x00007f19809bc9a3 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5 #5 0x00007f198082975e in QThread::exec() () at /usr/lib64/libQt5Core.so.5 #6 0x00007f19808295f9 in QThreadPrivate::start(void*) () at /usr/lib64/libQt5Core.so.5 #7 0x00007f197da0ccde in start_thread () at /lib64/libpthread.so.0 #8 0x00007f19803dd69f in clone () at /lib64/libc.so.6 Thread 3 (Thread 0x7f19628eb640 (LWP 3582424) "QDBusConnection"): #1 0x00007f197d0890a7 in g_main_context_iterate.constprop () at /usr/lib64/libglib-2.0.so.0 #2 0x00007f197d0295df in g_main_context_iteration () at /usr/lib64/libglib-2.0.so.0 #3 0x00007f1980a0f39e in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5 #4 0x00007f19809bc9a3 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5 #5 0x00007f198082975e in QThread::exec() () at /usr/lib64/libQt5Core.so.5 #6 0x00007f198141bdd4 in QDBusConnectionManager::run() () at /usr/lib64/libQt5DBus.so.5 #7 0x00007f19808295f9 in QThreadPrivate::start(void*) () at /usr/lib64/libQt5Core.so.5 #8 0x00007f197da0ccde in start_thread () at /lib64/libpthread.so.0 #9 0x00007f19803dd69f in clone () at /lib64/libc.so.6 Thread 2 (Thread 0x7f1969437640 (LWP 3582423) "kdevelo:disk$0"): #1 0x00007f197da12c1f in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0 #2 0x00007f19697b2d5b in util_queue_thread_func () at /usr/lib64/dri/i965_dri.so #3 0x00007f19697b2a27 in impl_thrd_routine () at /usr/lib64/dri/i965_dri.so #4 0x00007f197da0ccde in start_thread () at /lib64/libpthread.so.0 #5 0x00007f19803dd69f in clone () at /lib64/libc.so.6 Thread 1 (Thread 0x7f196c3cf100 (LWP 3582421) "kdevelop"): #1 0x00007f19803685d0 in _int_free () at /lib64/libc.so.6 #2 0x00007f198036be74 in free () at /lib64/libc.so.6 #3 0x00007f19604593a1 in free_utf_tbl() () at /usr/lib64/libhunspell-1.7.so.0 #4 0x00007f196046df18 in HunspellImpl::~HunspellImpl() () at /usr/lib64/libhunspell-1.7.so.0 #5 0x00007f196046f131 in Hunspell::~Hunspell() () at /usr/lib64/libhunspell-1.7.so.0 #6 0x00007f196209ebe5 in HunspellDict::~HunspellDict() () at /usr/lib64/qt5/plugins/kf5/sonnet/sonnet_hunspell.so #7 0x00007f1974b455dd in QSharedPointer<Sonnet::SpellerPlugin>::deref(QtSharedPointer::ExternalRefCountData*) [clone .part.0] [clone .lto_priv.2] [clone .lto_priv.0] () at /usr/lib64/libKF5SonnetCore.so.5 #8 0x00007f1974b45612 in QHash<QString, QSharedPointer<Sonnet::SpellerPlugin> >::deleteNode2(QHashData::Node*) () at /usr/lib64/libKF5SonnetCore.so.5 #9 0x00007f1980860f8c in QHashData::free_helper(void (*)(QHashData::Node*)) () at /usr/lib64/libQt5Core.so.5 #10 0x00007f1974b45f00 in Sonnet::Loader::~Loader() () at /usr/lib64/libKF5SonnetCore.so.5 #11 0x00007f1974b45f39 in Sonnet::(anonymous namespace)::Q_QGS_s_loader::innerFunction()::Holder::~Holder() () at /usr/lib64/libKF5SonnetCore.so.5 #12 0x00007f19803208b3 in __run_exit_handlers () at /lib64/libc.so.6 #13 0x00007f1980320a5a in () at /lib64/libc.so.6 #14 0x00007f196b86b108 in QXcbIntegration::createPlatformOpenGLContext(QOpenGLContext*) const [clone .cold] () at /usr/lib64/libQt5XcbQpa.so.5 #15 0x00007f196b89c683 in xcbSourceDispatch(_GSource*, int (*)(void*), void*) [clone .lto_priv.0] () at /usr/lib64/libQt5XcbQpa.so.5 #16 0x00007f197d02f44b in g_main_context_dispatch () at /usr/lib64/libglib-2.0.so.0 #17 0x00007f197d089108 in g_main_context_iterate.constprop () at /usr/lib64/libglib-2.0.so.0 #18 0x00007f197d0295df in g_main_context_iteration () at /usr/lib64/libglib-2.0.so.0 #19 0x00007f1980a0f39e in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5 #20 0x00007f19809bc9a3 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5 #21 0x00007f19809c7d90 in QCoreApplication::exec() () at /usr/lib64/libQt5Core.so.5 #22 0x0000563689226460 in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at /var/portage/tmp/portage/dev-util/kdevelop-9999/work/kdevelop-9999/app/main.cpp:855 [Inferior 1 (process 3582421) detached]
This stacktrace is completely different from both things you have posted before. Did you clear KDevelop's cache after recompiling things?
Yes, and sometimes when it asks for it after a crash too. Can't say either choice (to clean or not to clean) is more likely leads to a crash.
Debug build crashes as well with the same backtrace as in the OP. 1. rm -fr ~/.cache/kdevduchain 2. open the cmake project and wait It crashes and at that moment the parsing progress shows "Tests/RunCMake/Syntax/NullTerminatedArgument.cmake"
Removing "0"s from that file allows KDevelop to finish project parsing without crashing.
Got back to this after some time. Seems like KDevelop's CMake parser can't handle strings with 0 bytes inside. Specifically, creating the CMake console project from the template and appending contents of Tests/RunCMake/Syntax/NullTerminatedArgument.cmake file from the CMake project to the CMakeLists.txt make KDevelop crash on it either during project loading or upon opening the file. Valgrind says: ==800842== Invalid read of size 1 ==800842== at 0x624870A: QUtf8::convertToUnicode(char const*, int, QTextCodec::ConverterState*) (in /usr/lib64/libQt5Core.so.5.15.3) ==800842== by 0x6248D55: QUtf8Codec::convertToUnicode(char const*, int, QTextCodec::ConverterState*) const (in /usr/lib64/libQt5Core.so.5.15.3) ==800842== by 0x60D1963: QString::fromLocal8Bit_helper(char const*, int) (in /usr/lib64/libQt5Core.so.5.15.3) ==800842== by 0x3A15398F: fromLocal8Bit (qstring.h:710) ==800842== by 0x3A15398F: CMakeListsParser::readCMakeFunction(cmListFileLexer_s*, CMakeFunctionDesc&) (cmakelistsparser.cpp:180) ==800842== by 0x3A1540CE: CMakeListsParser::readCMakeFile(QString const&) (cmakelistsparser.cpp:126) ==800842== by 0x3A1DEE17: CMakeParseJob::run(QSharedPointer<ThreadWeaver::JobInterface>, ThreadWeaver::Thread*) (cmakeparsejob.cpp:84) ==800842== by 0x9C9E557: ThreadWeaver::IdDecorator::run(QSharedPointer<ThreadWeaver::JobInterface>, ThreadWeaver::Thread*) (in /usr/lib64/libKF5ThreadWeaver.so.5.92.0) ==800842== by 0x9C9E366: ThreadWeaver::Executor::run(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) (in /usr/lib64/libKF5ThreadWeaver.so.5.92.0) ==800842== by 0x9C9F232: ThreadWeaver::Job::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) (in /usr/lib64/libKF5ThreadWeaver.so.5.92.0) ==800842== by 0x9CA5A36: ThreadWeaver::Thread::run() (in /usr/lib64/libKF5ThreadWeaver.so.5.92.0) ==800842== by 0x605891B: QThreadPrivate::start(void*) (in /usr/lib64/libQt5Core.so.5.15.3) ==800842== by 0x67F9019: start_thread (in /lib64/libc.so.6) ==800842== Address 0x508a1ff2 is 13 bytes after a block of size 5 alloc'd ==800842== at 0x48447E5: malloc (vg_replace_malloc.c:381) ==800842== by 0x680B2CA: strdup (in /lib64/libc.so.6) ==800842== by 0x3A15145B: cmListFileLexerSetToken (cmListFileLexer.in.l:290) ==800842== by 0x3A15260A: cmListFileLexer_yylex (cmListFileLexer.in.l:185) ==800842== by 0x3A152C7E: cmListFileLexer_Scan (cmListFileLexer.in.l:507) ==800842== by 0x3A1536EA: CMakeListsParser::readCMakeFunction(cmListFileLexer_s*, CMakeFunctionDesc&) (cmakelistsparser.cpp:158) ==800842== by 0x3A1540CE: CMakeListsParser::readCMakeFile(QString const&) (cmakelistsparser.cpp:126) ==800842== by 0x3A1DEE17: CMakeParseJob::run(QSharedPointer<ThreadWeaver::JobInterface>, ThreadWeaver::Thread*) (cmakeparsejob.cpp:84) ==800842== by 0x9C9E557: ThreadWeaver::IdDecorator::run(QSharedPointer<ThreadWeaver::JobInterface>, ThreadWeaver::Thread*) (in /usr/lib64/libKF5ThreadWeaver.so.5.92.0) ==800842== by 0x9C9E366: ThreadWeaver::Executor::run(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) (in /usr/lib64/libKF5ThreadWeaver.so.5.92.0) ==800842== by 0x9C9F232: ThreadWeaver::Job::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) (in /usr/lib64/libKF5ThreadWeaver.so.5.92.0) ==800842== by 0x9CA5A36: ThreadWeaver::Thread::run() (in /usr/lib64/libKF5ThreadWeaver.so.5.92.0) Debug build crashes under GDB after clearing duchain cache with the following stacktrace: #0 0x00007ffff5f36d1c in __pthread_kill_implementation () at /lib64/libc.so.6 #1 0x00007ffff5eeb6a2 in raise () at /lib64/libc.so.6 #2 0x00007ffff5ed6469 in abort () at /lib64/libc.so.6 #3 0x00007ffff5f2b278 in __libc_message () at /lib64/libc.so.6 #4 0x00007ffff5f407fa in () at /lib64/libc.so.6 #5 0x00007ffff5f423e5 in _int_free () at /lib64/libc.so.6 #6 0x00007ffff5f44edf in free () at /lib64/libc.so.6 #7 0x00007ffff645c2a7 in QHashData::free_helper(void (*)(QHashData::Node*)) () at /usr/lib64/libQt5Core.so.5 #8 0x00007fffc0a50e0b in QHash<KDevelop::DUChainBase*, QHashDummyValue>::freeData(QHashData*) (this=this@entry=0x7fff7a7fb110, x=<optimized out>) at /usr/include/qt5/QtCore/qhash.h:619 #9 0x00007fffc0a50aea in QHash<KDevelop::DUChainBase*, QHashDummyValue>::~QHash() (this=0x7fff7a7fb110, __in_chrg=<optimized out>) at /usr/include/qt5/QtCore/qhash.h:250 #10 QSet<KDevelop::DUChainBase*>::~QSet() (this=0x7fff7a7fb110, __in_chrg=<optimized out>) at /usr/include/qt5/QtCore/qset.h:53 #11 KDevelop::AbstractContextBuilder<QVectorIterator<CMakeFunctionDesc>, CMakeFunctionDesc>::~AbstractContextBuilder() (this=0x7fff7a7fb040, __in_chrg=<optimized out>) at /usr/src/debug/dev-util/kdevelop-9999/kdevelop-9999/kdevplatform/language/duchain/builders/abstractcontextbuilder.h:51 #12 ContextBuilder::~ContextBuilder() (this=0x7fff7a7fb040, __in_chrg=<optimized out>) at /usr/src/debug/dev-util/kdevelop-9999/kdevelop-9999/plugins/cmake/duchain/contextbuilder.h:15 #13 KDevelop::AbstractDeclarationBuilder<QVectorIterator<CMakeFunctionDesc>, CMakeFunctionDesc, ContextBuilder>::~AbstractDeclarationBuilder() (this=0x7fff7a7fb040, __in_chrg=<optimized out>) at /usr/src/debug/dev-util/kdevelop-9999/kdevelop-9999/kdevplatform/language/duchain/builders/abstractdeclarationbuilder.h:24 #14 DeclarationBuilder::~DeclarationBuilder() (this=0x7fff7a7fb040, __in_chrg=<optimized out>) at /usr/src/debug/dev-util/kdevelop-9999/kdevelop-9999/plugins/cmake/duchain/declarationbuilder.h:17 #15 CMakeParseJob::run(QSharedPointer<ThreadWeaver::JobInterface>, ThreadWeaver::Thread*) (this=0x55555c9797f0) at /usr/src/debug/dev-util/kdevelop-9999/kdevelop-9999/plugins/cmake/duchain/cmakeparsejob.cpp:108 #16 0x00007ffff2b7d558 in ThreadWeaver::IdDecorator::run(QSharedPointer<ThreadWeaver::JobInterface>, ThreadWeaver::Thread*) () at /usr/lib64/libKF5ThreadWeaver.so.5 #17 0x00007ffff2b7d367 in ThreadWeaver::Executor::run(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () at /usr/lib64/libKF5ThreadWeaver.so.5 #18 0x00007ffff2b7e233 in ThreadWeaver::Job::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () at /usr/lib64/libKF5ThreadWeaver.so.5 #19 0x00007ffff2b84a37 in ThreadWeaver::Thread::run() () at /usr/lib64/libKF5ThreadWeaver.so.5 #20 0x00007ffff642491c in QThreadPrivate::start(void*) () at /usr/lib64/libQt5Core.so.5 #21 0x00007ffff5f3501a in start_thread () at /lib64/libc.so.6 #22 0x00007ffff5fb7f1c in clone3 () at /lib64/libc.so
I got one more stack trace causing a sistematic crash on cmake project parsing: 1 ?? 0x555555c96a20 2 cleanupTestSuites cmakemanager.cpp 483 0x7fffa0f2a91d 3 CMakeManager::integrateData cmakemanager.cpp 535 0x7fffa0f2ba44 4 ChooseCMakeInterfaceJob::fileImportDone cmakemanager.cpp 223 0x7fffa0f30984 5 QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<CMakeProjectData const&>, void, void (ChooseCMakeInterfaceJob:: *)(CMakeProjectData const&)>::call qobjectdefs_impl.h 152 0x7fffa0f39964 6 QtPrivate::FunctionPointer<void (ChooseCMakeInterfaceJob:: *)(CMakeProjectData const&)>::call<QtPrivate::List<CMakeProjectData const&>, void> qobjectdefs_impl.h 185 0x7fffa0f38997 7 QtPrivate::QSlotObject<void (ChooseCMakeInterfaceJob:: *)(CMakeProjectData const&), QtPrivate::List<CMakeProjectData const&>, void>::impl qobjectdefs_impl.h 418 0x7fffa0f36ff9 8 ?? 0x7ffff3427341 9 CMake::FileApi::ImportJob::dataAvailable moc_cmakefileapiimportjob.cpp 134 0x7fffa0f060e8 10 operator() cmakefileapiimportjob.cpp 31 0x7fffa0f25bae 11 QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, CMake::FileApi::ImportJob::ImportJob(KDevelop::IProject *, QObject *)::<lambda()>>::call(struct {...} &, void * *) qobjectdefs_impl.h 146 0x7fffa0f263a1 12 QtPrivate::Functor<CMake::FileApi::ImportJob::ImportJob(KDevelop::IProject *, QObject *)::<lambda()>, 0>::call<QtPrivate::List<>, void>(struct {...} &, void *, void * *) qobjectdefs_impl.h 256 0x7fffa0f26373 13 QtPrivate::QFunctorSlotObject<CMake::FileApi::ImportJob::ImportJob(KDevelop::IProject *, QObject *)::<lambda()>, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void * *, bool *) qobjectdefs_impl.h 443 0x7fffa0f26342 14 ?? 0x7ffff3427341 15 QFutureWatcherBase::event(QEvent *) 0x7ffff3257a0d 16 QApplicationPrivate::notify_helper(QObject *, QEvent *) 0x7ffff421db3c 17 QCoreApplication::notifyInternal2(QObject *, QEvent *) 0x7ffff33f6ad8 18 QCoreApplicationPrivate::sendPostedEvents(QObject *, int, QThreadData *) 0x7ffff33f75e3 19 ?? 0x7ffff343d548 20 g_main_context_dispatch 0x7ffff1489c6b 21 ?? 0x7ffff14e0001 22 g_main_context_iteration 0x7ffff1487392 23 QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) 0x7ffff344132c 24 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) 0x7ffff33ef27c 25 QCoreApplication::exec() 0x7ffff33f9da9 26 main main.cpp 846 0x555555567c36
NOTE: the above stack trace was caused by a duplicated add_test() cmake command, located in two different CMakeLists.txt. After the duplication was removed, the crash is no more occuring.
(In reply to Gabriele Menna from comment #14) > NOTE: the above stack trace was caused by a duplicated add_test() cmake > command, located in two different CMakeLists.txt. > After the duplication was removed, the crash is no more occuring. Unrelated to this bug report. Possibly related to Bug 455533.
I agree. The test case attached to Bug 455533 features duplicated test_case, as in the project causing the crash on my setup. Only, the crash is totally reproducible, contrary to what stated in the related bug report.
(In reply to Eugene Shalygin from comment #12) > Got back to this after some time. Seems like KDevelop's CMake parser can't > handle strings with 0 bytes inside. Specifically, creating the CMake console > project from the template and appending contents of > Tests/RunCMake/Syntax/NullTerminatedArgument.cmake file from the CMake > project to the CMakeLists.txt make KDevelop crash on it either during > project loading or upon opening the file. > > Valgrind says: > ... > ==800842== by 0x3A15398F: fromLocal8Bit (qstring.h:710) > ==800842== by 0x3A15398F: > CMakeListsParser::readCMakeFunction(cmListFileLexer_s*, CMakeFunctionDesc&) > (cmakelistsparser.cpp:180) > ==800842== by 0x3A1540CE: CMakeListsParser::readCMakeFile(QString const&) > (cmakelistsparser.cpp:126) > ==800842== by 0x3A1DEE17: > CMakeParseJob::run(QSharedPointer<ThreadWeaver::JobInterface>, > ThreadWeaver::Thread*) (cmakeparsejob.cpp:84) The line in KDevelop code where the crash occurs (cmakelistsparser.cpp:180): func.arguments << CMakeFunctionArgument( QString::fromLocal8Bit(token->text, token->length), false, token->line, token->column ); token->text has type char*, that is a null-terminated string, which by definition cannot contain null characters in the middle. The token comes from cmListFileLexer_Scan(), which is located in kdevelop/plugins/cmake/parser/cmListFileLexer.c. This file was copied from CMake source code and modified. The cmListFileLexer_Token struct is still returned from cmListFileLexer_Scan() (https://gitlab.kitware.com/cmake/cmake/-/blob/master/Source/LexerParser/cmListFileLexer.c#L2788), and this struct still contains char* text (https://gitlab.kitware.com/cmake/cmake/-/blob/master/Source/cmListFileLexer.h#L28). Perhaps this internal CMake library does not support null characters in source files. Or KDevelop uses it incorrectly.
(In reply to Igor Kushnir from comment #17) > The line in KDevelop code where the crash occurs (cmakelistsparser.cpp:180): > func.arguments << CMakeFunctionArgument( > QString::fromLocal8Bit(token->text, token->length), false, token->line, > token->column ); > > token->text has type char*, that is a null-terminated string, which by > definition cannot contain null characters in the middle. Sorry, my mistake: token->length contains the size of the string, so this code looks OK. But there could still be a bug in the upstream CMake code embedded in KDevelop or in the way it was modified to integrate with Qt. Perhaps updating it to the current version would fix null-terminated string support.