Bug 109495 - [patch] file hangs on an ELF binary
Summary: [patch] file hangs on an ELF binary
Alias: None
Product: Fedora
Classification: Fedora
Component: file   
(Show other bugs)
Version: 1
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Radek Vokal
QA Contact: Mike McLean
Depends On:
TreeView+ depends on / blocked
Reported: 2003-11-08 17:45 UTC by Tim Waugh
Modified: 2007-11-30 22:10 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-08-13 08:48:02 UTC
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 15:17 UTC, Tim Waugh
no flags Details | Diff
file-offset.patch (4.17 KB, patch)
2003-11-11 15:42 UTC, Tim Waugh
no flags Details | Diff

Description Tim Waugh 2003-11-08 17:45:46 UTC
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 17:56:16 UTC

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

(This issue is blocking an errata build.)

Comment 2 Tim Waugh 2003-11-09 15:17:21 UTC
Created attachment 95847 [details]

This patch fixes it for me.

Comment 3 Tim Waugh 2003-11-11 15:42:15 UTC
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 23:34:36 UTC
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-08 00:14:07 UTC
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-19 02:29:28 UTC
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 05:02:29 UTC
file hangs when running:

$file /usr/sbin/cpuspeed

using the latest FC2Test3 with the latest updates applied.

Comment 8 Jakub Jelinek 2004-05-10 12:32:52 UTC
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 13:59:09 UTC
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 19:40:22 UTC
this bug seems to be fixed now

Comment 11 Radek Vokal 2004-08-13 08:48:02 UTC
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.