Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 484809 - [RHEL5] bash includes Control-D in "bad ELF interpreter" message
[RHEL5] bash includes Control-D in "bad ELF interpreter" message
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: bash (Show other bugs)
5.3
All Linux
low Severity medium
: rc
: ---
Assigned To: Roman Rakus
BaseOS QE
:
Depends On:
Blocks: 516039
  Show dependency treegraph
 
Reported: 2009-02-09 19:26 EST by John W. Lockhart
Modified: 2014-01-12 19:08 EST (History)
6 users (show)

See Also:
Fixed In Version: bash-3.2-27.el5
Doc Type: Bug Fix
Doc Text:
Bash attempted to interpret the NOBITS .dynamic section of the ELF header. This resulted in a "^D: bad ELF interpreter: No such file or directory" message. This is fixed to ensure that the invalid "^D" does not appear in the error message.
Story Points: ---
Clone Of:
: 516039 (view as bug list)
Environment:
Last Closed: 2011-07-21 06:38:22 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:1073 normal SHIPPED_LIVE Low: bash security, bug fix, and enhancement update 2011-07-21 06:37:04 EDT

  None (edit)
Description John W. Lockhart 2009-02-09 19:26:58 EST
Description of problem:

# ldd /usr/lib/debug/usr/bin/foomatic-combo-xml.debug
/usr/bin/ldd: /usr/lib/debug/usr/bin/foomatic-combo-xml.debug: ^D: bad ELF interpreter: No such file or directory

That's a literal Control-D in the output.

Version-Release number of selected component (if applicable):
glibc-common-2.5-24.ia64
ldd (GNU libc) 2.5

How reproducible:

Try invoking ldd on any debug file that the file command (or eu-readelf)
considers to be a shared entity.  I used foomatic-combo-xml.debug above.

I tried it first on ia64, but was able to reproduce it on i386 easily, as well.


Actual results:
/usr/bin/ldd: /usr/lib/debug/usr/bin/foomatic-combo-xml.debug: ^D: bad ELF interpreter: No such file or directory

Expected results:
Either list the linkage of the shared object, or provide an error
message in the same format as when a statically linked executable
is found (with multiple-file input), like so:

/usr/lib/debug/usr/bin/foomatic-combo-xml.debug: 
     bad ELF interpreter: No such file or directory

The Control-D makes it a bit tricky for any tests that
are invoking ldd on likely targets (ELF entities as detected
by 'file' and/or eu-readelf) to check that all required files
are present (e.g., no unresolved symbols).

Additional information:

# eu-readelf -h /usr/lib/debug/usr/bin/foomatic-combo-xml.debug
ELF Header:
  Magic:   7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
  Class:                             ELF64
  Data:                              2's complement, little endian
  Ident Version:                     1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              EXEC (Executable file)
  Machine:                           Intel IA-64
  Version:                           1 (current)
  Entry point address:               0x40000000000011e0
  Start of program headers:          64 (bytes into file)
  Start of section headers:          49968 (bytes into file)
  Flags:                             0x10
  Size of this header:               64 (bytes)
  Size of program header entries:    56 (bytes)
  Number of program headers entries: 8
  Size of section header entries:    64 (bytes)
  Number of section headers entries: 42
  Section header string table index: 39

# readelf -Wa /usr/lib/debug/usr/bin/foomatic-combo-xml.debug 2>&1 | grep -e '\.dynamic'
readelf: Warning: the .dynamic section is not contained within the dynamic segment
ELF Header:
  [21] .dynamic          NOBITS          600000000000e330 000220 0001e0 10  WA  5   0  8

Comment from Jan Kratochvil (via IRC):
You are right there is a "bug" in ldd - it should not try to intepret NOBITS .dynamic section as it finds random garbage there.  But in fact is is not a Bug as ldd just runs ld.so and this shared libraries printing is done by the executable itself - so it is printed from the runtime information

Workaround (thanks to Jan):
  If you run `eu-readelf -S' and find .dynamic as NOBITS, do not run ldd
on the file, as that would likely trigger this particular problem.
Comment 1 Jakub Jelinek 2009-02-11 05:10:54 EST
The dynamic linker doesn't know that .dynamic is SHT_NOBITS, section header table isn't allocated.  So it would need to be ldd shell script that would run readelf -S first.
Comment 2 Andreas Schwab 2009-06-25 10:20:49 EDT
The message comes from bash, after execve returned with an error.
Comment 3 Roman Rakus 2009-08-04 09:47:42 EDT
I can't reproduce it with bash-3.2-24.el5
Comment 4 Roman Rakus 2009-08-06 06:35:24 EDT
Now I'm able to reproduce it in RHEL 5.2 with:
bash-3.2-21.el5
glibc-common-2.5-24
foomatic-3.0.2-38.3.el5
Comment 5 Roman Rakus 2009-08-06 09:30:41 EDT
Actually there is two bugs.
1) ldd shouldn't try to execute directly /usr/lib/debug/usr/bin/foomatic-combo-xml.debug
2) bash should test if ELF is PROGBITS or NOBITS

I will clone this bug for ldd
Comment 6 RHEL Product and Program Management 2009-11-06 13:59:01 EST
This request was evaluated by Red Hat Product Management for
inclusion, but this component is not scheduled to be updated in
the current Red Hat Enterprise Linux release. If you would like
this request to be reviewed for the next minor release, ask your
support representative to set the next rhel-x.y flag to "?".
Comment 8 RHEL Product and Program Management 2010-08-09 15:06:21 EDT
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.
Comment 10 Roman Rakus 2011-02-21 11:38:08 EST
Fixed in bash-3.2-27.el5
Comment 13 Misha H. Ali 2011-04-20 04:59:58 EDT
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Bash attempted to interpret the NOBITS .dynamic section of the ELF header. This resulted in an invalid "^D: bad ELF interpreter: No such file or directory" message. This is fixed to ensure that the invalid "^D" does not appear.
Comment 14 Misha H. Ali 2011-04-20 20:12:31 EDT
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-Bash attempted to interpret the NOBITS .dynamic section of the ELF header. This resulted in an invalid "^D: bad ELF interpreter: No such file or directory" message. This is fixed to ensure that the invalid "^D" does not appear.+Bash attempted to interpret the NOBITS .dynamic section of the ELF header. This resulted in a "^D: bad ELF interpreter: No such file or directory" message. This is fixed to ensure that the invalid "^D" does not appear in the error message.
Comment 15 errata-xmlrpc 2011-07-21 06:38:22 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-1073.html

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