Bug 208880 - Pointless file(1) error message while detecting ELF 64-bit file
Pointless file(1) error message while detecting ELF 64-bit file
Product: Fedora
Classification: Fedora
Component: file (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Martin Bacovsky
: 207918 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2006-10-02 10:29 EDT by Jindrich Novy
Modified: 2013-07-02 19:17 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-01-09 14:30:31 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Testing file. (17.10 KB, application/octet-stream)
2006-10-02 10:30 EDT, Jindrich Novy
no flags Details
file-note-debuginfo.patch (2.45 KB, patch)
2006-10-17 10:48 EDT, Jakub Jelinek
no flags Details | Diff

  None (edit)
Description Jindrich Novy 2006-10-02 10:29:24 EDT
Description of problem:
file(1) reports message "bad note name size 0x80000da4" while recognizing file
format of some ELF 64bit files.

Version-Release number of selected component (if applicable):

How reproducible:
Run file(1) on the attached file.

Steps to Reproduce:
1. file 411toppm.debug
Actual results:
ELF 64-bit MSB executable, IBM S/390, version 1 (SYSV), bad note name size
0x80000da4, dynamically linked (uses shared libs), not stripped

Expected results:
ELF 64-bit MSB executable, IBM S/390, version 1 (SYSV), dynamically linked (uses
shared libs), not stripped

Additional info:
Erratum 2006:0651.
Comment 1 Jindrich Novy 2006-10-02 10:30:52 EDT
Created attachment 137546 [details]
Testing file.
Comment 2 Martin Bacovsky 2006-10-06 06:47:17 EDT
File checks, if note name size is greater then 0x80000000 if it is, file
complains. Do you have idea where to check whether note name size can be of such
Comment 3 Jakub Jelinek 2006-10-06 07:42:55 EDT
The file is the stripped-into-separate-file debuginfo, in which sections that
are present in the stripped file are made SHT_NOBITS and not present at all.
So, file needs to check for SHT_NOBITS .note sections and don't look at them
at all.  Currently it just reads some completely unrelated data (probably
part of one of the .debug_* sections).
Comment 4 Tim Waugh 2006-10-09 07:30:04 EDT
*** Bug 207918 has been marked as a duplicate of this bug. ***
Comment 6 Jakub Jelinek 2006-10-17 10:48:40 EDT
Created attachment 138685 [details]

Proposed patch.  While it would be possible to do what I proposed (i.e.
for each PT_NOTE look up in section header table in which section the virtual
address falls in and test if it is not SHT_NOBITS), this is far easier and
and has a nice side-effect that it doesn't duplication information in file
output.  Unpatched file will e.g. say:
file /bin/bash
/bin/bash: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for
GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9,
(note the .note.ABI-tag section being parsed and printed twice, once when found
through PT_NOTE, once when found through SHT_NOTE).  When the executable has
a section header table, then it is safe to assume that either there will be
a SHT_NOTE section corresponding to the PT_NOTE program header, or it will be
SHT_NOBITS in a debuginfo file (at which point it is not present).
Comment 7 Martin Bacovsky 2007-01-09 14:30:31 EST
Thanks for patch. I'm sorry for delay in resolving this issue. This problem
should be fixed in file-4.19-1.fc7.

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