Bug 805447 - eu-unstrip emits garbage for librt.so.1
eu-unstrip emits garbage for librt.so.1
Product: Fedora
Classification: Fedora
Component: elfutils (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Roland McGrath
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2012-03-21 06:36 EDT by Mads Kiilerich
Modified: 2012-07-10 17:01 EDT (History)
5 users (show)

See Also:
Fixed In Version: elfutils-0.153-2.fc17
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-04-11 22:55:33 EDT
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 Mads Kiilerich 2012-03-21 06:36:34 EDT
[root@dev-mk ~]# eu-unstrip --core=/var/spool/abrt/ccpp-2012-03-20-20:03:15-30358/coredump -n
0x8048000+0x5000 afb7cbc99623149a977db56d6459558c76f34cb9@0x8048198 - - [exe]
0xb76fb000+0x1000 241c1b10341666dce64db4e33d343f218c0a19bc@0xb76fb210 . - linux-gate.so.1
0xb7661000+0x99000 381325400081344e94d1a8d6d06c5211b6aeaac7@0xb7661124 /usr/lib/gnome-shell/libgnome-shell.so - libgnome-shell.so
/lib/libXcomposite.so.1 - libXcomposite.so.1
0xb686e000+0x5000 96bc916348339f3d8b48161d58fb1445c2ab5787@0xb686e124 /lib/libgmodule-2.0.so.0 - libgmodule-2.0.so.0
0xb6865000+0x9000 53aa4cda7be9b800a82c2b4b511bc01605bb8ce6@0xb6865164 /lib/librt.so.1 - librt.so.���

0xb685f000+0x6000 1d6d247cb1c1dc86b34ab960d58c82d7cce35e15@0xb685f124 /lib/libXfixes.so.3 - libXfixes.so.3
0xb6824000+0x3b000 eadfee09bfef04ff0c96410a7ac976f2ed0c593c@0xb6824124 /lib/libcroco-0.6.so.3 - libcroco-0.6.so.3
0xb66d5000+0x14f000 346c7f8a791cd1b7be07bfff6f849d658d506a17@0xb66d5124 /lib/libxml2.so.2 - libxml2.so.2

This causes bug 804309 where abrt can't report crashes. It thus makes it harder to report and fix other more serious bugs. 

Comment 1 Petr Machata 2012-03-21 07:38:59 EDT
Would you please attach a core dump that reproduces this behavior, if practical?  If it's huge even after compression, would you put it up somewhere on the Internet for us to download?
Comment 2 Mads Kiilerich 2012-03-21 08:21:47 EDT
Comment 3 Mark Wielaard 2012-03-28 06:18:54 EDT
The garbage is the name of the Dwfl_Module for librt.so which doesn't seem to be zero terminated:

2125	  printf ("%#" PRIx64 "+%#" PRIx64 " ", start, end - start);
2: name = 0x61cd00 "librt.so.\206\004\203\005\002\267\n\303A\306A\307A\305\f\004\004H\vk\n\303A\306A\307A\305\f\004\004A\v"
1: id_len = 20
(gdb) print /x start
$1 = 0xb6865000
(gdb) print /x end
$2 = 0xb686e000
Comment 4 Roland McGrath 2012-03-28 13:26:18 EDT
The situation is that the .dynstr of librt.so available in the image is truncated, because only the first page of librt.so in the image.  There was a bug in the code that handles an embedded .dynstr so that it wasn't noticing when the image was truncated.  I fixed it with upstream commit 210c2f0.

It should be straightforward to produce a small test case for the test suite, because anything that links in librt.so (or anything else whose .dynstr starts in its first page and ends past it, with the DT_SONAME string crossing that boundary) will produce a core file with this situation.
Comment 5 Mark Wielaard 2012-04-02 18:26:52 EDT
I added a testcase:

commit 96a52138eab04f24a86c78e8f2af9c74c2d6bfaf
Author: Mark Wielaard <mjw@redhat.com>
Date:   Tue Apr 3 00:21:50 2012 +0200

    Add new run-unstrip-n.sh test for RHBZ#805447 fixed in commit 210c2f.
Comment 6 Fedora Update System 2012-04-02 18:58:28 EDT
elfutils-0.153-2.fc17 has been submitted as an update for Fedora 17.
Comment 7 Fedora Update System 2012-04-04 17:09:34 EDT
Package elfutils-0.153-2.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing elfutils-0.153-2.fc17'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
Comment 8 Fedora Update System 2012-04-11 22:55:33 EDT
elfutils-0.153-2.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 9 Fedora Update System 2012-06-25 05:08:16 EDT
elfutils-0.154-1.fc16 has been submitted as an update for Fedora 16.
Comment 10 Fedora Update System 2012-07-10 17:01:20 EDT
elfutils-0.154-1.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.

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