Bug 805447

Summary: eu-unstrip emits garbage for librt.so.1
Product: [Fedora] Fedora Reporter: Mads Kiilerich <mads>
Component: elfutilsAssignee: Roland McGrath <roland>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: fche, mjw, mjw, pmachata, roland
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: elfutils-0.153-2.fc17 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-04-12 02:55:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Mads Kiilerich 2012-03-21 10:36:34 UTC
[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.���
�A�A�A�
       H
          k
�A�A�A�
       A

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. 

elfutils-0.153-1.fc17.i686

Comment 1 Petr Machata 2012-03-21 11:38:59 UTC
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 12:21:47 UTC
http://kiilerix.fedorapeople.org/coredump-805447.xz

Comment 3 Mark Wielaard 2012-03-28 10:18:54 UTC
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 17:26:18 UTC
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 22:26:52 UTC
I added a testcase:

commit 96a52138eab04f24a86c78e8f2af9c74c2d6bfaf
Author: Mark Wielaard <mjw>
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 22:58:28 UTC
elfutils-0.153-2.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/elfutils-0.153-2.fc17

Comment 7 Fedora Update System 2012-04-04 21:09:34 UTC
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:
https://admin.fedoraproject.org/updates/FEDORA-2012-5291/elfutils-0.153-2.fc17
then log in and leave karma (feedback).

Comment 8 Fedora Update System 2012-04-12 02:55:33 UTC
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 09:08:16 UTC
elfutils-0.154-1.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/elfutils-0.154-1.fc16

Comment 10 Fedora Update System 2012-07-10 21:01:20 UTC
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.