Crashpad
Overview
Want help building Crashpad? View our step-by-step guide to help you more quickly get started here.
Crashpad is the latest open-source crash reporting tool built by Google and is the successor to the popular Breakpad crash reporter. Crashpad allows you to submit minidumps to a configured URL after a crash occurs in your product. The official Crashpad documentation is available here. Crashpad and Breakpad are 'wire compatible.' The crash reports created by both systems are processed similarly on our backend.
Tutorial
To begin, download and unzip the BugSplat Crashpad software development kit. The download contains a sample Crashpad application and a compiled version of Crashpad for Windows.
It's also possible to download and build Crashpad yourself. This step is required if you are targeting an OS other than Windows. See our Building Crashpad doc for our step-by-step guide to building Crashpad.
To get a feel for the BugSplat service, experiment with the myCrashpadCrasher sample application before enabling your application. You can find the Visual Studio project file located in your download folder at ...\BugSplatCrashpad\BugSplat\samples\myCrashpadCrasher\myCrashpadCrasher.vcxproj.
Run the sample application without the debugger attached to post a crash report to our public "fred@bugsplat.com" database. To view the report, log in to the public database using the account "fred@bugsplat.com" and the password "Flintstone."
Integrating Crashpad
Follow the myCrashpadCrasher pattern to enable Crashpad in your application.
Step 1
Add the following includes:
Step 2
Copy the initializeCrashpad
and GetCrashpadHandlerPath
methods from the BugSplat sample. The Crashpad url
and parameters format
, database
, product
and version
are required to upload crash reports to BugSplat. You can optionally specify values for the parameters user
, list_annotations
, and key
which will be tracked with each crash report.
Step 3
Call initializeCrashpad
using your own parameters for the BugSplat dbName
, appName
, and appVersion
.
Step 4
Link your application with the appropriate version of the Crashpad libraries client.lib
, base.lib
, andutil.lib
. BugSplat supplies builds for Debug/Release (x86) and Debug_x64/Release_x64 versions of the Crashpad libraries.
Step 5
Upload symbol files to BugSplat. To upload your application's .sym
files manually, please see this doc. Alternatively, you can use the Breakpad symupload utility to automate the symbol upload process. Run the following command replacing {database}
, {appName}
and {appVersion}
with values specific to your BugSplat database and symbol store.
Ensure the path
andurl
are wrapped in double quotes when usingsymupload
Breakpad symbols for non-Windows platforms
Breakpad symbol uploads for platforms other than Windows (e.g. Linux, Mac) require an additional step. You must first run the Breakpad utility dump_syms
to create .sym
files from your local executable files. Then use symupload
to upload the symbols to BugSplat.
Operating system symbol files can be uploaded in a similar manner. You may be able to find symbolic debug files for your operating system. If these are available when dump_syms is run, your OS call stack functions will be fully symbolicated. Since OS symbols change infrequently, they are a good candidate to store in a Common Symbol Library. Note, Windows OS symbols are loaded automatically by BugSplat.
Step 6
Trigger a crash in your application. The crash report should be available immediately on the BugSplat website.
Additional Considerations
Databases
The BugSplat database for your crash reports is created on the Manage Database page in Settings. Typically you will create a new database for each major release of your product.
Optimizations
Compiler optimizations can cause a mismatch between the line numbers in crash reports and the actual line numbers in your code. BugSplat recommends turning off compiler optimizations to ensure that the line numbers in your crash reports match the line numbers in your code. To turn off optimizations in Visual Studio, right click your project and navigate to Properties > C/C++ > Optimization > Optimization and set the value to Disabled (/Od).
Last updated