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

            Bug ID: 33473
           Summary: [BUG] A SEGV in
                    _bfd_elf_gc_mark_debug_special_section_group at
                    elflink.c:14225
           Product: binutils
           Version: 2.45
            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 16371
  --> https://sourceware.org/bugzilla/attachment.cgi?id=16371&action=edit
POC

## Description

- Version: Binutils 2.45 with patches in bug 33451, bug 33455, and bug 33457.
- 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 --gc-sections --no-print-gc-sections -w $POC

## Sanitizer output

==148478==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000024 (pc
0x00000077e18e bp 0x7ffc57a526b0 sp 0x7ffc57a52630 T0)
==148478==The signal is caused by a READ memory access.
==148478==Hint: address points to the zero page.
    #0 0x77e18e in _bfd_elf_gc_mark_debug_special_section_group
/benchmark/bin/binutils-2.45/bfd/elflink.c:14225:18
    #1 0x77d679 in _bfd_elf_gc_mark_extra_sections
/benchmark/bin/binutils-2.45/bfd/elflink.c:14330:6
    #2 0x781beb in bfd_elf_gc_sections
/benchmark/bin/binutils-2.45/bfd/elflink.c:14751:3
    #3 0x5131a8 in lang_gc_sections
/benchmark/bin/binutils-2.45/ld/ldlang.c:7892:5
    #4 0x50c94d in lang_process /benchmark/bin/binutils-2.45/ld/ldlang.c:8542:3
    #5 0x53ca89 in main /benchmark/bin/binutils-2.45/ld/./ldmain.c:882:3
    #6 0x7f5787eb4082 in __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x24082)
    #7 0x41d6ad in _start (/benchmark/bin/binutils-2.45/ld/ld-new+0x41d6ad)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV
/benchmark/bin/binutils-2.45/bfd/elflink.c:14225:18 in
_bfd_elf_gc_mark_debug_special_section_group
==148478==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