https://bugs.kde.org/show_bug.cgi?id=488069
Bug ID: 488069 Summary: Reproducible crash in libclang after ::Visitor::setTypeSize Classification: Applications Product: kdevelop Version: git master Platform: Compiled Sources OS: Linux Status: REPORTED Severity: crash Priority: NOR Component: Language Support: CPP (Clang-based) Assignee: kdevelop-bugs-n...@kde.org Reporter: benjamin-h...@t-online.de Target Milestone: --- SUMMARY Today I observed an crash in KDevelop, and I was able to extract a single source file that can reproduce the crash, see attached file (produced using g++ -E, so no includes required). The crash seems to happen in (anonymous namespace)::Visitor::setTypeSize in src/plugins/clang/duchain/builder.cpp:950 KDevelop is built from sources against clang version 18.1.1 (Fedora 18.1.1-1.fc40). In principle I'm willing to look into this, but currently I do not have time, and maybe some experts already have an idea what this is. Backtrace in gdb: #0 0x00007fffa0ee4104 in clang::ASTContext::getTypeInfoImpl(clang::Type const*) const () at /lib64/libclang.so.18.1 #1 0x00007fffa0ee5d5a in clang::ASTContext::getTypeInfoInChars(clang::Type const*) const () at /lib64/libclang.so.18.1 #2 0x00007fffa0ee5c50 in clang::ASTContext::getTypeInfoInChars(clang::Type const*) const () at /lib64/libclang.so.18.1 #3 0x00007fffa0ec4efc in clang_Type_getSizeOf () at /lib64/libclang.so.18.1 #4 0x00007fffae29d9a6 in (anonymous namespace)::Visitor::setTypeSize (type=..., kdevType=kdevType@entry=0x7fff83b924b0, this=<optimized out>) at /home/benjamin/Developement/kdevelop/kdevelop/src/plugins/clang/duchain/builder.cpp:950 #5 0x00007fffae2a069d in (anonymous namespace)::Visitor::dispatchType<(CXTypeKind)177> (this=<optimized out>, type=..., cursor=...) at /home/benjamin/Developement/kdevelop/kdevelop/src/plugins/clang/duchain/builder.cpp:372 #6 (anonymous namespace)::Visitor::makeType (this=<optimized out>, type=..., parent=...) at /home/benjamin/Developement/kdevelop/kdevelop/src/plugins/clang/duchain/builder.cpp:1466 #7 0x00007fffae2aa455 in (anonymous namespace)::Visitor::createType<(CXCursorKind)10> (this=0x7fffa0bff6a0, cursor=...) at /home/benjamin/Developement/kdevelop/kdevelop/src/plugins/clang/duchain/builder.cpp:707 #8 (anonymous namespace)::Visitor::createDeclaration<(CXCursorKind)10, KDevelop::Declaration> (context=0x0, this=0x7fffa0bff6a0, cursor=..., id=...) at /home/benjamin/Developement/kdevelop/kdevelop/src/plugins/clang/duchain/builder.cpp:457 #9 (anonymous namespace)::Visitor::buildDeclaration<(CXCursorKind)10, KDevelop::Declaration, false> (this=this@entry=0x7fffa0bff6a0, cursor=...) at /home/benjamin/Developement/kdevelop/kdevelop/src/plugins/clang/duchain/builder.cpp:1296 #10 0x00007fffae2b2d6f in (anonymous namespace)::Visitor::dispatchCursor<(CXCursorKind)13, (Decision)1, (Decision)1> (this=0x7fffa0bff6a0, cursor=..., parent=...) at /home/benjamin/Developement/kdevelop/kdevelop/src/plugins/clang/duchain/builder.cpp:988 STEPS TO REPRODUCE 1. open empty session with empty project with attached file 2. wait a bit until background parser starts OBSERVED RESULT KDevelop crashes EXPECTED RESULT No crash SOFTWARE/OS VERSIONS Windows: macOS: Linux/KDE Plasma: (available in About System) KDE Plasma Version: KDE Frameworks Version: Qt Version: ADDITIONAL INFORMATION -- You are receiving this mail because: You are watching all bug changes.