bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/24933] New: Memory leak in objdump


From: wang8330 at umn dot edu
Subject: [Bug binutils/24933] New: Memory leak in objdump
Date: Fri, 23 Aug 2019 08:05:27 +0000

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

            Bug ID: 24933
           Summary: Memory leak in objdump
           Product: binutils
           Version: 2.33 (HEAD)
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: wang8330 at umn dot edu
  Target Milestone: ---

Created attachment 11963
  --> https://sourceware.org/bugzilla/attachment.cgi?id=11963&action=edit
PoC input

There is a memory leak bug according to output of Valgrind.

This bug is found in git commit: 1aa7f807d239dc32433e5f10840cdc8e80824c64

Compile the target:
CFLAGS="-DFORTIFY_SOURCE=2 -fno-omit-frame-pointer -g -Wno-error" \
./configure \
--disable-shared --disable-gdb --disable-libdecnumber --disable-readline \
--disable-sim

To trigger the bug:
valgrind --leak-check=full ./objdump -d test-input

The output of Valgrind:    
==6416== Memcheck, a memory error detector
==6416== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==6416== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info
==6416== Command: ./objdump -d ../../objdump-input/input.15104
==6416== 
./objdump: warning: ../../objdump-input/input.15104 has a corrupt section with
a size (8000258) larger than the file size

../../objdump-input/input.15104:     file format elf64-x86-64

./objdump: ../../objdump-input/input.15104: file truncated
==6416== 
==6416== HEAP SUMMARY:
==6416==     in use at exit: 447,435,832 bytes in 24 blocks
==6416==   total heap usage: 288 allocs, 264 frees, 715,909,380 bytes allocated
==6416== 
==6416== 776 bytes in 2 blocks are definitely lost in loss record 10 of 22
==6416==    at 0x483874F: malloc (in
/usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==6416==    by 0x1DAB2D: bfd_malloc (libbfd.c:275)
==6416==    by 0x1F3629: elf_x86_64_get_synthetic_symtab (elf64-x86-64.c:4727)
==6416==    by 0x171412: dump_bfd (objdump.c:4047)
==6416==    by 0x1716F1: display_object_bfd (objdump.c:4132)
==6416==    by 0x17195B: display_any_bfd (objdump.c:4222)
==6416==    by 0x1719CF: display_file (objdump.c:4243)
==6416==    by 0x17239A: main (objdump.c:4561)
==6416== 
==6416== 44,739,824 bytes in 1 blocks are possibly lost in loss record 20 of 22
==6416==    at 0x483874F: malloc (in
/usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==6416==    by 0x1DAB2D: bfd_malloc (libbfd.c:275)
==6416==    by 0x1F9356: _bfd_x86_elf_get_synthetic_symtab (elfxx-x86.c:2177)
==6416==    by 0x1F3C5F: elf_x86_64_get_synthetic_symtab (elf64-x86-64.c:4839)
==6416==    by 0x171412: dump_bfd (objdump.c:4047)
==6416==    by 0x1716F1: display_object_bfd (objdump.c:4132)
==6416==    by 0x17195B: display_any_bfd (objdump.c:4222)
==6416==    by 0x1719CF: display_file (objdump.c:4243)
==6416==    by 0x17239A: main (objdump.c:4561)
==6416== 
==6416== LEAK SUMMARY:
==6416==    definitely lost: 776 bytes in 2 blocks
==6416==    indirectly lost: 0 bytes in 0 blocks
==6416==      possibly lost: 44,739,824 bytes in 1 blocks
==6416==    still reachable: 402,695,232 bytes in 21 blocks
==6416==         suppressed: 0 bytes in 0 blocks
==6416== Reachable blocks (those to which a pointer was found) are not shown.
==6416== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==6416== 
==6416== For counts of detected and suppressed errors, rerun with: -v
==6416== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)

The PoC input is attached.

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]