https://sourceware.org/bugzilla/show_bug.cgi?id=32858
Bug ID: 32858 Summary: SEGV on ld function cache_bwrite Product: binutils Version: 2.44 Status: UNCONFIRMED Severity: normal Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: 2060909445 at qq dot com Target Milestone: --- Created attachment 16010 --> https://sourceware.org/bugzilla/attachment.cgi?id=16010&action=edit it is the POC_FILE environment: GNU ld (GNU Binutils) 2.44 on ubuntu 22.04 command: ld-new --no-undefined --orphan-handling discard --gc-sections --no-print-gc-sections -w -r -d POC_FILE information from asan: ==2581911==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7ff1ab7eaf7a bp 0x000000000d68 sp 0x7ffea35e65c0 T0) ==2581911==The signal is caused by a READ memory access. ==2581911==Hint: address points to the zero page. #0 0x7ff1ab7eaf7a in __GI__IO_default_xsputn libio/genops.c:394 #1 0x7ff1ab7eaf7a in __GI__IO_default_xsputn libio/genops.c:370 #2 0x7ff1ab7e871a in _IO_new_file_xsputn libio/fileops.c:1264 #3 0x7ff1ab7e871a in _IO_new_file_xsputn libio/fileops.c:1196 #4 0x7ff1ab7dcfd6 in __GI__IO_fwrite libio/iofwrite.c:39 #5 0x7ff1ab9c6013 in __interceptor_fwrite ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:1159 #6 0x55b2f100ec0e in cache_bwrite /home/ubuntu/asan_program/binutils-2.44/bfd/cache.c:435 #7 0x55b2f0bd7cec in bfd_write /home/ubuntu/asan_program/binutils-2.44/bfd/bfdio.c:412 #8 0x55b2f0c00f39 in _bfd_generic_set_section_contents /home/ubuntu/asan_program/binutils-2.44/bfd/libbfd.c:1351 #9 0x55b2f0c358dd in bfd_set_section_contents /home/ubuntu/asan_program/binutils-2.44/bfd/section.c:1531 #10 0x55b2f0c04e15 in default_indirect_link_order /home/ubuntu/asan_program/binutils-2.44/bfd/linker.c:2705 #11 0x55b2f0e0f436 in bfd_elf_final_link /home/ubuntu/asan_program/binutils-2.44/bfd/elflink.c:13126 #12 0x55b2f0b49310 in ldwrite /home/ubuntu/asan_program/binutils-2.44/ld/ldwrite.c:550 #13 0x55b2f0a92afd in main ldmain.c:560 #14 0x7ff1ab786d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 #15 0x7ff1ab786e3f in __libc_start_main_impl ../csu/libc-start.c:392 #16 0x55b2f0a97234 in _start (/home/ubuntu/asan_program/binutils-2.44/ld/ld-new+0xe9234) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV libio/genops.c:394 in __GI__IO_default_xsputn ==2581911==ABORTING -- You are receiving this mail because: You are on the CC list for the bug.