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

            Bug ID: 34322
           Summary: objdump: assertion failure in
                    get_or_create_member_type with --map-global-vars
           Product: binutils
           Version: 2.47 (HEAD)
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: 970429025 at qq dot com
  Target Milestone: ---

Created attachment 16796
  --> https://sourceware.org/bugzilla/attachment.cgi?id=16796&action=edit
The PoC attachment contains the input file (Assert_Fail_1) that triggers this
behavior.

Overview:

Running objdump with --map-global-vars on a input file causes the program to
terminate with SIGABRT.

The program does not exit gracefully and instead aborts through __assert_fail()
while processing DWARF global variable mapping information.

Steps to Reproduce:

./objdump --map-global-vars Assert_Fail_1

Actual Results:

objdump terminates with SIGABRT.

GDB output excerpt:

Program received signal SIGABRT, Aborted.
0x000074bb5dd869fc in pthread_kill () from /lib/x86_64-linux-gnu/libc.so.6

(gdb) bt
#0  0x000074bb5dd869fc in pthread_kill () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x000074bb5dd32476 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#2  0x000074bb5dd187f3 in abort () from /lib/x86_64-linux-gnu/libc.so.6
#3  0x000074bb5dd1871b in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#4  0x000074bb5dd29e96 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
#5  0x000000000049ddba in get_or_create_member_type ()
#6  0x000000000048c748 in insert_element_in_list ()
#7  0x0000000000484ed3 in read_and_display_attr_value ()
#8  0x000000000047f511 in read_and_display_attr ()
#9  0x0000000000452f66 in process_debug_info ()
#10 0x00000000004728c8 in display_variable_mapping_info ()
#11 0x000000000043a2d9 in dump_global_variable_info ()
#12 0x000000000058b943 in bfd_map_over_sections ()
#13 0x0000000000439f75 in dump_dwarf_info ()
#14 0x00000000004372fc in dump_global_vars_info ()
#15 0x00000000004350f2 in dump_bfd ()
#16 0x0000000000434193 in display_object_bfd ()
#17 0x000000000043411c in display_any_bfd ()
#18 0x00000000004333e5 in display_file ()
#19 0x0000000000432441 in main ()

Expected Results:

objdump should exit normally, rather than terminating via SIGABRT.

Build & Platform:

binutils version: GNU Binutils 2.46.50.20260601
component: objdump
OS: Ubuntu 22.04.5 LTS
arch: x86_64

Additional Information:

The PoC attachment contains the input file that triggers the crash:
Assert_Fail_1.

Crash type: SIGABRT
Affected option: --map-global-vars
Crash location: get_or_create_member_type()
Fully reproducible.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to