Hi everyone, here is a short summary of the status of "ELF package notes" in Fedora, and a call for ideas what to do next. History: the original implementation that was approved for F36 used a linker script that injected a section in the ELF file with JSON text. This was causing build issues because the linker script file needed to be saved on disk which was awkward to do with the functionality that rpmbuild provides. For F37 we switched to a better implementation: various linkers implemented a new --package-metadata option, which replaces the linker script. The implementation in package-notes-srpm-macros.rpm is now a thin wrapper around that option [1]. This seems to work nicely, with the exception that clang does not support -specs, thus we disable the note in that case. The message in journal for a crash looks like the following [2,3]: systemd-coredump[274181]: [🡕] Process 274179 (bash) of user 1000 dumped core. Module libtinfo.so.6 from rpm ncurses-6.3-3.20220501.fc37.x86_64 Module bash from rpm bash-5.1.16-3.fc37.x86_64 Stack trace of thread 274179: #0 0x00007f94e5010d8b kill (libc.so.6 + 0x38d8b) #1 0x000055ae0fd6b6b1 kill_builtin (bash + 0xad6b1) #2 0x000055ae0fd0c227 execute_builtin.lto_priv.0 (bash + 0x4e227) #3 0x000055ae0fd05459 execute_simple_command (bash + 0x47459) #4 0x000055ae0fd06de0 execute_command_internal (bash + 0x48de0) #5 0x000055ae0fd657aa parse_and_execute (bash + 0xa77aa) #6 0x000055ae0fdc6b08 run_one_command.isra.0 (bash + 0x108b08) #7 0x000055ae0fcef07c main (bash + 0x3107c) #8 0x00007f94e4ffb510 __libc_start_call_main (libc.so.6 + 0x23510) #9 0x00007f94e4ffb5c9 __libc_start_main@@GLIBC_2.34 (libc.so.6 + 0x235c9) #10 0x000055ae0fcefd85 _start (bash + 0x31d85) ELF object binary architecture: AMD x86-64 The packaging information is extracted directly from the coredump, thus it should be shown for all Fedora packages. Processing happens locally, so you get this even if network is disabled or abrt is not active. I'd say that this is quite useful, and is essentially free. The biggest cost is the processing of the core dump. For programs with a lot of memory it can be quite expensive. Where should we go from here? - One long-standing RFE is to improve processing by doing the backtrace directly from memory, without writing the coredump do disk first (or even at all). This requires some expertise with libdw/libelf… We'd be very happy to take a patch for this. - What can we do to make the output more useful? - Should we integrate this with other tools? E.g. should abrt make use of this directly? Zbyszek [1] macros.package-notes-srpm adds -specs=/usr/lib/rpm/redhat/redhat-package-notes to build flags, and that file injects the --package-metedata option using variables like $RPM_PACKAGE_NAME and $RPM_PACKAGE_VERSION for the content. We use a spec file because it turns out that shell-based build systems mangle JSON making it impossible to inject --package-metadata directly. [2] With some in-flight patches to prettify the output that I'm currently working on ;) The output is currently more verbose in released systemd, but the next release should have this more compact form or something very similar. [3] In the terminal, the arrow is a link to the man page. _______________________________________________ devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue