Skip to content

Instantly share code, notes, and snippets.

@slipher
Last active July 26, 2022 08:39
Show Gist options
  • Save slipher/ff47754b70778eb0a7c5 to your computer and use it in GitHub Desktop.
Save slipher/ff47754b70778eb0a7c5 to your computer and use it in GitHub Desktop.

This content is now available at https://wiki.unvanquished.net/wiki/Breakpad

Getting a stack trace from a minidump

(1) Getting the tools

The Breakpad repo for Daemon Engine is at https://github.com/DaemonEngine/breakpad. If you have already checked out Daemon, then it is located in the libs/breakpad/ submodule there. cd into this repo.

Daemon's Breakpad fork is based on https://github.com/jon-turney/google-breakpad, with only minor changes. Jon Turney's version adds MinGW support. It is in turn a fork of Chromium's Breakpad https://chromium.googlesource.com/breakpad/breakpad.

(2) Dump symbols

Skip this step if you already have symbol files. In the Unvanquished unizip/torrent, symbol files are found in the symbols_${VERSION}.zip archive.

To produce symbols, you need a binary with debug info. For MinGW, the binary needs to have been built with the -Wl,--build-id flag so that it has a nonzero build ID.

You need to run the dump_syms tool (located at src/tools/linux/dump_syms/dump_syms for Linux targets or src/tools/linux/dump_syms_dwarf/dump_syms for MinGW targets) on the binary(ies) where the crash occurred. Usage: dump_syms <binary>. The output must be stored in a specific directory format. Pick a directory to be the symbol directory (symbols in the following examples). The output must be stored at symbols/$FILENAME/$BUILD_ID/$FILENAME.sym . For example, symbols/cgame-native-dll.dll/1A74E057938E0BF10930C4F54740B2E21/cgame-native-dll.dll.sym. The build ID can be seen in the first few lines of dump_syms output in a line beginning with MODULE.

(3) Stack walk

Running the stack walk tool (located at src/processor/minidump_stackwalk in Linux) will give the human-readable stack trace. Usage: minidump_stackwalk <dump file> <symbol directory>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment