Breakpad:Current Implementation
This is a summary of the current state of Breakpad integration into Mozilla.
Client Side
Currently Breakpad work in Mozilla has only progressed on Win32. An OS X implementation is available in the Breakpad source. Linux patches are in progress, but not yet available.
Symbol Extraction/Upload
Symbol extraction and upload is done at build time. There are two targets in the top level Makefile, buildsymbols and uploadsymbols.
The |buildsymbols| target finds PDB files associated with EXE and DLL files in $(DIST), and processes them with dump_syms.exe to get a SYM file for each, using the make_symbol_store.pl script. The SYM files and PDB files are both placed in $(DIST)/airbag-symbols/$(BUILDID) in the directory structure used for the Microsoft Symbol Server. A description of this directory structure can be found in the Breakpad source. The symbols are then compressed into a .tar.bz2 file, in a dated directory alongside the top source directory.
The |uploadsymbols| target simply calls the upload_symbols.sh script to upload the symbols using rsync. This script relies on certain environment variables being set:
- AIRBAG_SYMBOL_SERVER : host to upload symbols to
- AIRBAG_SYMBOL_USER : username on that host
- AIRBAG_SYMBOL_PATH : path on that host to put symbols in
The symbols are copied to the symbol server and untarred into the specified path.
Exception Handler
The exception handler is set in XRE_Main by calling SetAirbagExceptionHandler(). The exception handler is not actually installed unless the MOZ_AIRBAG environment variable is set to a non-zero value. Once a profile has been found, a "minidumps" directory is located or created in the profile directory, and this path is passed to SetAirbagMinidumpPath() as the destination for minidump files from the exception handler.
Upon catching an exception, the handler attempts to execute crashreporter.exe from the same directory as the current executable. The full path to the minidump file is passed in as a command line parameter. The application then exits.