<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/70433>70433</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Compiler asked me to submit the crash report.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
aphidspider
</td>
</tr>
</table>
<pre>
Hi,
I have attached the files from
a) /tmp directory
b) my source code
c) my make file.
and below is the output of make command on stderr
[yet_another_ebpf_smpp]# make
clang \
-target bpf \
-D __BPF_TRACING__ \
-I/usr/include/x86_64-linux-gnu \
-Wall -g \
-O2 -o smpp.bpf.o -c smpp.bpf.c
Error at line 37: Unsupport signed division for DAG: 0x11bb978: i64 = sdiv exact 0x11bb8a8, Constant:i64<52>, ./packet.h:37:3Please convert to unsigned div/mod.
fatal error: error in backend: Cannot select: 0x11bb978: i64 = sdiv exact 0x11bb8a8, Constant:i64<52>, ./packet.h:37:3
0x11bb8a8: i64 = sub nsw 0x11baf50, 0x11bb500, ./packet.h:37:3
0x11baf50: i64,ch = load<(load (s32) from %ir.13, !tbaa !165), zext from i32> 0x1160128, 0x11bb360, undef:i64, ./packet.h:34:39
0x11bb360: i64 = add 0x11bae18, 0x11bb2f8
0x11bae18: i64,ch = CopyFromReg 0x1160128, Register:i64 %0
0x11badb0: i64 = Register %0
0x11bb2f8: i64,ch = load<(dereferenceable load (s64) from @"llvm.xdp_md:0:4$0:1")> 0x1160128, 0x11bb430, undef:i64
0x11bb430: i64 = BPFISD::Wrapper TargetGlobalAddress:i64<i64* @"llvm.xdp_md:0:4$0:1"> 0
0x11bbd20: i64 = TargetGlobalAddress<i64* @"llvm.xdp_md:0:4$0:1"> 0
0x11bb088: i64 = undef
0x11bb088: i64 = undef
0x11bb500: i64 = add 0x11bb3c8, 0xe79958, ./packet.h:36:59
0x11bb3c8: i64,ch = load<(load (s32) from %ir.7, !tbaa !157), zext from i32> 0x1160128, 0x11bb158, undef:i64, ./packet.h:33:37
0x11bb158: i64 = add 0x11bae18, 0x11bb0f0
0x11bae18: i64,ch = CopyFromReg 0x1160128, Register:i64 %0
0x11badb0: i64 = Register %0
0x11bb0f0: i64,ch = load<(dereferenceable load (s64) from @"llvm.xdp_md:0:0$0:0")> 0x1160128, 0x11bb498, undef:i64
0x11bb498: i64 = BPFISD::Wrapper TargetGlobalAddress:i64<i64* @"llvm.xdp_md:0:0$0:0"> 0
0x11bb290: i64 = TargetGlobalAddress<i64* @"llvm.xdp_md:0:0$0:0"> 0
0x11bb088: i64 = undef
0x11bb088: i64 = undef
0xe79958: i64 = and 0x11baee8, Constant:i64<4294967295>, ./packet.h:36:59
0x11baee8: i64,ch = CopyFromReg 0x1160128, Register:i64 %1
0x11bae80: i64 = Register %1
0x11bbc50: i64 = Constant<4294967295>
0x11bb910: i64 = Constant<52>
In function: parse_smpp
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: clang -target bpf -D __BPF_TRACING__ -I/usr/include/x86_64-linux-gnu -Wall -g -O2 -o smpp.bpf.o -c smpp.bpf.c
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module 'smpp.bpf.c'.
4. Running pass 'BPF DAG->DAG Pattern Instruction Selection' on function '@parse_smpp'
#0 0x00007fd4b343fd01 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/lib/x86_64-linux-gnu/libLLVM-14.so.1+0xe3fd01)
#1 0x00007fd4b343da3e llvm::sys::RunSignalHandlers() (/lib/x86_64-linux-gnu/libLLVM-14.so.1+0xe3da3e)
#2 0x00007fd4b343f0ab llvm::sys::CleanupOnSignal(unsigned long) (/lib/x86_64-linux-gnu/libLLVM-14.so.1+0xe3f0ab)
#3 0x00007fd4b336bbea (/lib/x86_64-linux-gnu/libLLVM-14.so.1+0xd6bbea)
#4 0x00007fd4b336bb8b (/lib/x86_64-linux-gnu/libLLVM-14.so.1+0xd6bb8b)
#5 0x00007fd4b343a007 llvm::sys::Process::Exit(int, bool) (/lib/x86_64-linux-gnu/libLLVM-14.so.1+0xe3a007)
#6 0x00000000004136d2 (/usr/lib/llvm-14/bin/clang+0x4136d2)
#7 0x00007fd4b337a673 llvm::report_fatal_error(llvm::Twine const&, bool) (/lib/x86_64-linux-gnu/libLLVM-14.so.1+0xd7a673)
#8 0x00007fd4b3c60e31 (/lib/x86_64-linux-gnu/libLLVM-14.so.1+0x1660e31)
#9 0x00007fd4b3c602d8 llvm::SelectionDAGISel::SelectCodeCommon(llvm::SDNode*, unsigned char const*, unsigned int) (/lib/x86_64-linux-gnu/libLLVM-14.so.1+0x16602d8)
#10 0x00007fd4b55650bd (/lib/x86_64-linux-gnu/libLLVM-14.so.1+0x2f650bd)
#11 0x00007fd4b3c58ecf llvm::SelectionDAGISel::DoInstructionSelection() (/lib/x86_64-linux-gnu/libLLVM-14.so.1+0x1658ecf)
#12 0x00007fd4b3c58594 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/lib/x86_64-linux-gnu/libLLVM-14.so.1+0x1658594)
#13 0x00007fd4b3c579c8 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/lib/x86_64-linux-gnu/libLLVM-14.so.1+0x16579c8)
#14 0x00007fd4b3c55557 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/lib/x86_64-linux-gnu/libLLVM-14.so.1+0x1655557)
#15 0x00007fd4b37c628e llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/lib/x86_64-linux-gnu/libLLVM-14.so.1+0x11c628e)
#16 0x00007fd4b357a390 llvm::FPPassManager::runOnFunction(llvm::Function&) (/lib/x86_64-linux-gnu/libLLVM-14.so.1+0xf7a390)
#17 0x00007fd4b3581983 llvm::FPPassManager::runOnModule(llvm::Module&) (/lib/x86_64-linux-gnu/libLLVM-14.so.1+0xf81983)
#18 0x00007fd4b357af36 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/lib/x86_64-linux-gnu/libLLVM-14.so.1+0xf7af36)
#19 0x00007fd4ba857201 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x1857201)
#20 0x00007fd4bab7c855 (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x1b7c855)
#21 0x00007fd4b9a04824 clang::ParseAST(clang::Sema&, bool, bool) (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0xa04824)
#22 0x00007fd4bab78b71 clang::CodeGenAction::ExecuteAction() (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x1b78b71)
#23 0x00007fd4bb514b57 clang::FrontendAction::Execute() (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x2514b57)
#24 0x00007fd4bb46c3a6 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x246c3a6)
#25 0x00007fd4bb58e45b clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x258e45b)
#26 0x000000000041328b cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/lib/llvm-14/bin/clang+0x41328b)
#27 0x00000000004114bc (/usr/lib/llvm-14/bin/clang+0x4114bc)
#28 0x00007fd4bb0eaed2 (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x20eaed2)
#29 0x00007fd4b336bb6d llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/lib/x86_64-linux-gnu/libLLVM-14.so.1+0xd6bb6d)
#30 0x00007fd4bb0ea9c0 clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, bool*) const (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x20ea9c0)
#31 0x00007fd4bb0b5183 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&) const (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x20b5183)
#32 0x00007fd4bb0b540a clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x20b540a)
#33 0x00007fd4bb0cf507 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x20cf507)
#34 0x0000000000410f26 main (/usr/lib/llvm-14/bin/clang+0x410f26)
#35 0x00007fd4b1e29d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#36 0x00007fd4b1e29e40 call_init ./csu/../csu/libc-start.c:128:20
#37 0x00007fd4b1e29e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#38 0x000000000040e3b5 _start (/usr/lib/llvm-14/bin/clang+0x40e3b5)
clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)
Ubuntu clang version 14.0.0-1ubuntu1.1
Target: bpf
Thread model: posix
InstalledDir: /usr/bin
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/smpp-0356a3.c
clang: note: diagnostic msg: /tmp/smpp-0356a3.sh
clang: note: diagnostic msg:
********************
make: *** [Makefile:17: smpp.bpf.o] Error 70
[yet_another_ebpf_smpp]# pwd
/home/rajeev/workspace/ebpf/learning-ebpf/yet_another_ebpf_smpp
[yet_another_ebpf_smpp]#
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8WltT47gS_jXmR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