MiniDebugInfo
Summary
Install minimal debuginfo by default to increase quality of bug reports and allow easier support for profiling and user space tracing.
Owner
- Name: Alexander Larsson
- Email: alexl@redhat.com
Current status
- 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 7.4.50.20120703-12.fc18.
Detailed Description
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 |
---|---|---|---|---|---|
coreutils | 4851 Kb | 15.46% | 3.92% | 38.82% | 14.15% |
gcc | 13003 Kb | 3.54% | .87% | 23.68% | 10.13% |
gdb | 5062 Kb | 3.98% | .85% | 18.67% | 8.25% |
libreoffice-core | 142897 Kb | 17.96% | 2.38% | 61.22% | 11.76% |
libreoffice-writer | 11501 Kb | 18.52% | 2.73% | 71.27% | 12.42% |
cairo | 808 Kb | 11.95% | 2.46% | 33.56% | 13.08% |
gimp | 14828 Kb | 8.89% | 1.89% | 29.43% | 7.90% |
gtk2 | 6007 Kb | 11.46% | 2.22% | 28.20% | 8.72% |
gtk3 | 5302 Kb | 8.73% | 1.64% | 26.08% | 8.37% |
webkitgtk | 31147 Kb | 18.51% | 2.68% | 98.03% | 13.75% |
webkitgtk3 | 31143 Kb | 18.50% | 2.68% | 97.97% | 13.76% |
nautilus | 2039 Kb | 14.59% | 2.89% | 33.09% | 10.20% |
evolution | 7492 Kb | 8.16% | 1.82% | 25.95% | 7.96% |
xulrunner | 25533 Kb | 43.78% | 6.97% | 108.84% | 22.11% |
qt3 | 10458 Kb | .89% | .21% | 21.58% | 7.18% |
qt | 12377 Kb | 14.65% | 2.17% | 58.66% | 12.34% |
qtwebkit | 25989 Kb | 19.03% | 2.83% | 92.24% | 13.29% |
kdelibs | 36231 Kb | 10.20% | 1.84% | 36.91% | 9.35% |
kde-baseapps | 8030 Kb | 11.48% | 2.46% | 32.44% | 9.22% |
samba | 17508 Kb | 3.25% | .63% | 16.90% | 5.31% |
httpd | 2496 Kb | 11.83% | 2.97% | 25.53% | 9.94% |
llvm-libs | 23176 Kb | 2.78% | .42% | 33.83% | 9.41% |
emacs | 12445 Kb | 1.17% | .30% | 4.98% | 2.29% |
Total | 450334 Kb | 15.21% | 2.32% | 58.24% | 11.42% |
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.
Scope
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
User Experience
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
- gdb
- rpm
- redhat-rpm-config
- libunwind
- elfutils
- ABRT
Contingency Plan
Revert the change and rebuild all packages.
Documentation
- No relevant documentation
Release Notes
- Fedora 18 ships with a small subset of debug information by default. Full debug information is still available in the debuginfo packages.