Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLNG-BPF [test_maps] pyperf600.o fatal error: error in backend: Branch target out of insn range #55669

Open
care101 opened this issue May 24, 2022 · 2 comments

Comments

@care101
Copy link

care101 commented May 24, 2022

2022-05-23 06:55:20 make run_tests -C bpf
make: Entering directory '/usr/src/perf_selftests-x86_64-rhel-8.3-kselftests-4b0986a3613
c92f4ec1bdc7f60ec66fea135991f/tools/testing/selftests/bpf'
  CLNG-BPF [test_maps] pyperf600.o
fatal error: error in backend: Branch target out of insn range
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include t
he crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: clang -g -Werror -D__TARGET_ARCH_x86 -mlittle-endian -I/usr/s
rc/perf_selftests-x86_64-rhel-8.3-kselftests-4b0986a3613c92f4ec1bdc7f60ec66fea135991f/to
ols/testing/selftests/bpf/tools/include -I/usr/src/perf_selftests-x86_64-rhel-8.3-kselft
ests-4b0986a3613c92f4ec1bdc7f60ec66fea135991f/tools/testing/selftests/bpf -I/usr/src/per
f_selftests-x86_64-rhel-8.3-kselftests-4b0986a3613c92f4ec1bdc7f60ec66fea135991f/tools/in
clude/uapi -I/usr/src/perf_selftests-x86_64-rhel-8.3-kselftests-4b0986a3613c92f4ec1bdc7f
60ec66fea135991f/tools/testing/selftests/usr/include -idirafter /lib/clang/15.0.0/includ
e -idirafter /usr/local/include -idirafter /usr/lib/gcc/x86_64-linux-gnu/10/../../../../
x86_64-linux-gnu/include -idirafter /usr/include/x86_64-linux-gnu -idirafter /include -i
dirafter /usr/include -Wno-compare-distinct-pointer-types -DENABLE_ATOMICS_TESTS -O2 -ta
rget bpf -c progs/pyperf600.c -mcpu=v3 -o /usr/src/perf_selftests-x86_64-rhel-8.3-kselft
ests-4b0986a3613c92f4ec1bdc7f60ec66fea135991f/tools/testing/selftests/bpf/pyperf600.o
1.      <eof> parser at end of file
2.      Code generation
 #0 0x000055c786bdfa60 PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
 #1 0x000055c786bdd914 llvm::sys::CleanupOnSignal(unsigned long) (/bin/clang-15+0x364b91
4)
 #2 0x000055c786b1a7f4 llvm::CrashRecoveryContext::HandleExit(int) (/bin/clang-15+0x3588
7f4)
 #3 0x000055c786bd5e8e llvm::sys::Process::Exit(int, bool) (/bin/clang-15+0x3643e8e)
 #4 0x000055c784638303 (/bin/clang-15+0x10a6303)
 #5 0x000055c786b21252 llvm::report_fatal_error(llvm::Twine const&, bool) (/bin/clang-15
+0x358f252)
 #6 0x000055c786b213b8 (/bin/clang-15+0x358f3b8)
 #7 0x000055c784f12590 (anonymous namespace)::BPFAsmBackend::createObjectTargetWriter() 
const BPFAsmBackend.cpp:0:0
 #8 0x000055c7867521cd llvm::MCAssembler::layout(llvm::MCAsmLayout&) (/bin/clang-15+0x31
c01cd)
 #9 0x000055c7867522e6 llvm::MCAssembler::Finish() (/bin/clang-15+0x31c02e6)
#10 0x000055c7879755ef llvm::AsmPrinter::doFinalization(llvm::Module&) (/bin/clang-15+0x
43e35ef)
#11 0x000055c7862fee7d llvm::FPPassManager::doFinalization(llvm::Module&) (/bin/clang-15
+0x2d6ce7d)
#12 0x000055c78630a598 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/bin/clang-15+
0x2d78598)
#13 0x000055c786f58340 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::Header
SearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::
LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, std::unique_pt
r<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>) (/bin/clang-15
+0x39c6340)
#14 0x000055c787ce58bc clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
 (/bin/clang-15+0x47538bc)
#15 0x000055c788754e69 clang::ParseAST(clang::Sema&, bool, bool) (/bin/clang-15+0x51c2e6
9)
#16 0x000055c787659269 clang::FrontendAction::Execute() (/bin/clang-15+0x40c7269)
#17 0x000055c7875e3c6b clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/
bin/clang-15+0x4051c6b)
#18 0x000055c78770dfd0 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/bin/
clang-15+0x417bfd0)
#19 0x000055c78463976c cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/bin/c
lang-15+0x10a776c)
#20 0x000055c7846365b9 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) driver.cpp:0:
0
#21 0x000055c78745c355 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1C
ommand::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>>, std::__cxx11::basic_str
ing<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::'lambda'()>(long
) Job.cpp:0:0
#22 0x000055c786b1a683 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>
) (/bin/clang-15+0x3588683)
#23 0x000055c78745c6b4 clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<
llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocat
or<char>>*, bool*) const (.part.0) Job.cpp:0:0
#24 0x000055c78742a006 clang::driver::Compilation::ExecuteCommand(clang::driver::Command
 const&, clang::driver::Command const*&) const (/bin/clang-15+0x3e98006)
#25 0x000055c78742a9b9 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList co
nst&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) const (/bin
/clang-15+0x3e989b9)
#26 0x000055c787438da9 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilat
ion&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/bin/clang
-15+0x3ea6da9)
#27 0x000055c78457c7a3 main (/bin/clang-15+0xfea7a3)
#28 0x00007f7dd7c7ad0a __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x26d0a)
#29 0x000055c784635f6a _start (/bin/clang-15+0x10a3f6a)
clang-15: error: clang frontend command failed with exit code 70 (use -v to see invocati
on)
clang version 15.0.0 (git://gitmirror/llvm_project e00cbbec06c08dc616a0d52a20f678b8fbd4e
304)
Target: bpf
Thread model: posix
InstalledDir: /bin
clang-15: note: diagnostic msg: 
********************

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

********************
make: *** [Makefile:498: /usr/src/perf_selftests-x86_64-rhel-8.3-kselftests-4b0986a3613c
92f4ec1bdc7f60ec66fea135991f/tools/testing/selftests/bpf/pyperf600.o] Error 70
@yonghong-song
Copy link
Contributor

The selftest is fixed with https://lore.kernel.org/bpf/20220419043230.2928530-1-yhs@fb.com/

In general, bpf community does not encourage inlining everything which will also increase code size and possibly make verification harder (even fail verification). But agree that at some point, we may need to add new instruction to add have more than 16bit offset (e.g., 24bit or even 32bit).

@rjsu26
Copy link

rjsu26 commented May 31, 2023

home/raj/linux/tools/testing/selftests/bpf/pyperf600.o
LLVM ERROR: Branch target out of insn range
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: llc -mattr=dwarfris -march=bpf -mcpu=probe -mattr=+alu32 -filetype=obj -o /home/raj/linux/tools/testing/selftests/bpf/pyperf600.o
 #0 0x00005637da6ac24f llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/local/bin/llc+0x2ebd24f)
 #1 0x00005637da6a9cc4 SignalHandler(int) Signals.cpp:0:0
 #2 0x00007f9eb1882420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
 #3 0x00007f9eb131f00b raise /build/glibc-SzIz7B/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #4 0x00007f9eb12fe859 abort /build/glibc-SzIz7B/glibc-2.31/stdlib/abort.c:81:7
 #5 0x00005637d7d61f3a llvm::UniqueStringSaver::save(llvm::StringRef) (.cold) StringSaver.cpp:0:0
 #6 0x00005637da602a3e (/usr/local/bin/llc+0x2e13a3e)
 #7 0x00005637d93adf63 (/usr/local/bin/llc+0x1bbef63)
 #8 0x00005637d9ffeecd llvm::MCAssembler::layout(llvm::MCAsmLayout&) (/usr/local/bin/llc+0x280fecd)
 #9 0x00005637d9ffef8d llvm::MCAssembler::Finish() (/usr/local/bin/llc+0x280ff8d)
#10 0x00005637da023ffa llvm::MCELFStreamer::finishImpl() (/usr/local/bin/llc+0x2834ffa)
#11 0x00005637da050d45 llvm::MCStreamer::finish(llvm::SMLoc) (/usr/local/bin/llc+0x2861d45)
#12 0x00005637d97cf93f llvm::AsmPrinter::doFinalization(llvm::Module&) (/usr/local/bin/llc+0x1fe093f)
#13 0x00005637d9f27215 llvm::FPPassManager::doFinalization(llvm::Module&) (/usr/local/bin/llc+0x2738215)
#14 0x00005637d9f333c8 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/usr/local/bin/llc+0x27443c8)
#15 0x00005637d7e2ae43 compileModule(char**, llvm::LLVMContext&) llc.cpp:0:0
#16 0x00005637d7d6c7fa main (/usr/local/bin/llc+0x57d7fa)
#17 0x00007f9eb1300083 __libc_start_main /build/glibc-SzIz7B/glibc-2.31/csu/../csu/libc-start.c:342:3
#18 0x00005637d7e228ae _start (/usr/local/bin/llc+0x6338ae)
Aborted (core dumped)
make: *** [Makefile:281: /home/raj/linux/tools/testing/selftests/bpf/pyperf600.o] Error 134
make: Leaving directory '/home/raj/linux/tools/testing/selftests/bpf'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants