diff options
| author | Mark Wielaard <[email protected]> | 2015-06-06 15:06:22 +0200 |
|---|---|---|
| committer | Mark Wielaard <[email protected]> | 2015-06-08 11:18:14 +0200 |
| commit | c5022e5e3b74d579d44fcf599577e2a2a4c93f15 (patch) | |
| tree | 57a247bc0902fa3d8f88618994f3eaf6990b0954 | |
| parent | 560aa98b9aaa89ce345239de865eda0ba403af68 (diff) | |
libdwfl: Report core module segment even when NT_FILE build-id doesn't match.
dwfl_segment_report_module can take the NT_FILE note contents to find
the matching file for the module on the file system from the core file.
If the file exists but the build-id didn't match we would not report the
module. But we should just report the module anyway, ignore the file,
and try to match the ELF image another way.
This issue can be replicated by building and running make check in
/tmp/elfutils with run-backtrace-core-aarch64.sh since that core file
includes a NT_FILE note pointing to /tmp/elfutils/tests/backtrace-child.
Which won't match if it was just recompiled.
Signed-off-by: Mark Wielaard <[email protected]>
| -rw-r--r-- | libdwfl/ChangeLog | 6 | ||||
| -rw-r--r-- | libdwfl/dwfl_segment_report_module.c | 9 |
2 files changed, 13 insertions, 2 deletions
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index 4de38324..0daf893c 100644 --- a/libdwfl/ChangeLog +++ b/libdwfl/ChangeLog @@ -1,3 +1,9 @@ +2015-06-05 Mark Wielaard <[email protected]> + + * dwfl_segment_report_module.c (dwfl_segment_report_module): + If the note_file exists, but the build_id doesn't match discard + the file and continue reporting. + 2015-06-01 Mark Wielaard <[email protected]> * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Copy path diff --git a/libdwfl/dwfl_segment_report_module.c b/libdwfl/dwfl_segment_report_module.c index 705639d2..a0f07ada 100644 --- a/libdwfl/dwfl_segment_report_module.c +++ b/libdwfl/dwfl_segment_report_module.c @@ -696,8 +696,13 @@ dwfl_segment_report_module (Dwfl *dwfl, int ndx, const char *name, } if (invalid) { - free (build_id); - return finish (); + /* The file was there, but the build_id didn't match. We + still want to report the module, but need to get the ELF + some other way if possible. */ + close (fd); + fd = -1; + elf_end (elf); + elf = NULL; } } |
