Using breakpad with content shell

When running layout tests, it is possible to use breakpad to capture stack traces on crashes while running without a debugger attached and with the sandbox enabled.


On all platforms, build the target blink_tests.
  • Mac: you need to add mac_want_real_dsym=1 to your GYP_DEFINES before building (note that this slows down linking several minutes, so don't just always set this by default).
  • Linux: add linux_use_debug_fission=0 to your GYP_DEFINES before building.
Furthermore, create a directory where the crash dumps will be stored
  • Linux/Mac: mkdir /tmp/crashes
  • Androidadb shell mkdir /data/local/tmp/crashes
  • Windows:
        mkdir %TEMP%\crashes
        out\Debug\content_shell_crash_service.exe --dumps-dir=%TEMP%\crashes

Running content shell with breakpad

Breakpad can be enabled by passing --enable-crash-reporter and --crash-dumps-dir to content shell:
  • Linux: out/Debug/content_shell --enable-crash-reporter --crash-dumps-dir=/tmp/crashes chrome://crash
  • Mac: out/Debug/Content\\ Shell --enable-crash-reporter --crash-dumps-dir=/tmp/crashes chrome://crash
  • Windowsout\Debug\content_shell.exe --enable-crash-reporter --crash-dumps-dir=%TEMP%\crashes chrome://crash
  • Android:
        build/android/ out/Debug/apks/ContentShell.apk
        build/android/adb_content_shell_command_line --enable-crash-reporter --crash-dumps-dir=/data/local/tmp/crashes chrome://crash

Retrieve crash dump

On Linux and Android, we first have to retrieve the crash dump. On Mac and Windows, this step can be skipped.
  • Linuxcomponents/crash/content/tools/ /tmp/crashes/*.dmp /tmp/minidump
  • Android:
        adb pull $(adb shell ls /data/local/tmp/crashes/*) /tmp/chromium-renderer-minidump.dmp
        components/breakpad/tools/dmp2minidump /tmp/chromium-renderer-minidump.dmp /tmp/minidump

Symbolize crash dump

On all platforms but windows, we need to convert the debug symbols to a format breakpad can understand.
  • Linuxcomponents/crash/content/tools/ --build-dir=out/Debug --binary=out/Debug/content_shell --symbols-dir=out/Debug/content_shell.breakpad.syms --clear --jobs=16
  • Maccomponents/crash/content/tools/ --build-dir=out/Debug --binary=out/Debug/Content\\ Shell --symbols-dir=out/Debug/content_shell.breakpad.syms --clear --jobs=16
  • Androidcomponents/crash/content/tools/ --build-dir=out/Debug --binary=out/Debug/lib/ --symbols-dir=out/Debug/content_shell.breakpad.syms --clear
Now we can generate a stack trace from the crash dump (assuming the crash dump is in minidump.dmp).
  • Linux/Android/Mac: out/Debug/minidump_stackwalk minidump.dmp out/Debug/content_shell.breakpad.syms
  • Windows: "c:\Program Files (x86)\Windows Kits\8.0\Debuggers\x64\cdb.exe" -y out\Debug -c ".ecxr;k30;q" -z minidump.dmp