Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 109495 - [patch] file hangs on an ELF binary
[patch] file hangs on an ELF binary
Product: Fedora
Classification: Fedora
Component: file (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Radek Vokal
Mike McLean
Depends On:
  Show dependency treegraph
Reported: 2003-11-08 12:45 EST by Tim Waugh
Modified: 2007-11-30 17:10 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-08-13 04:48:02 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
file-offset.patch (401 bytes, patch)
2003-11-09 10:17 EST, Tim Waugh
no flags Details | Diff
file-offset.patch (4.17 KB, patch)
2003-11-11 10:42 EST, Tim Waugh
no flags Details | Diff

  None (edit)
Description Tim Waugh 2003-11-08 12:45:46 EST
Description of problem:
Trying to build vnc hangs in find-debuginfo.sh, in file:

#0  donote (ms=0x9990848, nbuf=0xbfebb9f0 "����G\211D$\b�\020", offset=0,
    size=8192, class=1, swap=0, align=136791912) at readelf.c:281
#1  0x00b4923f in dophn_exec (ms=0x9990848, class=1, swap=0, fd=6,
    off=587516788558334024, num=2, size=3219896816) at readelf.c:639
#2  0x00b4969d in file_tryelf (ms=0x9990848, fd=6, buf=0x0, nbytes=65537)
    at readelf.c:710
#3  0x00b431da in magic_file (ms=0x9990848, inname=0xbff98ba3 "Xvnc")
    at magic.c:259
#4  0x08049284 in process (inname=0xbff98ba3 "Xvnc", wid=0) at file.c:375
#5  0x08048f0a in main (argc=2, argv=0xbfecdd54) at file.c:302
Comment 1 Tim Waugh 2003-11-08 12:56:16 EST

ELF binary available at porkchop:~twaugh/Xvnc-109495

(This issue is blocking an errata build.)
Comment 2 Tim Waugh 2003-11-09 10:17:21 EST
Created attachment 95847 [details]

This patch fixes it for me.
Comment 3 Tim Waugh 2003-11-11 10:42:15 EST
Created attachment 95907 [details]

Here is a more complete patch to fix the other return value confusion bugs in
that function.
Comment 4 Bart Martens 2004-02-07 18:34:36 EST
Tim, I tried to reproduce the problem with file-4.02-2 and
- vnc-4.0-0.beta4.3.src.rpm
- vnc-4.0-0.beta4.3.2.src.rpm
but no "luck". What version of vnc were you rebuilding when you got
the problem?
Comment 5 Tim Waugh 2004-02-07 19:14:07 EST
I'm pretty sure it was vnc-4.0-0.beta4.3.2.  But you can see that the
code was wrong by inspection.
Comment 6 Ulrich Drepper 2004-03-18 21:29:28 EST
I got a hang with bcc as in dev86-0.16.15-1, od and tty as in
coreutils-5.2.1-3, pbmtogem and ppmtopcx as in netpbm-progs-10.19-6.1

These are all ELF files.  And it is on x86.  x86-64 works fine.
Comment 7 petrosyan 2004-05-01 01:02:29 EDT
file hangs when running:

$file /usr/sbin/cpuspeed

using the latest FC2Test3 with the latest updates applied.
Comment 8 Jakub Jelinek 2004-05-10 08:32:52 EDT
Seems ELF PT_NOTE parsing has been completely broken in file(1).
Please try ftp://people.redhat.com/jakub/file/
Comment 9 Tim Waugh 2004-05-10 09:59:09 EDT
With file-4.07-3, these files in /usr/bin caused hangs:

getconf magicfilter-t pbmtogem pgmmorphconv pilot-archive ppmtopcx

After updating to file-4.07-4 I can't find a file in /usr/bin/, /bin/,
/usr/sbin or /sbin that causes a hang.
Comment 10 petrosyan 2004-05-11 15:40:22 EDT
this bug seems to be fixed now
Comment 11 Radek Vokal 2004-08-13 04:48:02 EDT
Seems to be fixed in file-4.10-1. Tested on all files from /usr/bin
and /bin

Note You need to log in before you can comment on or make changes to this bug.