Bug 25529 - [objdump] binutils 2.34 free(): invalid pointer with -x flag
Summary: [objdump] binutils 2.34 free(): invalid pointer with -x flag
Status: RESOLVED DUPLICATE of bug 25447
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.34
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-11 05:35 UTC by law4dmail
Modified: 2020-02-11 06:23 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
crash test case (101 bytes, application/octet-stream)
2020-02-11 05:35 UTC, law4dmail
Details

Note You need to log in before you can comment on or make changes to this bug.
Description law4dmail 2020-02-11 05:35:36 UTC
Created attachment 12280 [details]
crash test case

objdump crashes with the following command:
./objdump -x <file>


=================================================================
==20906==ERROR: AddressSanitizer: attempting free on address which was not malloc()-ed: 0x61e00000f4e0 in thread T0
    #0 0x7fa02645a2ca in __interceptor_free (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x982ca)
    #1 0x958046 in _bfd_coff_free_symbols /home/ubuntu/xxx/sources/binutils-2.34/bfd/coffgen.c:1782
    #2 0x958046 in _bfd_coff_close_and_cleanup /home/ubuntu/xxx/sources/binutils-2.34/bfd/coffgen.c:3180
    #3 0x637038 in bfd_close_all_done /home/ubuntu/xxx/sources/binutils-2.34/bfd/opncls.c:789
    #4 0x41165e in display_file objdump.c:5016
    #5 0x41165e in main objdump.c:5349
    #6 0x7fa025e1482f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
    #7 0x4153b8 in _start (/home/ubuntu/xxx/proven/binutils/bin/objdump+0x4153b8)

0x61e00000f4e0 is located 1120 bytes inside of 2541-byte region [0x61e00000f080,0x61e00000fa6d)
allocated by thread T0 here:
    #0 0x7fa02645a79a in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x9879a)
    #1 0x62963a in bfd_malloc /home/ubuntu/xxx/sources/binutils-2.34/bfd/libbfd.c:275
    #2 0x62963a in bfd_zmalloc /home/ubuntu/xxx/sources/binutils-2.34/bfd/libbfd.c:360

SUMMARY: AddressSanitizer: bad-free ??:0 __interceptor_free
==20906==ABORTING
Comment 1 Alan Modra 2020-02-11 06:23:38 UTC
Already fixed.

*** This bug has been marked as a duplicate of bug 25447 ***