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

[ELF] UNREACHABLE: "Invalid generic fixup size!" #531

Closed
atrosinenko opened this issue May 7, 2024 · 1 comment · Fixed by #534
Closed

[ELF] UNREACHABLE: "Invalid generic fixup size!" #531

atrosinenko opened this issue May 7, 2024 · 1 comment · Fixed by #534

Comments

@atrosinenko
Copy link
Collaborator

Trying to create ELF files for fold-move-imm.ll and jumptable-block-placement-bug.ll from llvm/test/CodeGen/EraVM yields an assertion:

$ ./bin/llc -filetype=obj -o /dev/null < ../llvm/test/CodeGen/EraVM/fold-move-imm.ll 
Invalid generic fixup size!
UNREACHABLE executed at /path/to/era-compiler-llvm/llvm/include/llvm/MC/MCFixup.h:111!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: ./bin/llc -filetype=obj -o /dev/null
1.      Running pass 'Function Pass Manager' on module '<stdin>'.
2.      Running pass 'EraVM Assembly Printer' on function '@test_pos'
 #0 0x0000706e8a1d0334 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /path/to/era-compiler-llvm/llvm/lib/Support/Unix/Signals.inc:602:13
 #1 0x0000706e8a1ce630 llvm::sys::RunSignalHandlers() /path/to/era-compiler-llvm/llvm/lib/Support/Signals.cpp:105:18
 #2 0x0000706e8a1d06b8 SignalHandler(int) /path/to/era-compiler-llvm/llvm/lib/Support/Unix/Signals.inc:413:1
 #3 0x0000706e88445320 (/lib/x86_64-linux-gnu/libc.so.6+0x45320)
 #4 0x0000706e8849eb1c __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
 #5 0x0000706e8849eb1c __pthread_kill_internal ./nptl/pthread_kill.c:78:10
 #6 0x0000706e8849eb1c pthread_kill ./nptl/pthread_kill.c:89:10
 #7 0x0000706e8844526e raise ./signal/../sysdeps/posix/raise.c:27:6
 #8 0x0000706e884288ff abort ./stdlib/abort.c:81:7
 #9 0x0000706e8a12daff (/path/to/era-compiler-llvm/build/bin/../lib/libLLVM-17.so+0x152daff)
#10 0x0000706e8bb67dc9 llvm::MCObjectStreamer::flushPendingLabels(llvm::MCFragment*, unsigned long) /path/to/era-compiler-llvm/llvm/lib/MC/MCObjectStreamer.cpp:74:5
#11 0x0000706e8bb67dc9 llvm::MCObjectStreamer::emitValueImpl(llvm::MCExpr const*, unsigned int, llvm::SMLoc) /path/to/era-compiler-llvm/llvm/lib/MC/MCObjectStreamer.cpp:252:3
#12 0x0000706e8abeaad1 __gnu_cxx::__normal_iterator<llvm::MachineBasicBlock* const*, std::vector<llvm::MachineBasicBlock*, std::allocator<llvm::MachineBasicBlock*>>>::operator++() /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_iterator.h:1111:2
#13 0x0000706e8abeaad1 llvm::AsmPrinter::emitJumpTableInfo() /path/to/era-compiler-llvm/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:2628:39
#14 0x0000706e8abe6477 __gnu_cxx::__normal_iterator<llvm::AsmPrinter::HandlerInfo*, std::vector<llvm::AsmPrinter::HandlerInfo, std::allocator<llvm::AsmPrinter::HandlerInfo>>>::__normal_iterator(llvm::AsmPrinter::HandlerInfo* const&) /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_iterator.h:1077:20
#15 0x0000706e8abe6477 std::vector<llvm::AsmPrinter::HandlerInfo, std::allocator<llvm::AsmPrinter::HandlerInfo>>::begin() /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_vector.h:874:16
#16 0x0000706e8abe6477 llvm::AsmPrinter::emitFunctionBody() /path/to/era-compiler-llvm/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:1903:30
#17 0x0000706e8c29c0f5 (anonymous namespace)::EraVMAsmPrinter::runOnMachineFunction(llvm::MachineFunction&) /path/to/era-compiler-llvm/llvm/lib/Target/EraVM/EraVMAsmPrinter.cpp:180:3
#18 0x0000706e8a6167ca llvm::MachineFunctionPass::runOnFunction(llvm::Function&) /path/to/era-compiler-llvm/llvm/lib/CodeGen/MachineFunctionPass.cpp:0:13
#19 0x0000706e8a340cd1 llvm::FPPassManager::runOnFunction(llvm::Function&) /path/to/era-compiler-llvm/llvm/lib/IR/LegacyPassManager.cpp:1435:27
#20 0x0000706e8a3471e2 llvm::FPPassManager::runOnModule(llvm::Module&) /path/to/era-compiler-llvm/llvm/lib/IR/LegacyPassManager.cpp:1481:13
#21 0x0000706e8a3413c4 (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) /path/to/era-compiler-llvm/llvm/lib/IR/LegacyPassManager.cpp:0:27
#22 0x0000706e8a3413c4 llvm::legacy::PassManagerImpl::run(llvm::Module&) /path/to/era-compiler-llvm/llvm/lib/IR/LegacyPassManager.cpp:535:44
#23 0x000055a80a50136a compileModule(char**, llvm::LLVMContext&) /path/to/era-compiler-llvm/llvm/tools/llc/llc.cpp:754:49
#24 0x000055a80a50136a main /path/to/era-compiler-llvm/llvm/tools/llc/llc.cpp:416:22
#25 0x0000706e8842a1ca __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:74:3
#26 0x0000706e8842a28b call_init ./csu/../csu/libc-start.c:128:20
#27 0x0000706e8842a28b __libc_start_main ./csu/../csu/libc-start.c:347:5
#28 0x000055a80a4febd5 _start (./bin/llc+0xabd5)

The assertion seems to be triggered by emission of 32-byte wide relocations for jump table entries, similar to the following:

JTI1_0:
        .cell   @.BB1_5
        .cell   @.BB1_6
        .cell   @.BB1_7
        .cell   @.BB1_8
@atrosinenko
Copy link
Collaborator Author

Resolved by #534 some time ago.

@atrosinenko atrosinenko linked a pull request May 22, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant