https://sourceware.org/bugzilla/show_bug.cgi?id=33406
Bug ID: 33406
Summary: [BUG] A SEGV in dump_dwarf_section at objdump.c:4501
Product: binutils
Version: 2.45
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: binutils
Assignee: unassigned at sourceware dot org
Reporter: yfzhang23 at stu dot pku.edu.cn
Target Milestone: ---
Created attachment 16325
--> https://sourceware.org/bugzilla/attachment.cgi?id=16325&action=edit
POC
## Description
- Version: Binutils 2.45
- Environment: Ubuntu 20.04.6 LTS, Clang 12.0.0
## Steps to reproduce
export CC="clang"
export CFLAGS="-g -fsanitize=address"
./configure
make -j
./binutils/objdump -S -D -x -s -Z -g -e -G -T -t -L -R --disassemble-zeroes
--insn-width=32 --disassembler-color=extended $POC
## Sanitizer output
==1449001==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000004 (pc
0x0000004d51ed bp 0x7fff402f5410 sp 0x7fff402f52f0 T0)
==1449001==The signal is caused by a READ memory access.
==1449001==Hint: address points to the zero page.
#0 0x4d51ed in dump_dwarf_section
/benchmark/project/binutils-2.45/binutils-2.45/binutils/./objdump.c:4501:34
#1 0x6a45ca in bfd_map_over_sections
/benchmark/project/binutils-2.45/binutils-2.45/bfd/section.c:1387:5
#2 0x4d0ef2 in dump_dwarf
/benchmark/project/binutils-2.45/binutils-2.45/binutils/./objdump.c:4560:3
#3 0x4cea95 in dump_bfd
/benchmark/project/binutils-2.45/binutils-2.45/binutils/./objdump.c:5874:4
#4 0x4cda0f in display_object_bfd
/benchmark/project/binutils-2.45/binutils-2.45/binutils/./objdump.c:5911:7
#5 0x4cd90f in display_any_bfd
/benchmark/project/binutils-2.45/binutils-2.45/binutils/./objdump.c:5990:5
#6 0x4cc735 in display_file
/benchmark/project/binutils-2.45/binutils-2.45/binutils/./objdump.c:6011:3
#7 0x4cad5e in main
/benchmark/project/binutils-2.45/binutils-2.45/binutils/./objdump.c:6438:6
#8 0x718145afc082 in __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x24082)
#9 0x41c5cd in _start
(/benchmark/project/binutils-2.45/binutils-2.45/binutils/objdump+0x41c5cd)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV
/benchmark/project/binutils-2.45/binutils-2.45/binutils/./objdump.c:4501:34 in
dump_dwarf_section
==1449001==ABORTING
## POC
[hdf5_crash_3.txt](https://github.com/user-attachments/files/20623354/hdf5_crash_3.txt)
## Credit
Reported by Yifan Zhang, [PLL](https://pl.cs.pku.edu.cn/en/)
--
You are receiving this mail because:
You are on the CC list for the bug.