Bug 447416 - Segfault in eu-readelf on i386 reading an s390x binary
Segfault in eu-readelf on i386 reading an s390x binary
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: elfutils (Show other bugs)
i386 Linux
low Severity low
: rc
: ---
Assigned To: Roland McGrath
Depends On:
  Show dependency treegraph
Reported: 2008-05-19 16:43 EDT by Dave Malcolm
Modified: 2009-01-20 16:08 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-01-20 16:08:15 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Dave Malcolm 2008-05-19 16:43:41 EDT
Description of problem:
Segfault trying to run eu-readelf i386 on an s390x binary.

Version-Release number of selected component (if applicable):
elfutils-0.125-3.el5.i386, running on this OS:
Linux dhcp-100-3-213.bos.redhat.com 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:42:21
EST 2007 i686 i686 i386 GNU/Linux
(although the hardware is x86_64)

How reproducible:
100% for me

Steps to Reproduce:
1. Extract s390x payload thus:
mkdir payload; (cd payload; rpm2cpio ../krb5-1.6.1-17.el5.s390x | cpio -i -d )
2. gdb eu-readelf
3. (gdb) set args -d payload/usr/kerberos/sbin/krb5kdc
4. (gdb) run
Starting program: /usr/bin/eu-readelf -d payload/usr/kerberos/sbin/krb5kdc

Program received signal SIGSEGV, Segmentation fault.
0x44d8259e in elf64_offscn (elf=0x9c6e850, offset=102576) at elf32_offscn.c:89
89              if (runp->data[i].shdr.ELFW(e,LIBELFBITS)->sh_offset == offset)
(gdb) bt
#0  0x44d8259e in elf64_offscn (elf=0x9c6e850, offset=102576) at elf32_offscn.c:89
#1  0x44d82631 in gelf_offscn (elf=0x0, offset=102576) at gelf_offscn.c:77
#2  0x0804b577 in print_dynamic (ebl=0x9c6f4f8, ehdr=0xbfefbbe0) at readelf.c:1267
#3  0x08053a82 in process_elf_file (elf=0x9c6e850, prefix=0x0, fname=<value
optimized out>, only_one=true) at readelf.c:493
#4  0x08054755 in process_file (fd=6, elf=0x9c6e850, prefix=0x0, 
    fname=0xbfefd869 "payload/usr/kerberos/sbin/krb5kdc", only_one=true) at
#5  0x080548d3 in main (argc=3, argv=0xbfefbde4) at readelf.c:226
#6  0x467d3dec in __libc_start_main () from /lib/i686/nosegneg/libc.so.6
#7  0x08049c21 in _start ()
(gdb) p runp
$1 = (Elf_ScnList *) 0x926f8ec
(gdb) p runp->data
$2 = 0x926f8f8
(gdb) p i
$3 = 0
(gdb) p runp->data[i]
$4 = {data_list = {data = {d = {d_buf = 0x0, d_type = ELF_T_BYTE, d_version = 0,
d_size = 0, d_off = 0, d_align = 0}, s = 0x0}, next = 0x0, flags = 0}, 
  data_list_rear = 0x0, rawdata = {d = {d_buf = 0x0, d_type = ELF_T_BYTE,
d_version = 0, d_size = 0, d_off = 0, d_align = 0}, s = 0x0}, data_read = 0, 
  index = 0, elf = 0x926f850, shdr = {e32 = 0x0, e64 = 0x0}, shdr_flags = 0,
flags = 0, rawdata_base = 0x0, data_base = 0x0, list = 0x926f8ec}
(gdb) p runp->data[i].shdr
$5 = {e32 = 0x0, e64 = 0x0}
(gdb) p runp->data[i].shdr.ELFW(e, LIBELFBITS)
No symbol "e" in current context.
Comment 4 RHEL Product and Program Management 2008-06-02 15:58:30 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
Comment 6 Roland McGrath 2008-07-09 15:01:49 EDT
Fixed in upstream version 0.135.
Comment 11 errata-xmlrpc 2009-01-20 16:08:15 EST
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.


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