Description of problem: Without /usr/lib/debug/.build-id eu-readelf no longer works. Version-Release number of selected component (if applicable): elfutils-0.155-1.fc18.x86_64 24b26ec1aaf4dc87d274f1786a1ad83b3ec2ba25 How reproducible: Always. Steps to Reproduce: rm -rf /usr/lib/debug/.build-id eu-readelf -w /usr/lib/debug/usr/bin/cal.debug Actual results: open("../../.dwz/util-linux-2.22.2-6.fc18.x86_64", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/lib/debug/.build-id/7c/7d537396447a43f436aed7d86c51da3c404cd6.debug", O_RDONLY) = -1 ENOENT (No such file or directory) eu-readelf: cannot get attribute value: no alternative debug link found eu-readelf: cannot get attribute value: no alternative debug link found eu-readelf: cannot get attribute value: no alternative debug link found Expected results: open("/usr/lib/debug/usr/bin/../../.dwz/util-linux-2.22.2-6.fc18.x86_64", O_RDONLY) = 42 Additional info: The .gnu_debugaltlink filename was IMO meant to be relative to the parent .debug file. This affects uninstalled debug infos.
> rm -rf /usr/lib/debug/.build-id May I suggest you don't do that :) Could you give an actual example (where the user doesn't blow away the system .build-id directory)? I do think this is a bug. But I am wondering how common this is. In general dwz is a system/packager tool, installing .debug and dwz multi files without corresponding build-ids would normally be a packaging bug. .gnu_debugaltlink being relative to the .debug file makes sense. But that is somewhat hard to get at in general. We don't know where the given Elf for a Dwarf comes from (it might not even be a file). The original design had new libdw methods dwarf_getalt () and dwarf_addalt () that let you set it on a new Dwarf. Those didn't make it in the final patch. We might have to introduce those then, so eu-readelf can use them to explicitly set when they cannot be found by build-id. See https://lists.fedorahosted.org/pipermail/elfutils-devel/2012-June/002352.html for the original design including those methods.
(In reply to Mark Wielaard from comment #1) > Could you give an actual example (where the user doesn't blow away the > system .build-id directory)? rpmbuildlocal -bb prelink.spec exx prelink-debuginfo-0.5.0-1.fc19.x86_64.rpm eu-readelf --debug-dump=info prelink-debuginfo-0.5.0-1.fc19.x86_64/usr/lib/debug/usr/sbin/prelink.debug The first two lines are custom scripts with obvious functionality. So Dwarf maybe should contain its filename.
This message is a reminder that Fedora 18 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 18. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '18'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 18's end of life. Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 18 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior to Fedora 18's end of life. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
This is still an issue as discussed in a recent thread on elfutils-devel: https://lists.fedorahosted.org/pipermail/elfutils-devel/2013-December/thread.html#3585
This was fixed in elfutils 0.159. libdw: Support for DWZ multifile forms DW_FORM_GNU_ref_alt and DW_FORM_GNU_strp_alt is now enabled by default and no longer experimental. Added new functions dwarf_getalt and dwarf_setalt to get or set the alternative debug file used for the alt FORMs. libdwfl: The dwfl_build_id_find_debuginfo and dwfl_standard_find_debuginfo functions will now try to resolve and set the alternative debug file. That last change makes sure that if the build-id based approach doesn't work the fallback using a relative path name is used. eu-readelf uses libdwfl to open the .debug file and so gets the dwz alt-file resolved automagically. With elfutils-0.159-1.fc21.x86_64, util-linux-debuginfo-2.25-0.2.fc21.x86_64 and sudo mv /usr/lib/debug/.build-id /usr/lib/debug/no.build-id $ strace -e trace=open eu-readelf --debug-dump=info /usr/lib/debug/usr/bin/cal.debug open("/usr/lib/debug/.build-id/46/828366f0fe68634cfc16f27440598388d7b3df.debug", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/lib/debug/usr/bin/../../.dwz/util-linux-2.25-0.2.fc21.x86_64", O_RDONLY) = 4