Open
Description
Hi,
Suddenly I started having a crash when compiling one of my module files, below you can find the stacktrace and I have attached the files as requested:
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: /usr/lib64/llvm20/bin/clang-20 -cc1 -triple x86_64-redhat-linux-gnu -emit-obj -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name Projects.ixx -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/project/path/build-debug -fcoverage-compilation-dir=/project/path/build-debug -resource-dir /usr/lib64/llvm20/bin/../../../lib/clang/20 -O3 -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-pre-c++14-compat -Wno-pre-c++17-compat -Wno-pre-c++20-compat -Wno-c++20-compat -Wno-pre-c++23-compat -Wno-padded -Wno-weak-vtables -std=gnu++23 -fdeprecated-macro -ferror-limit 19 -fgnuc-version=4.2.1 -fno-implicit-modules -fmodule-file=db.ProjectsInterface=src/db/CMakeFiles/db.dir/db.ProjectsInterface.pcm -fmodule-file=entities.Project=src/entities/CMakeFiles/entities.dir/entities.Project.pcm -fskip-odr-check-in-gmf -fcxx-exceptions -fexceptions -fcolor-diagnostics -vectorize-loops -vectorize-slp -flto=full -flto-unit -ffat-lto-objects -ffat-lto-objects -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o src/db/CMakeFiles/db.dir/Projects.ixx.o -x pcm src/db/CMakeFiles/db.dir/db.Projects.pcm
1. <eof> parser at end of file
#0 0x00007f5cba22914a llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/lib64/libLLVM.so.20.1+0x22914a)
#1 0x00007f5cba2260d4 llvm::sys::RunSignalHandlers() (/lib64/libLLVM.so.20.1+0x2260d4)
#2 0x00007f5cba2298bb (/lib64/libLLVM.so.20.1+0x2298bb)
#3 0x00007f5cb9a27c30 __restore_rt (/lib64/libc.so.6+0x19c30)
#4 0x00007f5cc2d7ec72 clang::DynamicRecursiveASTVisitor::TraverseTemplateInstantiations(clang::FunctionTemplateDecl*) (/lib64/libclang-cpp.so.20.1+0x57ec72)
#5 0x00007f5cc2d87fc2 clang::DynamicRecursiveASTVisitor::TraverseFunctionTemplateDecl(clang::FunctionTemplateDecl*) (/lib64/libclang-cpp.so.20.1+0x587fc2)
#6 0x00007f5cc2d7d70b clang::DynamicRecursiveASTVisitor::TraverseDecl(clang::Decl*) (/lib64/libclang-cpp.so.20.1+0x57d70b)
#7 0x00007f5cc2d860bb clang::DynamicRecursiveASTVisitor::TraverseCXXRecordDecl(clang::CXXRecordDecl*) (/lib64/libclang-cpp.so.20.1+0x5860bb)
#8 0x00007f5cc2d7dc73 clang::DynamicRecursiveASTVisitor::TraverseDecl(clang::Decl*) (/lib64/libclang-cpp.so.20.1+0x57dc73)
#9 0x00007f5cc2d814dc clang::DynamicRecursiveASTVisitor::TraverseNamespaceDecl(clang::NamespaceDecl*) (/lib64/libclang-cpp.so.20.1+0x5814dc)
#10 0x00007f5cc2d7dc23 clang::DynamicRecursiveASTVisitor::TraverseDecl(clang::Decl*) (/lib64/libclang-cpp.so.20.1+0x57dc23)
#11 0x00007f5cc2d814dc clang::DynamicRecursiveASTVisitor::TraverseNamespaceDecl(clang::NamespaceDecl*) (/lib64/libclang-cpp.so.20.1+0x5814dc)
#12 0x00007f5cc2d7dc23 clang::DynamicRecursiveASTVisitor::TraverseDecl(clang::Decl*) (/lib64/libclang-cpp.so.20.1+0x57dc23)
#13 0x00007f5cc2d814dc clang::DynamicRecursiveASTVisitor::TraverseNamespaceDecl(clang::NamespaceDecl*) (/lib64/libclang-cpp.so.20.1+0x5814dc)
#14 0x00007f5cc2d7dc23 clang::DynamicRecursiveASTVisitor::TraverseDecl(clang::Decl*) (/lib64/libclang-cpp.so.20.1+0x57dc23)
#15 0x00007f5cc2d814dc clang::DynamicRecursiveASTVisitor::TraverseNamespaceDecl(clang::NamespaceDecl*) (/lib64/libclang-cpp.so.20.1+0x5814dc)
#16 0x00007f5cc2d7dc23 clang::DynamicRecursiveASTVisitor::TraverseDecl(clang::Decl*) (/lib64/libclang-cpp.so.20.1+0x57dc23)
#17 0x00007f5cc2d7ef1b clang::DynamicRecursiveASTVisitor::TraverseTranslationUnitDecl(clang::TranslationUnitDecl*) (/lib64/libclang-cpp.so.20.1+0x57ef1b)
#18 0x00007f5cc35a79b0 clang::sema::AnalysisBasedWarnings::IssueWarnings(clang::TranslationUnitDecl*) (/lib64/libclang-cpp.so.20.1+0xda79b0)
#19 0x00007f5cc363e50d clang::Sema::ActOnEndOfTranslationUnit() (/lib64/libclang-cpp.so.20.1+0xe3e50d)
#20 0x00007f5cc2b09645 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/lib64/libclang-cpp.so.20.1+0x309645)
#21 0x00007f5cc2b09301 clang::Parser::ParseFirstTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/lib64/libclang-cpp.so.20.1+0x309301)
#22 0x00007f5cc2a12dcc clang::ParseAST(clang::Sema&, bool, bool) (/lib64/libclang-cpp.so.20.1+0x212dcc)
#23 0x00007f5cc511642f clang::FrontendAction::Execute() (/lib64/libclang-cpp.so.20.1+0x291642f)
#24 0x00007f5cc5078cc4 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/lib64/libclang-cpp.so.20.1+0x2878cc4)
#25 0x00007f5cc51a9f3e clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/lib64/libclang-cpp.so.20.1+0x29a9f3e)
#26 0x0000558474fd7695 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/lib64/llvm20/bin/clang-20+0xa695)
#27 0x0000558474fd3727 (/usr/lib64/llvm20/bin/clang-20+0x6727)
#28 0x0000558474fd246f clang_main(int, char**, llvm::ToolContext const&) (/usr/lib64/llvm20/bin/clang-20+0x546f)
#29 0x0000558474fe29a8 main (/usr/lib64/llvm20/bin/clang-20+0x159a8)
#30 0x00007f5cb9a115f5 __libc_start_call_main (/lib64/libc.so.6+0x35f5)
#31 0x00007f5cb9a116a8 __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x36a8)
#32 0x0000558474fd0e05 _start (/usr/lib64/llvm20/bin/clang-20+0x3e05)
clang++: error: unable to execute command: Segmentation fault (core dumped)
clang++: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 20.1.3 (Fedora 20.1.3-1.fc42)
Target: x86_64-redhat-linux-gnu
Thread model: posix
InstalledDir: /usr/lib64/llvm20/bin
Configuration file: /etc/clang/x86_64-redhat-linux-gnu-clang++.cfg
clang++: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang++: note: diagnostic msg: /tmp/Projects-e3849b.cppm
clang++: note: diagnostic msg: /tmp/Projects-e3849b.sh
clang++: note: diagnostic msg:
********************
I tried rolling back some of my recent changes to see what exactly caused the issue, and when I commented out line 63795 to 63799 of the attached source file I was able to compile without crashing. I hope this helps with the bug hunt 😃