| Summary: | Kdevelop crashes when parsing starts [clang::Decl::setInvalidDecl] | ||
|---|---|---|---|
| Product: | [Applications] kdevelop | Reporter: | Guillaume Racicot <gufideg> |
| Component: | Language Support: CPP (Clang-based) | Assignee: | kdevelop-bugs-null |
| Status: | RESOLVED WORKSFORME | ||
| Severity: | crash | CC: | fredrik.haikarainen, mail, markus, nasus.maximos, rfernandes |
| Priority: | NOR | Keywords: | drkonqi |
| Version First Reported In: | 5.2.3 | ||
| Target Milestone: | --- | ||
| Platform: | Compiled Sources | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: |
New crash information added by DrKonqi
gdb backtrace full New crash information added by DrKonqi |
||
|
Description
Guillaume Racicot
2018-08-01 06:43:31 UTC
I tried opening the project in QtCreator, and it cannot parse the project correctly. I get in the console "Clang Code Model: Error: The clangbackend process has finished unexpectedly and was restarted." So it seems to be an error in the clang library. But instead of outputting an error like QtCreator, kdevelop crashes. Yeah, because KDevelop runs clang in-process. Created attachment 114505 [details] New crash information added by DrKonqi kdevelop (5.2.3) using Qt 5.11.1 - What I was doing when the application crashed: Importing a CMakeLists clone of https://gitlab.com/swirlycloud/swirly-cpp -- Backtrace (Reduced): #6 0x00007f50881d2450 in clang::Decl::setInvalidDecl(bool) () at /usr/lib/../lib/libclangAST.so.6 #7 0x00007f50881d249c in clang::Decl::setInvalidDecl(bool) () at /usr/lib/../lib/libclangAST.so.6 #8 0x00007f5081284bc8 in clang::ASTDeclReader::VisitDecl(clang::Decl*) () at /usr/lib/../lib/../lib/libclangSerialization.so.6 #9 0x00007f5081285482 in clang::ASTDeclReader::VisitNamedDecl(clang::NamedDecl*) () at /usr/lib/../lib/../lib/libclangSerialization.so.6 #10 0x00007f5081285982 in clang::ASTDeclReader::VisitValueDecl(clang::ValueDecl*) () at /usr/lib/../lib/../lib/libclangSerialization.so.6 Created attachment 114547 [details]
gdb backtrace full
I can reproduce it with debug symbols of clang. Feel free to ask me everything.
Created attachment 115046 [details]
New crash information added by DrKonqi
kdevelop (5.2.4) using Qt 5.11.1
- What I was doing when the application crashed:
After having issues with the parser not working correctly, I attempted to clear the cache and restart KDevelop. Reparsing of the project then commenced, and after a while it crashes. Sometimes instantly, sometimes after some parsing progress. Happens 7/7 times.
- Unusual behavior I noticed:
Before this happened, KDevelop crashed once or twice. Clearing the cache did the trick then, but it no longer works. Also, the parser has been working very badly. It doesn't recognize most header files, even though include paths are set for the project. It also misidentifies some classes as being part of the "std::"-namespace for the headers that are recognized. So if I for example declare `class Foo` in Foo.hpp, then I will get parser errors on usages of this class that suggest that I change them to std::Foo instead, (message says: did you mean std::Foo? Solutions: include Foo.hpp)
- Custom settings of the application:
Session has 3 projects. All are configured with regular makefiles, and uses gcc with the C++17 standard for compilation. The parser uses clang with the -std=c++17 flag. One of the projects also uses libclang as a dependency for static code generation.
All KDE applications are installed via official Arch Linux repository.
-- Backtrace (Reduced):
#6 0x00007fea5f993450 in clang::Decl::setInvalidDecl(bool) () at /usr/lib/../lib/libclangAST.so.6
#7 0x00007fea5f99349c in clang::Decl::setInvalidDecl(bool) () at /usr/lib/../lib/libclangAST.so.6
#8 0x00007fea58dddbc8 in clang::ASTDeclReader::VisitDecl(clang::Decl*) () at /usr/lib/../lib/../lib/libclangSerialization.so.6
#9 0x00007fea58dde482 in clang::ASTDeclReader::VisitNamedDecl(clang::NamedDecl*) () at /usr/lib/../lib/../lib/libclangSerialization.so.6
#10 0x00007fea58dde982 in clang::ASTDeclReader::VisitValueDecl(clang::ValueDecl*) () at /usr/lib/../lib/../lib/libclangSerialization.so.6
The crash still happens with clang 7. The backtrace when opening my project is similar:
#0 0x00007fffb27107b0 in clang::Decl::setInvalidDecl(bool) () at /usr/lib/../lib/libclangAST.so.7
#1 0x00007fffb27107fc in clang::Decl::setInvalidDecl(bool) () at /usr/lib/../lib/libclangAST.so.7
#2 0x00007fffb10e9c18 in clang::ASTDeclReader::VisitDecl(clang::Decl*) () at /usr/lib/../lib/../lib/libclangSerialization.so.7
#3 0x00007fffb10ea4e2 in clang::ASTDeclReader::VisitNamedDecl(clang::NamedDecl*) () at /usr/lib/../lib/../lib/libclangSerialization.so.7
#4 0x00007fffb10eaa02 in clang::ASTDeclReader::VisitValueDecl(clang::ValueDecl*) () at /usr/lib/../lib/../lib/libclangSerialization.so.7
#5 0x00007fffb10eaa96 in clang::ASTDeclReader::VisitDeclaratorDecl(clang::DeclaratorDecl*) () at /usr/lib/../lib/../lib/libclangSerialization.so.7
#6 0x00007fffb10f913e in clang::ASTDeclReader::VisitVarDeclImpl(clang::VarDecl*) () at /usr/lib/../lib/../lib/libclangSerialization.so.7
#7 0x00007fffb10fa044 in clang::ASTDeclReader::VisitDecompositionDecl(clang::DecompositionDecl*) () at /usr/lib/../lib/../lib/libclangSerialization.so.7
#8 0x00007fffb1100346 in clang::ASTDeclReader::Visit(clang::Decl*) () at /usr/lib/../lib/../lib/libclangSerialization.so.7
#9 0x00007fffb1100ae0 in clang::ASTReader::ReadDeclRecord(unsigned int) () at /usr/lib/../lib/../lib/libclangSerialization.so.7
#10 0x00007fffb10b75a6 in clang::ASTReader::GetDecl(unsigned int) () at /usr/lib/../lib/../lib/libclangSerialization.so.7
#11 0x00007fffb1102563 in clang::ASTStmtReader::VisitDeclStmt(clang::DeclStmt*) () at /usr/lib/../lib/../lib/libclangSerialization.so.7
#12 0x00007fffb1117885 in clang::ASTReader::ReadStmtFromStream(clang::serialization::ModuleFile&) () at /usr/lib/../lib/../lib/libclangSerialization.so.7
#13 0x00007fffb10bd6c3 in clang::ASTReader::GetExternalDeclStmt(unsigned long) () at /usr/lib/../lib/../lib/libclangSerialization.so.7
#14 0x00007fffb270806c in clang::FunctionDecl::getBody(clang::FunctionDecl const*&) const () at /usr/lib/../lib/libclangAST.so.7
#15 0x00007fffb2939c6c in clang_getCursorDefinition () at /usr/lib/libclang.so.7
#16 0x00007fffb2939fcb in clang_isCursorDefinition () at /usr/lib/libclang.so.7
#17 0x00007fffb2a7bd3d in (anonymous namespace)::Visitor::dispatchCursor<(CXCursorKind)30, (Decision)0, (Decision)2> (cursor=..., this=0x7fff82ffc170, parent=...) at /home/master/prog/kdevelop/plugins/clang/duchain/builder.cpp:919
#18 0x00007fffb2a7bd3d in (anonymous namespace)::Visitor::dispatchCursor<(CXCursorKind)30> (parent=..., cursor=..., this=0x7fff82ffc170) at /home/master/prog/kdevelop/plugins/clang/duchain/builder.cpp:912
#19 0x00007fffb2a7bd3d in (anonymous namespace)::visitCursor(CXCursor, CXCursor, CXClientData) (cursor=..., parent=..., data=0x7fff82ffc170) at /home/master/prog/kdevelop/plugins/clang/duchain/builder.cpp:1541
#20 0x00007fffb2941025 in () at /usr/lib/libclang.so.7
#21 0x00007fffb294306e in () at /usr/lib/libclang.so.7
#22 0x00007fffb294316c in () at /usr/lib/libclang.so.7
#23 0x00007fffb2940b03 in () at /usr/lib/libclang.so.7
#24 0x00007fffb2948c81 in clang_visitChildren () at /usr/lib/libclang.so.7
#25 0x00007fffb2a670e1 in (anonymous namespace)::Visitor::buildDeclaration<(CXCursorKind)2, KDevelop::ClassDeclaration, true> (cursor=..., this=0x7fff82ffc170) at /usr/include/c++/8.2.1/bits/move.h:99
#26 0x00007fffb2a670e1 in (anonymous namespace)::Visitor::dispatchCursor<(CXCursorKind)2, (Decision)0, (Decision)0> (parent=..., cursor=..., this=0x7fff82ffc170) at /home/master/prog/kdevelop/plugins/clang/duchain/builder.cpp:950
#27 0x00007fffb2a670e1 in (anonymous namespace)::Visitor::dispatchCursor<(CXCursorKind)2, (Decision)0, (Decision)2>(CXCursor, CXCursor) (this=0x7fff82ffc170, cursor=..., parent=...) at /home/master/prog/kdevelop/plugins/clang/duchain/builder.cpp:924
#28 0x00007fffb2a7e551 in (anonymous namespace)::Visitor::dispatchCursor<(CXCursorKind)2> (parent=..., cursor=..., this=0x7fff82ffc170) at /home/master/prog/kdevelop/plugins/clang/duchain/builder.cpp:448
#29 0x00007fffb2a7e551 in (anonymous namespace)::visitCursor(CXCursor, CXCursor, CXClientData) (cursor=..., parent=..., data=0x7fff82ffc170) at /home/master/prog/kdevelop/plugins/clang/duchain/builder.cpp:1522
#30 0x00007fffb2941025 in () at /usr/lib/libclang.so.7
#31 0x00007fffb294306e in () at /usr/lib/libclang.so.7
#32 0x00007fffb294316c in () at /usr/lib/libclang.so.7
#33 0x00007fffb2940b03 in () at /usr/lib/libclang.so.7
#34 0x00007fffb2948c81 in clang_visitChildren () at /usr/lib/libclang.so.7
#35 0x00007fffb2a6c4c1 in (anonymous namespace)::Visitor::buildDeclaration<(CXCursorKind)22, KDevelop::Declaration, true>(CXCursor) (this=this@entry=0x7fff82ffc170, cursor=...) at /usr/include/c++/8.2.1/bits/move.h:99
#36 0x00007fffb2a7a536 in (anonymous namespace)::Visitor::dispatchCursor<(CXCursorKind)22> (cursor=..., this=0x7fff82ffc170, parent=...) at /home/master/prog/kdevelop/plugins/clang/duchain/builder.cpp:931
#37 0x00007fffb2a7a536 in (anonymous namespace)::visitCursor(CXCursor, CXCursor, CXClientData) (cursor=..., parent=..., data=0x7fff82ffc170) at /home/master/prog/kdevelop/plugins/clang/duchain/builder.cpp:1533
#38 0x00007fffb2941025 in () at /usr/lib/libclang.so.7
#39 0x00007fffb294306e in () at /usr/lib/libclang.so.7
#40 0x00007fffb294316c in () at /usr/lib/libclang.so.7
#41 0x00007fffb2940e04 in () at /usr/lib/libclang.so.7
#42 0x00007fffb2948c81 in clang_visitChildren () at /usr/lib/libclang.so.7
#43 0x00007fffb2a63d47 in (anonymous namespace)::Visitor::Visitor (update=<optimized out>, includes=..., file=<optimized out>, tu=<optimized out>, this=0x7fff82ffc170) at /home/master/prog/kdevelop/plugins/clang/duchain/builder.cpp:1448
#44 0x00007fffb2a63d47 in Builder::visit(CXTranslationUnitImpl*, void*, QHash<void*, KDevelop::ReferencedTopDUContext> const&, bool) (tu=<optimized out>, file=<optimized out>, includes=..., update=<optimized out>) at /home/master/prog/kdevelop/plugins/clang/duchain/builder.cpp:1590
#45 0x00007fffb2a8b3bd in ClangHelpers::buildDUChain(void*, QMultiHash<void*, Import> const&, ParseSession const&, KDevelop::TopDUContext::Features, QHash<void*, KDevelop::ReferencedTopDUContext>&, ClangIndex*, std::function<bool ()> const&)
(file=<optimized out>, imports=..., session=..., features=<optimized out>, includedFiles=..., index=0x5555583228a0, abortFunction=...) at /home/master/prog/kdevelop/plugins/clang/duchain/clanghelpers.cpp:189
#46 0x00007fffb2a8ac20 in ClangHelpers::buildDUChain(void*, QMultiHash<void*, Import> const&, ParseSession const&, KDevelop::TopDUContext::Features, QHash<void*, KDevelop::ReferencedTopDUContext>&, ClangIndex*, std::function<bool ()> const&)
(file=<optimized out>, imports=..., session=..., features=KDevelop::TopDUContext::AllDeclarationsContextsAndUses, includedFiles=..., index=0x5555583228a0, abortFunction=...) at /home/master/prog/kdevelop/plugins/clang/duchain/clanghelpers.cpp:121
#47 0x00007fffb2a8ac20 in ClangHelpers::buildDUChain(void*, QMultiHash<void*, Import> const&, ParseSession const&, KDevelop::TopDUContext::Features, QHash<void*, KDevelop::ReferencedTopDUContext>&, ClangIndex*, std::function<bool ()> const&)
(file=<optimized out>, imports=..., session=..., features=KDevelop::TopDUContext::AllDeclarationsContextsAndUses, includedFiles=..., index=0x5555583228a0, abortFunction=...) at /home/master/prog/kdevelop/plugins/clang/duchain/clanghelpers.cpp:121
#48 0x00007fffb2a8ac20 in ClangHelpers::buildDUChain(void*, QMultiHash<void*, Import> const&, ParseSession const&, KDevelop::TopDUContext::Features, QHash<void*, KDevelop::ReferencedTopDUContext>&, ClangIndex*, std::function<bool ()> const&)
(file=<optimized out>, imports=..., session=..., features=KDevelop::TopDUContext::AllDeclarationsContextsAndUses, includedFiles=..., index=0x5555583228a0, abortFunction=...) at /home/master/prog/kdevelop/plugins/clang/duchain/clanghelpers.cpp:121
#49 0x00007fffb2af71df in ClangParseJob::run(QSharedPointer<ThreadWeaver::JobInterface>, ThreadWeaver::Thread*) (this=0x555558497cb0) at /home/master/prog/kdevelop/plugins/clang/clangparsejob.cpp:217
#50 0x00007ffff6cc45ab in ThreadWeaver::IdDecorator::run(QSharedPointer<ThreadWeaver::JobInterface>, ThreadWeaver::Thread*) () at /usr/lib/libKF5ThreadWeaver.so.5
#51 0x00007ffff6cc4b38 in ThreadWeaver::Executor::run(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () at /usr/lib/libKF5ThreadWeaver.so.5
#52 0x00007ffff6cc3901 in ThreadWeaver::Job::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () at /usr/lib/libKF5ThreadWeaver.so.5
#53 0x00007ffff6cc343c in ThreadWeaver::Thread::run() () at /usr/lib/libKF5ThreadWeaver.so.5
#54 0x00007ffff4296f65 in () at /usr/lib/libQt5Core.so.5
#55 0x00007ffff2e2ba9d in start_thread () at /usr/lib/libpthread.so.0
#56 0x00007ffff3ddaa43 in clone () at /usr/lib/libc.so.6
It seems the crash now has a workaround. When opening the crashing project, I click the "Stop All" button as soon as the initial parsing starts. Then, everything seems to work at that point. *** Bug 400237 has been marked as a duplicate of this bug. *** Thank you for the crash report. As it has been a while since this was reported, can you please test and confirm if this issue is still occurring or if this bug report can be marked as resolved. I have set the bug status to "needsinfo" pending your response, please change back to "reported" or "resolved/worksforme" when you respond, thank you. 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! 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! |