In order to produce good backtraces, we need to extract and store debug symbols from standard builds, and store them in a centralized repository for use in analyzing these reports. (see AutomatedProblemReports)


Currently it is very hard for a user to produce a good backtrace for a crash, so many times they just don't do it at all. This specification provides a basic need for AutomatedProblemReports.


This is performed implicitly for all packages in the archive without modifying source packages.

Use cases

For Edgy:

In the future:


pkgbinarymangler (formerly known as pkgstriptranslations) or a new package diverts dh_strip to provide a wrapper which builds debug symbol packages. dehbelper will not be modified for political reasons.

ddebs are used as container for debug symbols; similar to udebs, they have the same format as regular debs. Compared to flat files, they offer the following advantages:


Creating debug packages

dh_strip already offers to generate a debug package with the extracted symbols. However, it requires the debug package to be mentioned in debian/control, which we do not want to do permanently. Since modifying debhelper is considered bad and we just eliminated a similar modification to dh_builddeb, we will create a new package pkgstripdebug (or merge pkgstrip{translations,debug} into pkgbinarymangler), which diverts dh_strip to change its behaviour. This package needs to be installed into the buildd chroots. The diverted dh_strip does the following:

  1. Create a debug package in debian/ for all packages dh_strip is asked to act on.

    • The package name is the original one plus -dbgsym appended, ending with .ddeb.

    • Packages which are Architecture: all, or end with -dbg are excluded.

    • Dependencies are Depends: Original package name (= ${Source-Version}).

    • If there already is a -dbg package, Conflict: and Replaces: on it.

    • Point out the purpose and the original package name in the package description.
  2. Find all ELF files and call objcopy --only-keep-debug on them, and put the symbols into /usr/lib/debug/original path into the -dbgsym package. dh_strip has a similar feature, but has a different semantics in different compatibility levels, and generally interacts too much with the packaging to use it in a robust and generic way.

  3. Create a gnu_debuglink to the place of debug symbols
  4. [future enhancement] Package Red Hat's debugedit and use it to modify dwarf paths to point to /usr/src/<packagename>/ (or similar), so that a future apt-get source extension would cause gdb to automatically find the source.

  5. Create a deb (with .ddeb extension) and register it with dpkg-distaddfile with the same Section and Priority as the original package.

  6. Call the original dh_strip with the same parameters.

Soyuz changes

Using .ddeb will allow us to keep them in the same component as the original debs, which is a big advantage over putting them into a -debug component according to the archive admins.

The Soyuz developers estimate 15 mandays for implementation and testing.

apt changes

An apt frontend will be provided to conveniently install debug symbols: e. g. apt-get debug apache2 would install the -dbgsym ddebs for apache2 and all its dependencies. This will allow developers to actually install the .ddebs (rather than just downloading them in the crash handler, see AutomatedProblemReports).

Future improvements


for PKG in $@
   for p in $PKG $(apt-cache depends $PKG | awk '{print $2}')
       FETCH_LIST+=$(apt-cache rdepends $p | grep dbgsym)
apt-get install $(echo $(echo "$FETCH_LIST") | tr ' ' '\n' | sort -u)
exit 0


AptElfDebugSymbols (last edited 2009-01-25 02:32:05 by karl.hegbloom)