DSK-41Recommended
Keep symbols for every build you ship
Turn on a crash reporter in every release build, and store the debug symbols of each shipped binary next to its version. A crash report from any version still in use resolves to function names and lines.
How to do it
A crash report from a release build holds only memory addresses. Without the symbols of that exact build, nobody can tell which line failed. Windows builds produce PDB files, Mac builds produce dSYM bundles, and Linux builds keep separate debug files. Electron and Chromium-based apps write minidumps through Crashpad. Electron's documentation says you need the symbols for the exact Electron version, platform and architecture that crashed. Electron runs a public symbol server for its own binaries. For your own native modules, generate symbols with a tool such as Breakpad's dump_syms and keep them for every release. Upload them from the release job, as upload symbols for every build does for phone apps. Strip personal data from reports before they leave the machine. Let the user turn uploads off, as send usage data only after the user says yes says.
Examples
JavaScript example
// Electron main process: crash reports go to your server only when the user allowed it
import { app, crashReporter } from 'electron';
crashReporter.start({
submitURL: 'https://crashes.example.com/ledgerly',
uploadToServer: settings.get('sendCrashReports') === true,
globalExtra: { release: app.getVersion() },
});
Python example
# release_symbols.py: keep the symbols of each binary under its version, and fail the release on any error
import subprocess, sys, httpx
version, binaries = sys.argv[1], sys.argv[2:]
for binary in binaries:
symbols = subprocess.run(["dump_syms", binary], check=True, capture_output=True).stdout
response = httpx.post("https://crashes.example.com/api/symbols", data={"version": version}, files={"file": symbols}, timeout=60)
response.raise_for_status()
How to check
The release job fails when the symbol upload for any shipped binary fails. A test build crashes on purpose, and its report on the crash server names the function and source line. Symbols exist for every version that sent a report in the last 90 days.
Sources
Related rules
- MOB-31 Upload symbols for every build in Mobile apps
- DSK-42 Send usage data only after the user says yes in Desktop apps and extensions
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/desktop-apps/crashes-telemetry-and-accessibility/desktop-crash-symbols">Agent Wranglers desktop apps and extensions playbook</a>. In code you write, add a comment next to it with the same link.