diff options
| author | Dodji Seketeli <[email protected]> | 2015-08-13 15:59:41 +0200 |
|---|---|---|
| committer | Mark Wielaard <[email protected]> | 2015-08-14 16:44:42 +0200 |
| commit | b901b5e742e03d781fe9b6ecf030d6d297948018 (patch) | |
| tree | 374559ff13e353d2a638177def1e5db30acc10eb /libdwfl/ChangeLog | |
| parent | d950fcd511c79193ff1ed9a994826d6bb61e77c1 (diff) | |
Fix finding split debug info files not located by the build-id mechanism
[This bug has been found by using elfutils in the context of
libabigail. The initial bug report is
https://sourceware.org/bugzilla/show_bug.cgi?id=18792. The
interesting comments start at is
https://sourceware.org/bugzilla/show_bug.cgi?id=18792#c4]
suppose we have a debug info file that is located at a
/prefix1/usr/lib/debug/prefix2/libfoo.so. Suppose also that the debug
info describes a binary that is located at /prefix1/prefix2/libfoo.so
Suppose the debug_link property inside the binary
/prefix1/prefix2/libfoo.so correctly contains the string "libfoo.so"
that designates the name of the debug info file.
The problem is, when find_debuginfo_in_path() is called with its
file_name parameter set to "/prefix1/prefix2/libfoo.so" and
mod->dwfl->callbacks->debuginfo_path set to
"/prefix1/lib/debug/", it fails to locate the debug
info file libfoo.so under "/prefix1/usr/lib/debug/prefix2/".
This patch fixes the issue by making find_debuginfo_in_path() try all
the sub-strings of "/prefix1/prefix2/libfoo.so "under"
"/prefix1/usr/lib/debug/", to find libfoo.so. That is, it tries, in
order:
- /prefix1/usr/lib/debug/prefix1/prefix2/libfoo.so
- /prefix1/usr/lib/debug/prefix2/libfoo.so <-- and boom, it finds it!
Note that the patch tries the variations between the two candidates
above too.
The patch uses a goto. I dislike gotos like anyone else, but then
here, not using this would imply a bigger change of the logic of that
function. So I am proposing the scheme based on the goto instead.
* libdwfl/find-debuginfo.c (find_debuginfo_in_path): Try to locate
the debug info file named debuglink_file under
mod->dwfl->callbacks->debuginfo_path, by looking at the set of
sub-trees under mod->dwfl->callbacks->debuginfo_path which is
common to the set of non-absolute parent trees of file_name.
https://bugzilla.redhat.com/show_bug.cgi?id=1253367
Signed-off-by: Dodji Seketeli <[email protected]>
Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'libdwfl/ChangeLog')
| -rw-r--r-- | libdwfl/ChangeLog | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index 5059be6d..3e36aa75 100644 --- a/libdwfl/ChangeLog +++ b/libdwfl/ChangeLog @@ -1,3 +1,12 @@ +2015-08-14 Dodji Seketeli <[email protected]> + + * find-debuginfo.c (find_debuginfo_in_path): Try to locate the + debug info file named debuglink_file under + mod->dwfl->callbacks->debuginfo_path, by looking at + the set of sub-trees under mod->dwfl->callbacks->debuginfo_path + which is common to the set of non-absolute parent trees of + file_name. + 2015-06-18 Mark Wielaard <[email protected]> * find-debuginfo.c (try_open): Free fname on all failure paths. |
