Install minimal debuginfo by default to increase quality of bug reports and allow easier support for profiling and user space tracing.
- Name: Alexander Larsson
- Email: email@example.com
- Targeted release: Fedora 18
- Last updated: 2012-05-07
- Percentage of completion: 100%
The changes needed to generate MiniDebugInfo has landed in rpm 4.10.0-3 and was enabled by default in redhat-rpm-config 9.1.0-32. gdb supports reading the minidebuginfo since version 188.8.131.5220703-12.fc18.
The debuginfo packages in Fedora are very useful if you're a developer and you are debugging a bug on your machine. However, they are very large, so they cannot be deployed in a wider scale. In many usecases you really only need enough information to be able to create backtraces, which is far smaller and could be installed by default.
The main advantage of this is a general improvement of bug report quality (as reported via ABRT or manually), as the reports will have complete backtraces from all users. Additionally things like system wide profiling and userspace tracing would also be possible without large debuginfo installation.
Debug info for backtraces relies on two types of information, the function names in the symbol tables, and (optionally) the linenumber debug information. I wrote a script that takes our current debuginfo packages and generates minimal debuginfo files containing only the minimal function name information and optionally line number information. Here are the sizes it generates for some F17 packages:
|Package||Size of executables||symbols||xz symbols||symbols+lines||xz symbols+lines|
On my F17 installation /usr is 8771 Mb, and 1861 Mb of that is made up of ELF binaries. Leading to the following estimations for full-distro sizes:
|symbols||xz symbols||symbols+lines||xz symbols+lines|
|Estimated minidebuginfo size||283Mb||43Mb||1084Mb||213Mb|
|Estimated percentage of /usr||3.2%||0.5%||12.3%||2.4%|
To minimize space use (on the installed system but also on the installer medium) we've decided to only go with the compressed symbols.
The implementation we use is that the normal separate debuginfo object is stripped of the non-minimal debug info, compressed with xz and then injected into the main binary. Then gdb can use this as a fallback if the normal debuginfo package is not installed.
Benefit to Fedora
We get better bug reports by default, even when offline or on a bad link, without users having to wait while downloading large amounts of data, or having to send possibly privacy sensitive core information to anyone. Additionally this will work for all packages built on the system (not only the official packages, but also site-specific packages) and will work with or without ABRT (some sites may not want to send bug reports to ABRT but collect them locally).
It will also make it easier to do things like system wide profiling, userspace dynamic probes and causual debugging.
Generation of the minidebuginfo just requires a few lines in /usr/lib/rpm/find-debuginfo.sh.
Consumers of debuginfo (mainly gdb, but also profilers, etc) must be changed to look in additional places for extra debug info.
This feature requires a mass rebuild to generate the new minidebuginfo for all packages.
How To Test
Running any application under gdb you should be able to get a backtrace with function names for all frames by doing:
- Run "gdb <program name>"
- Type "run"
- Do something
- Press ctrl-c to get back to gdb
- Type "bt" and watch the full backtrace. There should be real function names everywhere, no "??" entries
The end-user experience should be minimally changed. The new debug information is mainly targeted towards developers.
There will be a slight increase in the size of the binaries. Custom installations (like embedded images) can avoid this size increase by stripping the binaries like this:
strip -R .gnu_debugdata $binary_file
Dependencies / affected packages
Revert the change and rebuild all packages.
- No relevant documentation
- Fedora 18 ships with a small subset of debug information by default. Full debug information is still available in the debuginfo packages.