public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: "leftcopy.chx at gmail dot com" <sourceware-bugzilla@sourceware.org>
To: elfutils-devel@sourceware.org
Subject: [Bug libelf/25083] New: Unexpected hangs at elf32_updatefile.c:518
Date: Tue, 08 Oct 2019 15:00:00 -0000	[thread overview]
Message-ID: <bug-25083-10460@http.sourceware.org/bugzilla/> (raw)

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

            Bug ID: 25083
           Summary: Unexpected hangs at elf32_updatefile.c:518
           Product: elfutils
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libelf
          Assignee: unassigned at sourceware dot org
          Reporter: leftcopy.chx at gmail dot com
                CC: elfutils-devel at sourceware dot org
  Target Milestone: ---

Created attachment 12034
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12034&action=edit
hang input file and gdb backtrace

When executing `./eu-unstrip $FILE ./stripped -o /dev/null` (git commit
47780c9e), it may cause unexpected hangs against some crafted input file $FILE. 

When interrupted, the gdb backtrace is like:

#0  0x00007ffff763e6e7 in __libc_pwrite64 (fd=fd@entry=5,
buf=buf@entry=0x7fffffff1b30, count=count@entry=4096,
offset=offset@entry=4640862844) at ../sysdeps/unix/sysv/linux/pwrite64.c:29
#1  0x00007ffff7bcabd0 in pwrite_retry (off=4640862844, len=4096,
buf=0x7fffffff1b30, fd=5) at ../lib/system.h:95
#2  fill (fd=<optimized out>, pos=4640862844, len=914482139140,
fillbuf=fillbuf@entry=0x7fffffff1b30 "", filledp=filledp@entry=0x7fffffff1ae0)
at elf32_updatefile.c:518
#3  0x00007ffff7bcbe86 in __elf64_updatefile (elf=elf@entry=0x555555765930,
change_bo=change_bo@entry=0, shnum=shnum@entry=38) at elf32_updatefile.c:728
#4  0x00007ffff7bc7e99 in write_file (shnum=38, change_bo=0, size=919123089320,
elf=0x555555765930) at elf_update.c:132
#5  elf_update (elf=0x555555765930, cmd=<optimized out>) at elf_update.c:231
#6  0x000055555555b64e in copy_elided_sections (unstripped=0x555555765930,
stripped=<optimized out>, stripped_ehdr=<optimized out>, bias=<optimized out>)
at unstrip.c:2074
#7  0x000055555555bb82 in handle_file (output_file=<optimized out>,
create_dirs=<optimized out>, stripped=0x555555761950,
stripped_ehdr=0x7fffffffc0c0, unstripped=0x555555763940)
    at unstrip.c:2162
#8  0x000055555555be97 in handle_explicit_files (output_file=0x7fffffffc9e1
"/tmp/test.file", create_dirs=<optimized out>, force=<optimized out>) at
unstrip.c:2227
#9  0x0000555555557b4b in main (argc=<optimized out>, argv=0x7fffffffc428) at
unstrip.c:2562

Relevant files are attached.

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

             reply	other threads:[~2019-10-08 15:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-08 15:00 leftcopy.chx at gmail dot com [this message]
2019-10-19 19:27 ` [Bug libelf/25083] " mark at klomp dot org
2019-10-20  3:43 ` leftcopy.chx at gmail dot com
2019-10-20 10:18 ` mark at klomp dot org
2019-10-20 15:24 ` mark at klomp dot org
2019-10-21 20:58 ` [Bug tools/25083] unstrip tries to write out an enormous amount of data mark at klomp dot org
2019-10-26  0:21 ` mark at klomp dot org
2020-07-28  4:46 ` meave390 at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-25083-10460@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=elfutils-devel@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).