llvm / llvm/llvm-project

Compressing .symtab and .strtab with `llvm-objcopy` segfaults

Open
#197,813 9 comments 0 reactions 0 assignees View on GitHub
crash tools:llvm-objcopy/strip
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

Using llvm 22.1.5 from nix
```
$ llvm-objcopy --compress-sections .strtab=zlib --compress-sections .symtab=zlib site-packages/_polars_runtime_compat/_polars_runtime.abi3.so site-packages/_polars_runtime_compat/_polars_runtime.abi3.so.compressed
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0. Program arguments: llvm-objcopy --compress-sections .strtab=zlib --compress-sections .symtab=zlib site-packages/_polars_runtime_compat/_polars_runtime.abi3.so site-packages/_polars_runtime_compat/_polars_runtime.abi3.so.compressed
#0 0x0000755da198d788 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/nix/store/i3nx7z18zgsqswqng91kqxwiv8sx4cap-llvm-22.1.5-lib/lib/libLLVM.so.22.1+0xd8d788)
#1 0x0000755da198a527 SignalHandler(int, siginfo_t*, void*) (/nix/store/i3nx7z18zgsqswqng91kqxwiv8sx4cap-llvm-22.1.5-lib/lib/libLLVM.so.22.1+0xd8a527)
#2 0x0000755da0442790 __restore_rt (/nix/store/fjkx1l5cnskzrqacf08z7i8z17256w0j-glibc-2.42-61/lib/libc.so.6+0x42790)
#3 0x0000755da40919f0 llvm::StringTableBuilder::finalizeStringTable(bool) (/nix/store/i3nx7z18zgsqswqng91kqxwiv8sx4cap-llvm-22.1.5-lib/lib/libLLVM.so.22.1+0x34919f0)
#4 0x0000755da41c0cd1 llvm::objcopy::elf::ELFWriter>::finalize() (/nix/store/i3nx7z18zgsqswqng91kqxwiv8sx4cap-llvm-22.1.5-lib/lib/libLLVM.so.22.1+0x35c0cd1)
#5 0x0000755da41712ae writeOutput(llvm::objcopy::CommonConfig const&, llvm::objcopy::elf::Object&, llvm::raw_ostream&, llvm::objcopy::elf::ElfType) (/nix/store/i3nx7z18zgsqswqng91kqxwiv8sx4cap-llvm-22.1.5-lib/lib/libLLVM.so.22.1+0x35712ae)
#6 0x0000755da417db20 llvm::objcopy::elf::executeObjcopyOnBinary(llvm::objcopy::CommonConfig const&, llvm::objcopy::ELFConfig const&, llvm::object::ELFObjectFileBase&, llvm::raw_ostream&) (/nix/store/i3nx7z18zgsqswqng91kqxwiv8sx4cap-llvm-22.1.5-lib/lib/libLLVM.so.22.1+0x357db20)
#7 0x0000755da415cd72 llvm::objcopy::executeObjcopyOnBinary(llvm::objcopy::MultiFormatConfig const&, llvm::object::Binary&, llvm::raw_ostream&) (/nix/store/i3nx7z18zgsqswqng91kqxwiv8sx4cap-llvm-22.1.5-lib/lib/libLLVM.so.22.1+0x355cd72)
#8 0x000062ba2707a16b std::_Function_handler::_M_invoke(std::_Any_data const&, llvm::raw_ostream&) (/nix/store/wi9dwnvswzyvfzkirmbz776n1kf4d5rr-llvm-22.1.5/bin/llvm-objcopy+0x2716b)
#9 0x0000755da19602cf llvm::writeToOutput(llvm::StringRef, std::function) (/nix/store/i3nx7z18zgsqswqng91kqxwiv8sx4cap-llvm-22.1.5-lib/lib/libLLVM.so.22.1+0xd602cf)
#10 0x000062ba2707d75b llvm_objcopy_main(int, char**, llvm::ToolContext const&) (/nix/store/wi9dwnvswzyvfzkirmbz776n1kf4d5rr-llvm-22.1.5/bin/llvm-objcopy+0x2a75b)
#11 0x000062ba2705ab7a main (/nix/store/wi9dwnvswzyvfzkirmbz776n1kf4d5rr-llvm-22.1.5/bin/llvm-objcopy+0x7b7a)
#12 0x0000755da042b285 __libc_start_call_main (/nix/store/fjkx1l5cnskzrqacf08z7i8z17256w0j-glibc-2.42-61/lib/libc.so.6+0x2b285)
#13 0x0000755da042b338 __libc_start_main@GLIBC_2.2.5 (/nix/store/fjkx1l5cnskzrqacf08z7i8z17256w0j-glibc-2.42-61/lib/libc.so.6+0x2b338)
#14 0x000062ba2705abd5 _start (/nix/store/wi9dwnvswzyvfzkirmbz776n1kf4d5rr-llvm-22.1.5/bin/llvm-objcopy+0x7bd5)
Segmentation fault (core dumped) llvm-objcopy --compress-sections .strtab=zlib --compress-sections .symtab=zlib site-packages/_polars_runtime_compat/_polars_runtime.abi3.so site-packages/_polars_runtime_compat/_polars_runtime.abi3.so.compressed
```

Binary at https://github.com/Zentrik/temp-binary-store/blob/92175274a349129b5644c73f972534bd2dea9256/_polars_runtime.abi3.so.zst

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.