#1128523 llvm-21: Segfault in llvm-objdump --offloading with object file

Package:
llvm-21
Source:
llvm-21
Description:
Modular compiler and toolchain technologies
Submitter:
Cordell Bloor
Date:
2026-03-19 17:41:02 UTC
Severity:
normal
#1128523#5
Date:
2026-02-20 20:39:30 UTC
From:
To:
Dear Maintainer,

llvm-objdump-21 segfaults when I attempt to extract the offload sections from an object file, rocsparse_axpyi.cpp.o. This object file was created by building rocSPARSE 7.1.0 with --offload-compress enabled. A copy of the object file is included in the upstream bug report. The problem occurs with both the upstream LLVM and the Debian package.

```
# LLVM_SYMBOLIZER_PATH=/usr/lib/llvm-21/bin/llvm-symbolizer llvm-objdump-21 --offloading rocsparse_axpyi.cpp.o

rocsparse_axpyi.cpp.o:	file format elf64-x86-64
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: llvm-objdump-21 --offloading rocsparse_axpyi.cpp.o
 #0 0x00007f6c4a82506a llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib/llvm-21/bin/../lib/libLLVM.so.21.1+0x45df06a)
 #1 0x00007f6c4a822857 llvm::sys::RunSignalHandlers() (/usr/lib/llvm-21/bin/../lib/libLLVM.so.21.1+0x45dc857)
 #2 0x00007f6c4a825e14 (/usr/lib/llvm-21/bin/../lib/libLLVM.so.21.1+0x45dfe14)
 #3 0x00007f6c45bf0a70 (/usr/lib/x86_64-linux-gnu/libc.so.6+0x40a70)
 #4 0x00007f6c45d30830 (/usr/lib/x86_64-linux-gnu/libc.so.6+0x180830)
 #5 0x000055f8448e16c0 (/usr/lib/llvm-21/bin/llvm-objdump+0xc46c0)
 #6 0x000055f8448e0c2e (/usr/lib/llvm-21/bin/llvm-objdump+0xc3c2e)
 #7 0x000055f84485e965 (/usr/lib/llvm-21/bin/llvm-objdump+0x41965)
 #8 0x000055f844853ff9 (/usr/lib/llvm-21/bin/llvm-objdump+0x36ff9)
 #9 0x000055f8448eb89a (/usr/lib/llvm-21/bin/llvm-objdump+0xce89a)
#10 0x00007f6c45bd9f75 (/usr/lib/x86_64-linux-gnu/libc.so.6+0x29f75)
#11 0x00007f6c45bda027 __libc_start_main (/usr/lib/x86_64-linux-gnu/libc.so.6+0x2a027)
#12 0x000055f84484afe1 (/usr/lib/llvm-21/bin/llvm-objdump+0x2dfe1)
Segmentation fault         (core dumped) LLVM_SYMBOLIZER_PATH=/usr/lib/llvm-21/bin/llvm-symbolizer llvm-objdump-21 --offloading rocsparse_axpyi.cpp.o
```

It's noteworthy that this does not occur with llvm-22:

```
# llvm-objdump-22 --offloading rocsparse_axpyi.cpp.o

rocsparse_axpyi.cpp.o:	file format elf64-x86-64
Extracting offload bundle: rocsparse_axpyi.cpp.o.0.host-x86_64-unknown-linux-gnu-
Extracting offload bundle: rocsparse_axpyi.cpp.o.0.hipv4-amdgcn-amd-amdhsa--gfx1010
Extracting offload bundle: rocsparse_axpyi.cpp.o.0.hipv4-amdgcn-amd-amdhsa--gfx1030
Extracting offload bundle: rocsparse_axpyi.cpp.o.0.hipv4-amdgcn-amd-amdhsa--gfx1100
Extracting offload bundle: rocsparse_axpyi.cpp.o.0.hipv4-amdgcn-amd-amdhsa--gfx1101
Extracting offload bundle: rocsparse_axpyi.cpp.o.0.hipv4-amdgcn-amd-amdhsa--gfx1102
Extracting offload bundle: rocsparse_axpyi.cpp.o.0.hipv4-amdgcn-amd-amdhsa--gfx803
Extracting offload bundle: rocsparse_axpyi.cpp.o.0.hipv4-amdgcn-amd-amdhsa--gfx900
Extracting offload bundle: rocsparse_axpyi.cpp.o.0.hipv4-amdgcn-amd-amdhsa--gfx906
Extracting offload bundle: rocsparse_axpyi.cpp.o.0.hipv4-amdgcn-amd-amdhsa--gfx908
Extracting offload bundle: rocsparse_axpyi.cpp.o.0.hipv4-amdgcn-amd-amdhsa--gfx90a
```

I suspect that the problem is related to uncompressing the offload
bundles as there is a different error when operating on a shared object
library. The log below is based on the upstream objdump, but I've seen
the same results with the Debian package.

```
# /root/LLVM-21.1.8-Linux-X64/bin/llvm-objdump --offloading ./obj-x86_64-linux-gnu/library/librocsparse.so.1.0

./obj-x86_64-linux-gnu/library/librocsparse.so.1.0:	file format elf64-x86-64
/root/LLVM-21.1.8-Linux-X64/bin/llvm-objdump: error: './obj-x86_64-linux-gnu/library/librocsparse.so.1.0': while extracting offload FatBin bundles: Failed to decompress input: Could not decompress embedded file contents: Src size is incorrect
```

Sincerely,
Cory Bloor