February 16, 2010

How to get useful backtraces almost for free?

It's not as widely known as I would like, but FEATURES="splitdebug" in /etc/make.conf is a really useful setting. It does not make programs slower, but keeps the debugging info in case you need to report a bug. It's especially useful for packages which take long time to compile, or which use a lot of system libraries.

To save your time recompiling software when someone asks for better backtrace in a bug report, I encourage you to read Gentoo backtrace guide and apply it. Even splitdebug alone will give you noticeable advantage when something crashes. If you don't want to recompile the entire world after that, it's not needed. Over time more and more packages will get recompiled with splitdebug.