-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
file_name is often missing in CCpp uReport frames #127
Comments
I have no idea why this happens. Can you perhaps send me some more reports like this? Perhaps we'll be able to spot some pattern. |
From 1224 reports (only ureport 2 considered):
Missing
I'm planning to investitgate whether we can prevent this situation. What about the VDSO, is this alright or should it also be fixed? (2013-11-06 update: frames below main/__libc_start_main) |
Note: it looks like all the reports used GDB for unwinding satyr versions: |
Re: the core dump you sent me that reproduces this problem I wrote a script to print out this library list (it requires git version of pyelftools): http://mmilata.fedorapeople.org/core-link-map.py
The problem seems to be that the Curiously:
It would be great if we could get our hands on couple more of coredumps with this issue. I'll try to workaround this so that the unwinding does not depent on the internal shared library list (we should be able to get this information from the maps file instead). |
Until now, elfutils used dynamic loader internal structure to find the shared libraries needed for unwinding and symbol resolution. This structure was sometimes damaged and it seems that getting this info from the maps file is more reliable in some other cases as well (vdso). Related #127. Signed-off-by: Martin Milata <[email protected]>
Consistent with the sr_parse_coredump stub function. (Implementation note: the sr_parse_coredump wrapper was moved to core_unwind.c in order not to have it duplicated three times.) Related to #127. Signed-off-by: Martin Milata <[email protected]>
I analyzed couple of core dumps with this issue and the causes I was able to determine are following:
I'd like to revisit this bug in the future after these fixes are in effect for some time so I'm keeping it open. |
Related to abrt/satyr#127 and rhbz#1129777. Signed-off-by: Martin Milata <[email protected]>
Related to abrt/satyr#127 and rhbz#1129777. Signed-off-by: Martin Milata <[email protected]>
Related to abrt/satyr#127 and rhbz#1129777. Signed-off-by: Martin Milata <[email protected]>
Related to abrt/satyr#127 and rhbz#1129777. Signed-off-by: Martin Milata <[email protected]>
Martin Milata: ------------------------------------------------------------------------------ RFE: dwfl_core_file_report: use NT_FILE core note if the link_map chain is broken https://bugzilla.redhat.com/show_bug.cgi?id=1129777 The dwfl_core_file_report function follows dynamic linker's link_map chain in order to determine the shared libraries used by the executable. As this data structure is located in writable memory it can be overwritten by garbage, which is sometimes the case. abrt/satyr#127 (comment) Since version 3.7 (commit 2aa362c49), Linux kernel adds NT_FILE note to core files which contains the files mapped by the process, including shared libraries. ------------------------------------------------------------------------------ dwfl_core_file_report now tries to fall back on NT_FILE if the link_map chain is broken. elfutils would already find the appropriate binary file from /usr/lib/debug/.build-id/ symbolic links. But those symbolic links do not have to be present on the system while NT_FILE still points to the correct binaries. Filenames from the note NT_FILE are used only if link_map filenames failed to locate matching binaries. tests/test-core.core.bz2 had to have its NT_FILE disabled as run-unstrip-n.sh otherwise FAILs: FAIL: 0x7f67f2aaf000+0x202000 - . - /home/jkratoch/redhat/elfutils-libregr/test-core-lib.so PASS: 0x7f67f2aaf000+0x202000 - . - test-core-lib.so As test-core-lib.so is found in link_map but it is not present on the disk elfutils now chooses the more reliable filename from NT_FILE (although that filename is also not found on the disk). Updating the expected text would be also sufficient. libdwfl/ 2014-09-18 Jan Kratochvil <[email protected]> Support NT_FILE for locating files. * core-file.c (dwfl_core_file_report): New variables note_file and note_file_size, set them and pass them to dwfl_segment_report_module. * dwfl_segment_report_module.c: Include common.h and fcntl.h. (buf_has_data, buf_read_ulong, handle_file_note): New functions. (invalid_elf): New function from code of dwfl_segment_report_module. (dwfl_segment_report_module): Add parameters note_file and note_file_size. New variables elf and fd, clean them up in finish. Move some code to invalid_elf. Call handle_file_note, if it found a name verify the file by invalid_elf. Protect elf and fd against cleanup by finish if we found the file for new Dwfl_Module. * libdwflP.h (dwfl_segment_report_module): Add parameters note_file and note_file_size. tests/ 2014-09-18 Jan Kratochvil <[email protected]> Support NT_FILE for locating files. * Makefile.am (TESTS): Add run-linkmap-cut.sh. (EXTRA_DIST): Add run-linkmap-cut.sh, linkmap-cut-lib.so.bz2, linkmap-cut.bz2 and linkmap-cut.core.bz2 . * linkmap-cut-lib.so.bz2: New file. * linkmap-cut.bz2: New file. * linkmap-cut.core.bz2: New file. * run-linkmap-cut.sh: New file. * test-core.core.bz2: Disable its NT_FILE note. Signed-off-by: Jan Kratochvil <[email protected]>
Martin Milata: ------------------------------------------------------------------------------ RFE: dwfl_core_file_report: use NT_FILE core note if the link_map chain is broken https://bugzilla.redhat.com/show_bug.cgi?id=1129777 The dwfl_core_file_report function follows dynamic linker's link_map chain in order to determine the shared libraries used by the executable. As this data structure is located in writable memory it can be overwritten by garbage, which is sometimes the case. abrt/satyr#127 (comment) Since version 3.7 (commit 2aa362c49), Linux kernel adds NT_FILE note to core files which contains the files mapped by the process, including shared libraries. ------------------------------------------------------------------------------ dwfl_core_file_report now tries to fall back on NT_FILE if the link_map chain is broken. elfutils would already find the appropriate binary file from /usr/lib/debug/.build-id/ symbolic links. But those symbolic links do not have to be present on the system while NT_FILE still points to the correct binaries. Filenames from the note NT_FILE are used only if link_map filenames failed to locate matching binaries. tests/test-core.core.bz2 had to have its NT_FILE disabled as run-unstrip-n.sh otherwise FAILs: FAIL: 0x7f67f2aaf000+0x202000 - . - /home/jkratoch/redhat/elfutils-libregr/test-core-lib.so PASS: 0x7f67f2aaf000+0x202000 - . - test-core-lib.so As test-core-lib.so is found in link_map but it is not present on the disk elfutils now chooses the more reliable filename from NT_FILE (although that filename is also not found on the disk). Updating the expected text would be also sufficient. libdwfl/ 2014-09-26 Jan Kratochvil <[email protected]> Support NT_FILE for locating files. * core-file.c (dwfl_core_file_report): New variables note_file and note_file_size, set them and pass them to dwfl_segment_report_module. * dwfl_segment_report_module.c: Include common.h and fcntl.h. (buf_has_data, buf_read_ulong, handle_file_note): New functions. (invalid_elf): New function from code of dwfl_segment_report_module. (dwfl_segment_report_module): Add parameters note_file and note_file_size. New variables elf and fd, clean them up in finish. Move some code to invalid_elf. Call handle_file_note, if it found a name verify the file by invalid_elf. Protect elf and fd against cleanup by finish if we found the file for new Dwfl_Module. * libdwflP.h (dwfl_segment_report_module): Add parameters note_file and note_file_size. tests/ 2014-09-26 Jan Kratochvil <[email protected]> Support NT_FILE for locating files. * Makefile.am (TESTS): Add run-linkmap-cut.sh. (EXTRA_DIST): Add run-linkmap-cut.sh, linkmap-cut-lib.so.bz2, linkmap-cut.bz2 and linkmap-cut.core.bz2 . * linkmap-cut-lib.so.bz2: New file. * linkmap-cut.bz2: New file. * linkmap-cut.core.bz2: New file. * run-linkmap-cut.sh: New file. * run-unstrip-n.sh: Update its expected output. Signed-off-by: Jan Kratochvil <[email protected]>
Martin Milata: ------------------------------------------------------------------------------ RFE: dwfl_core_file_report: use NT_FILE core note if the link_map chain is broken https://bugzilla.redhat.com/show_bug.cgi?id=1129777 The dwfl_core_file_report function follows dynamic linker's link_map chain in order to determine the shared libraries used by the executable. As this data structure is located in writable memory it can be overwritten by garbage, which is sometimes the case. abrt/satyr#127 (comment) Since version 3.7 (commit 2aa362c49), Linux kernel adds NT_FILE note to core files which contains the files mapped by the process, including shared libraries. ------------------------------------------------------------------------------ dwfl_core_file_report now tries to fall back on NT_FILE if the link_map chain is broken. elfutils would already find the appropriate binary file from /usr/lib/debug/.build-id/ symbolic links. But those symbolic links do not have to be present on the system while NT_FILE still points to the correct binaries. Filenames from the note NT_FILE are used only if link_map filenames failed to locate matching binaries. tests/test-core.core.bz2 had to have its NT_FILE disabled as run-unstrip-n.sh otherwise FAILs: FAIL: 0x7f67f2aaf000+0x202000 - . - /home/jkratoch/redhat/elfutils-libregr/test-core-lib.so PASS: 0x7f67f2aaf000+0x202000 - . - test-core-lib.so As test-core-lib.so is found in link_map but it is not present on the disk elfutils now chooses the more reliable filename from NT_FILE (although that filename is also not found on the disk). Updating the expected text would be also sufficient. libdwfl/ 2014-09-09 Jan Kratochvil <[email protected]> Support NT_FILE for locating files. * core-file.c (dwfl_core_file_report): New variables note_file and note_file_size, set them and pass them to dwfl_segment_report_module. * dwfl_segment_report_module.c: Include common.h and fcntl.h. (buf_has_data, buf_read_ulong, handle_file_note): New functions. (invalid_elf): New function from code of dwfl_segment_report_module. (dwfl_segment_report_module): Add parameters note_file and note_file_size. New variables elf and fd, clean them up in finish. Move some code to invalid_elf. Call handle_file_note, if it found a name verify the file by invalid_elf. Protect elf and fd against cleanup by finish if we found the file for new Dwfl_Module. * libdwflP.h (dwfl_segment_report_module): Add parameters note_file and note_file_size. tests/ 2014-09-09 Jan Kratochvil <[email protected]> Support NT_FILE for locating files. * Makefile.am (TESTS): Add run-linkmap-cut.sh. (EXTRA_DIST): Add run-linkmap-cut.sh, linkmap-cut-lib.so.bz2, linkmap-cut.bz2 and linkmap-cut.core.bz2 . * linkmap-cut-lib.so.bz2: New file. * linkmap-cut.bz2: New file. * linkmap-cut.core.bz2: New file. * run-linkmap-cut.sh: New file. * test-core.core.bz2: Disable its NT_FILE note. Signed-off-by: Jan Kratochvil <[email protected]>
Example:
The text was updated successfully, but these errors were encountered: