Issue 139850
Summary clang crashed when build pdclib for taget bpf
Labels clang
Assignees
Reporter choury
    /usr/bin/clang-21 -I/root/pdclib/build/configured_include -I/root/pdclib/include -I/root/pdclib/platform/bpf/include -target bpf -mllvm -bpf-stack-size=1024 -Os -mcpu=v4 -D__BPF__ -g -std=c11 -D_PDCLIB_STATIC_DEFINE -Wall -Wextra -pedantic -Wno-unused-parameter -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wmissing-declarations -Wredundant-decls -Winline -Wno-long-long -Wuninitialized -fno-builtin -fvisibility=hidden -D_STDC_PREDEF_H -nostdlib -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wdeclaration-after-statement -MD -MT CMakeFiles/pdclibs.dir/functions/_PDCLIB/_PDCLIB_print.c.o -MF CMakeFiles/pdclibs.dir/functions/_PDCLIB/_PDCLIB_print.c.o.d -o CMakeFiles/pdclibs.dir/functions/_PDCLIB/_PDCLIB_print.c.o -c /root/pdclib/functions/_PDCLIB/_PDCLIB_print.c
fatal error: error in backend: Cannot select: 0x5617016191f0: i32,ch = vaarg 0x56170145efb0, 0x561701619500, SrcValue:ch<0x561701567120>, TargetConstant:i32<4>, functions/_PDCLIB/_PDCLIB_print.c:81:21
  0x561701619500: i64 = add nuw 0x561701619b90, Constant:i64<64>, functions/_PDCLIB/_PDCLIB_print.c:81:21
 0x561701619b90: i64,ch = CopyFromReg 0x56170145efb0, Register:i64 %93, functions/_PDCLIB/_PDCLIB_print.c:81:21
      0x5617016199d0: i64 = Register %93
    0x5617016198f0: i64 = Constant<64>
  0x561701618e00: i32 = TargetConstant<4>
In function: _PDCLIB_print
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/bin/clang-21 -I/root/pdclib/build/configured_include -I/root/pdclib/include -I/root/pdclib/platform/bpf/include -target bpf -mllvm -bpf-stack-size=1024 -Os -mcpu=v4 -D__BPF__ -g -std=c11 -D_PDCLIB_STATIC_DEFINE -Wall -Wextra -pedantic -Wno-unused-parameter -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wmissing-declarations -Wredundant-decls -Winline -Wno-long-long -Wuninitialized -fno-builtin -fvisibility=hidden -D_STDC_PREDEF_H -nostdlib -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wdeclaration-after-statement -MD -MT CMakeFiles/pdclibs.dir/functions/_PDCLIB/_PDCLIB_print.c.o -MF CMakeFiles/pdclibs.dir/functions/_PDCLIB/_PDCLIB_print.c.o.d -o CMakeFiles/pdclibs.dir/functions/_PDCLIB/_PDCLIB_print.c.o -c /root/pdclib/functions/_PDCLIB/_PDCLIB_print.c
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module '/root/pdclib/functions/_PDCLIB/_PDCLIB_print.c'.
4. Running pass 'BPF DAG->DAG Pattern Instruction Selection' on function '@_PDCLIB_print'
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  libLLVM.so.21.0 0x00007f83834dc21a llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 58
1  libLLVM.so.21.0      0x00007f83834d9db4 llvm::sys::RunSignalHandlers() + 84
2  libLLVM.so.21.0      0x00007f8383419c3e
3  libLLVM.so.21.0 0x00007f8383419bff
4  libLLVM.so.21.0      0x00007f83834d684b llvm::sys::Process::Exit(int, bool) + 43
5  clang-21 0x00005616d8c8d3da
6  libLLVM.so.21.0      0x00007f838342b56d llvm::report_fatal_error(llvm::Twine const&, bool) + 269
7  libLLVM.so.21.0 0x00007f8383df9427
8  libLLVM.so.21.0      0x00007f8383df8a18 llvm::SelectionDAGISel::SelectCodeCommon(llvm::SDNode*, unsigned char const*, unsigned int) + 16952
9  libLLVM.so.21.0      0x00007f8385ea887c
10 libLLVM.so.21.0      0x00007f8383defabc llvm::SelectionDAGISel::DoInstructionSelection() + 380
11 libLLVM.so.21.0 0x00007f8383def1fc llvm::SelectionDAGISel::CodeGenAndEmitDAG() + 1452
12 libLLVM.so.21.0      0x00007f8383dee985 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) + 5781
13 libLLVM.so.21.0      0x00007f8383dec9e9 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 361
14 libLLVM.so.21.0      0x00007f8383deadbd llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) + 173
15 libLLVM.so.21.0      0x00007f83838f70e5 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 757
16 libLLVM.so.21.0      0x00007f838363d09e llvm::FPPassManager::runOnFunction(llvm::Function&) + 638
17 libLLVM.so.21.0 0x00007f8383642e8c llvm::FPPassManager::runOnModule(llvm::Module&) + 44
18 libLLVM.so.21.0      0x00007f838363d830 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 1168
19 libclang-cpp.so.21.0 0x00007f8389e45ea0 clang::emitBackendOutput(clang::CompilerInstance&, clang::CodeGenOptions&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>, clang::BackendConsumer*) + 7696
20 libclang-cpp.so.21.0 0x00007f838a142dce clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 1854
21 libclang-cpp.so.21.0 0x00007f8388cd5339 clang::ParseAST(clang::Sema&, bool, bool) + 633
22 libclang-cpp.so.21.0 0x00007f838a92348f clang::FrontendAction::Execute() + 47
23 libclang-cpp.so.21.0 0x00007f838a897804 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 948
24 libclang-cpp.so.21.0 0x00007f838a9a8dde clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 702
25 clang-21 0x00005616d8c8cf7f cc1_main(llvm::ArrayRef<char const*>, char const*, void*) + 5967
26 clang-21             0x00005616d8c89d65
27 libclang-cpp.so.21.0 0x00007f838a57129d
28 libLLVM.so.21.0 0x00007f8383419be0 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) + 144
29 libclang-cpp.so.21.0 0x00007f838a570d21 clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const + 369
30 libclang-cpp.so.21.0 0x00007f838a536b92 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const + 498
31 libclang-cpp.so.21.0 0x00007f838a536d5e clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const + 142
32 libclang-cpp.so.21.0 0x00007f838a55235d clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) + 365
33 clang-21             0x00005616d8c89837 clang_main(int, char**, llvm::ToolContext const&) + 6503
34 clang-21             0x00005616d8c9756a main + 106
35 libc.so.6            0x00007f837ea60ca8
36 libc.so.6 0x00007f837ea60d65 __libc_start_main + 133
37 clang-21 0x00005616d8c87a01 _start + 33
clang-21: error: clang frontend command failed with exit code 70 (use -v to see invocation)
Debian clang version 21.0.0 (++20250322080030+20b5728b7b1c-1~exp1)
Target: bpf
Thread model: posix
InstalledDir: /usr/lib/llvm-21/bin
clang-21: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-21: note: diagnostic msg: /tmp/_PDCLIB_print-a0838b.c
clang-21: note: diagnostic msg: /tmp/_PDCLIB_print-a0838b.sh
clang-21: note: diagnostic msg:

********************
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to