https://sourceware.org/bugzilla/show_bug.cgi?id=33499

            Bug ID: 33499
           Summary: [BUG] A SEGV in _bfd_elf_write_section_eh_frame at
                    elf-eh-frame.c:2170
           Product: binutils
           Version: 2.46 (HEAD)
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: yfzhang23 at stu dot pku.edu.cn
  Target Milestone: ---

Created attachment 16389
  --> https://sourceware.org/bugzilla/attachment.cgi?id=16389&action=edit
POC

## Description

- Version: Binutils latest commit 9af366e0d3b7bc5802295bb001d17483033de87b
- Environment: Ubuntu 20.04.6 LTS, Clang 12.0.0

## Steps to reproduce

export CC="clang"
export CFLAGS="-g -fsanitize=address"
./configure
make -j
./ld/ld-new --version-exports-section symbol --shared $POC

## Sanitizer output

==68984==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000030 (pc
0x0000007ba00b bp 0x7ffd5a1cd9f0 sp 0x7ffd5a1ccd80 T0)
==68984==The signal is caused by a READ memory access.
==68984==Hint: address points to the zero page.
    #0 0x7ba00b in _bfd_elf_write_section_eh_frame
/benchmark/bin/DAFL/binutils-gdb/bfd/elf-eh-frame.c:2170:10
    #1 0x765754 in elf_link_input_bfd
/benchmark/bin/DAFL/binutils-gdb/bfd/elflink.c:12257:12
    #2 0x7547ff in bfd_elf_final_link
/benchmark/bin/DAFL/binutils-gdb/bfd/elflink.c:13222:11
    #3 0x542f2e in ldwrite /benchmark/bin/DAFL/binutils-gdb/ld/ldwrite.c:548:8
    #4 0x53acdf in main /benchmark/bin/DAFL/binutils-gdb/ld/./ldmain.c:905:3
    #5 0x7e66c1d8ad8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)
    #6 0x7e66c1d8ae3f in __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x29e3f)
    #7 0x41d6c4 in _start (/benchmark/bin/DAFL/binutils-gdb/ld/ld-new+0x41d6c4)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV
/benchmark/bin/DAFL/binutils-gdb/bfd/elf-eh-frame.c:2170:10 in
_bfd_elf_write_section_eh_frame
==68984==ABORTING

## 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.

Reply via email to