Red Hat Bugzilla – Bug 849435
phdrs wrong in .debug file
Last modified: 2012-09-25 12:36:19 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).
valgrind-3.8.0-4.fc18 has been submitted as an update for Fedora 18.
valgrind-3.8.0-5.fc18 has been submitted as an update for Fedora 18.
* 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).
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.
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.
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.
valgrind-3.8.1-1.fc18 has been submitted as an update for Fedora 18.
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.