Menu

#463 strip(1) crash removing sections from empty .o

2.0
closed
Kai Wang
None
2014-12-21
2014-12-18
Ed Maste
No

From the binutils testsuite,

% touch empty.s
% make empty.o
% elfcopy/strip -R .text -R .data -R .bss -R .ARM.attributes -R .reginfo -R .gnu.attributes -R .MIPS.abiflags -R .pdr -R .xtensa.info empty.o
zsh: segmentation fault (core dumped)

  • thread #1: tid = 103274, 0x00000000004ad966 strip`memmove + 22 at bcopy.S:65, stop reason = invalid address (fault address: 0x10)
  • frame #0: 0x00000000004ad966 stripmemmove + 22 at bcopy.S:65 frame #1: 0x0000000000425679 stripset_shstrtab(ecp=0x0000000800c091c0) + 337 at sections.c:1242
    frame #2: 0x000000000040fa00 stripcreate_elf(ecp=0x0000000800c091c0) + 2376 at main.c:383 frame #3: 0x0000000000417482 stripcreate_file(ecp=0x0000000800c091c0, src=0x00007fffffffe82a, dst=0x00007fffffffe82a) + 2010 at main.c:655
    frame #4: 0x00000000004137a7 stripmain [inlined] strip_main(argc=<unavailable>, argv=<unavailable>) + 3242 at main.c:1119 frame #5: 0x0000000000412afd stripmain(argc=20, argv=0x00007fffffffe418) + 7189 at main.c:1490
    frame #6: 0x000000000040030f strip`_start(ap=<unavailable>, cleanup=<unavailable>) + 367 at crt1.c:78</unavailable></unavailable>

Discussion

  • Ed Maste

    Ed Maste - 2014-12-19

    One approach for a fix in review at https://reviews.freebsd.org/D1341

     
  • Kai Wang

    Kai Wang - 2014-12-20

    The fix looks good! Committed in [r3108]. Thanks!

    I also added a test case for this issue in [r3109].

     

    Related

    Commit: [r3108]
    Commit: [r3109]

  • Kai Wang

    Kai Wang - 2014-12-20
    • status: new --> closed
    • assigned_to: Kai Wang
     
  • Ed Maste

    Ed Maste - 2014-12-20

    On 20 December 2014 at 03:40, Kai Wang kaiwang27@users.sf.net wrote:

    Comment:

    The fix looks good! Committed in [r3108]. Thanks!

    Thank you! The s->buf == NULL test should not be necessary though
    since it was just calloc'd a few lines earlier.

     

    Related

    Commit: [r3108]

  • Kai Wang

    Kai Wang - 2014-12-21

    You're right! Fixed by [r3119].

     

    Related

    Commit: [r3119]


Log in to post a comment.

MongoDB Logo MongoDB