Bug 849435 - phdrs wrong in .debug file
phdrs wrong in .debug file
Product: Fedora
Classification: Fedora
Component: prelink (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Jakub Jelinek
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2012-08-19 08:55 EDT by Mark Wielaard
Modified: 2012-09-25 12:36 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-08-29 04:45:34 EDT
Type: Bug
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 Mark Wielaard 2012-08-19 08:55:29 EDT
Take bash as example. bash-debuginfo-4.2.37-3.fc18.x86_64

$ eu-readelf -S /usr/lib/debug/usr/bin/bash.debug | grep NOTE
[ 2] .note.ABI-tag        NOTE         0000000000400254 00000238 00000020  0 A      0   0  4
[ 3] .note.gnu.build-id   NOTE         0000000000400274 00000258 00000024  0 A      0   0  4

$ eu-readelf -l /usr/lib/debug/usr/bin/bash.debug | grep NOTE
  NOTE           0x000254 0x0000000000400254 0x0000000000400254 0x000044 0x000044 R   0x4

The section header is correct, the first NOTE offset is 238. The program header offset is wrong.

This makes programs like valgrind which find the build-id through phdrs fail (I have a patch to make it use the shdr fallback in this case).
Comment 1 Fedora Update System 2012-08-19 14:51:37 EDT
valgrind-3.8.0-4.fc18 has been submitted as an update for Fedora 18.
Comment 2 Fedora Update System 2012-08-27 06:32:13 EDT
valgrind-3.8.0-5.fc18 has been submitted as an update for Fedora 18.
Comment 3 Fedora Update System 2012-08-27 12:30:00 EDT
Package valgrind-3.8.0-5.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing valgrind-3.8.0-5.fc18'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
Comment 4 Mark Wielaard 2012-08-28 17:36:10 EDT
Clearly I shouldn't have mentioned this bug in the valgrind package workaround. Sorry about the Fedora Update System noise.

As should be clear when I filed this bug, this isn't dwz. bash only has one .debug file, so dwz doesn't even run...

What is happening is that prelink comes along and rewrites the binary phdrs, while the .debug phdrs stay the same.

Reassigning to prelink.
Comment 5 Mark Wielaard 2012-08-29 04:45:34 EDT
Jakub explained: prelink doesn't by design adjust phdrs in the *.debug files, only in the binaries/libraries. After all, often the *-debuginfo* packages aren't even installed at all when prelinking. The phdrs in the *.debug files are there on purpose, tools using the *.debug files are supposed to compare the phdrs in the *.debug file with phdrs in the binary/executable and from that derive the prelinking bias and other shuffles prelink did.

So in general it is wrong to use phdrs in a .debug file to locate the build-id note. Use shdrs for that.
Comment 6 Fedora Update System 2012-09-17 19:39:49 EDT
valgrind-3.8.0-5.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 7 Fedora Update System 2012-09-20 20:52:52 EDT
valgrind-3.8.1-1.fc18 has been submitted as an update for Fedora 18.
Comment 8 Fedora Update System 2012-09-25 12:36:19 EDT
valgrind-3.8.1-1.fc18 has been pushed to the Fedora 18 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.