-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Open
Labels
backend:AMDGPUclang:codegenIR generation bugs: mangling, exceptions, etc.IR generation bugs: mangling, exceptions, etc.crashPrefer [crash-on-valid] or [crash-on-invalid]Prefer [crash-on-valid] or [crash-on-invalid]platform:linux
Description
a.cpp:
void hipLaunchKernel();
__global__ void kernel() {}
Run with:
clang++ -x hip a.cpp
Stack dump
Stack dump:
0. Program arguments: /usr/lib/llvm-22/bin/clang -cc1 -triple x86_64-pc-linux-gnu -aux-triple amdgcn-amd-amdhsa -emit-obj -dumpdir a- -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name a.cpp -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=all -fmath-errno -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/home/a -fcoverage-compilation-dir=/home/a -resource-dir /usr/lib/llvm-22/lib/clang/22 -internal-isystem /usr/lib/llvm-22/lib/clang/22/include/cuda_wrappers -idirafter /opt/rocm/include -include __clang_hip_runtime_wrapper.h -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/x86_64-linux-gnu/c++/13 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/backward -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/x86_64-linux-gnu/c++/13 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/backward -internal-isystem /usr/lib/llvm-22/lib/clang/22/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/13/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -internal-isystem /usr/lib/llvm-22/lib/clang/22/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/13/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdeprecated-macro -ferror-limit 19 -fmessage-length=150 -fhip-new-launch-api -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fcxx-exceptions -fexceptions -fcolor-diagnostics -fcuda-include-gpubinary /tmp/a-9d9e3a.hipfb -cuid=8cd077ff4dbb1ca8 -fcuda-allow-variadic-functions -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/a-48ab45.o -x hip a.cpp
1. <eof> parser at end of file
2. a.cpp:3:17: LLVM IR generation of declaration 'kernel'
3. a.cpp:3:17: Generating code for declaration 'kernel'
#0 0x00007ade399d2d3f llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib/llvm-22/bin/../lib/libLLVM.so.22.0+0xbd2d3f)
#1 0x00007ade399d05f7 llvm::sys::RunSignalHandlers() (/usr/lib/llvm-22/bin/../lib/libLLVM.so.22.0+0xbd05f7)
#2 0x00007ade399d3afa (/usr/lib/llvm-22/bin/../lib/libLLVM.so.22.0+0xbd3afa)
#3 0x00007ade38645330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
#4 0x00007ade430f16d8 (/usr/lib/llvm-22/bin/../lib/libclang-cpp.so.22.0+0x1cf16d8)
#5 0x00007ade433a9ec6 clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) (/usr/lib/llvm-22/bin/../lib/libclang-cpp.so.22.0+0x1fa9ec6)
#6 0x00007ade433cd551 clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/usr/lib/llvm-22/bin/../lib/libclang-cpp.so.22.0+0x1fcd551)
#7 0x00007ade433c6a43 clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/usr/lib/llvm-22/bin/../lib/libclang-cpp.so.22.0+0x1fc6a43)
#8 0x00007ade433cab5a clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) (/usr/lib/llvm-22/bin/../lib/libclang-cpp.so.22.0+0x1fcab5a)
#9 0x00007ade433c5624 clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) (/usr/lib/llvm-22/bin/../lib/libclang-cpp.so.22.0+0x1fc5624)
#10 0x00007ade4346f7cc (/usr/lib/llvm-22/bin/../lib/libclang-cpp.so.22.0+0x206f7cc)
#11 0x00007ade4339a506 clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) (/usr/lib/llvm-22/bin/../lib/libclang-cpp.so.22.0+0x1f9a506)
#12 0x00007ade41f88469 clang::ParseAST(clang::Sema&, bool, bool) (/usr/lib/llvm-22/bin/../lib/libclang-cpp.so.22.0+0xb88469)
#13 0x00007ade43b8d79a clang::FrontendAction::Execute() (/usr/lib/llvm-22/bin/../lib/libclang-cpp.so.22.0+0x278d79a)
#14 0x00007ade43b067d4 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/lib/llvm-22/bin/../lib/libclang-cpp.so.22.0+0x27067d4)
#15 0x00007ade43c15a7c clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/lib/llvm-22/bin/../lib/libclang-cpp.so.22.0+0x2815a7c)
#16 0x000058af667aaf5c cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/lib/llvm-22/bin/clang+0x13f5c)
#17 0x000058af667a7c84 (/usr/lib/llvm-22/bin/clang+0x10c84)
#18 0x000058af667a706b clang_main(int, char**, llvm::ToolContext const&) (/usr/lib/llvm-22/bin/clang+0x1006b)
#19 0x000058af667b5083 main (/usr/lib/llvm-22/bin/clang+0x1e083)
#20 0x00007ade3862a1ca __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:74:3
#21 0x00007ade3862a28b call_init ./csu/../csu/libc-start.c:128:20
#22 0x00007ade3862a28b __libc_start_main ./csu/../csu/libc-start.c:347:5
#23 0x000058af667a59c5 _start (/usr/lib/llvm-22/bin/clang+0xe9c5)
clang++: error: unable to execute command: Segmentation fault (core dumped)
clang++: error: clang frontend command failed due to signal (use -v to see invocation)
Ubuntu clang version 22.0.0 (++20250812082130+296e057d0bf2-1~exp1~20250812082146.1091)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm-22/bin
clang++: note: diagnostic msg: Error generating preprocessed source(s).
Metadata
Metadata
Assignees
Labels
backend:AMDGPUclang:codegenIR generation bugs: mangling, exceptions, etc.IR generation bugs: mangling, exceptions, etc.crashPrefer [crash-on-valid] or [crash-on-invalid]Prefer [crash-on-valid] or [crash-on-invalid]platform:linux