Package: llvm-21
Version: 1:21.1.8-3+b1
Severity: normal
Forwarded: https://github.com/llvm/llvm-project/issues/182567
X-Debbugs-Cc: [email protected], [email protected]

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

-- System Information:
Debian Release: forky/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.17.13+deb13-amd64 (SMP w/12 CPU threads; PREEMPT)
Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: unable to detect

Versions of packages llvm-21 depends on:
ii  libc6                 2.42-13
ii  libcurl4t64           8.18.0-2
ii  libgcc-s1             15.2.0-13
ii  libllvm21             1:21.1.8-3+b1
ii  libpfm4               4.13.0+git106-g3e4031b-1+b1
ii  libstdc++6            15.2.0-13
ii  libz3-4               4.13.3-1+b1
ii  libzstd1              1.5.7+dfsg-3+b1
ii  llvm-21-linker-tools  1:21.1.8-3+b1
ii  llvm-21-runtime       1:21.1.8-3+b1
ii  zlib1g                1:1.3.dfsg+really1.3.1-3

Versions of packages llvm-21 recommends:
ii  llvm-21-dev  1:21.1.8-3+b1

Versions of packages llvm-21 suggests:
pn  llvm-21-doc  <none>

-- no debconf information

Reply via email to