Native Crash Reporting in Bugsink 2.6.2
Bugsink 2.6.2 made native crash reporting ready for real use. I’m very happy to finally write that down.
This article was supposed to go out with 2.6.2. Publishing took longer than planned, and Bugsink 2.6.3 is current by the time you’re reading it. The feature itself landed in 2.6.2, which is why that version remains in the title.
The feature is based on minidumps: small binary reports written when a native application crashes. A minidump records the state of the crashed process, including its threads, loaded modules, crash reason, operating system, and CPU architecture.
With the debug information from the exact build that crashed, Bugsink turns the addresses in that dump into a readable stacktrace with function names, filenames, line numbers, and nearby source code. That makes a hard native crash debuggable in much the same way as an ordinary exception in Bugsink.
How it works
Two things have to reach Bugsink:
- The application uploads a minidump when it crashes. Crashpad can take care of creating, storing, and sending it.
- The build uploads its debug files using
sentry-cli, optionally including the source files for context lines.
Both contain the same debug ID, which lets Bugsink match the crash to the exact build. There is no guessing based on a release name or filename.
From proof of concept to 2.6.2
The first implementation shipped in Bugsink 2.0.7, behind FEATURE_MINIDUMPS=False. Its
pull request was titled “Minidumps: PoC” and explicitly warned about the
remaining denial-of-service risks.
It proved that the whole route worked, but minidumps and debug files are much larger than ordinary error events. The 2.6.2 work added upload limits and quota checks, moved expensive parsing outside the database write transaction, assembled debug files in the background, and put bounds around extracting uploaded source bundles.
It also fixed the direct minidump endpoint after a real report against 2.6.1. That was a useful final push from “works in my test setup” towards something other people can rely on.
Enabling minidumps
Hosted Bugsink already has minidumps enabled. Self-hosted installations still need:
FEATURE_MINIDUMPS=True
The setting will become the default in Bugsink 2.7. I don’t want to change a default involving much larger uploads in a patch release, so 2.6 remains opt-in.
I tested the complete path on Linux with Crashpad, including debug-file and source uploads. The minidump documentation explains how Crashpad, Breakpad, SDKs, minidumps, and debug files fit together. It also documents the supported upload formats and the current limitations.
