← Sentry Playground

Debug symbols lab

One small C++ program for Windows, one crash, several builds. The code and the crash are always the same. Only what was uploaded to Sentry is different. Every button sends a real minidump of that build, so you see what each missing piece does to the stack trace. Source is in symbols-lab/. The theory and every scenario explained: slides (PDF, 36 pages) ↓.

Dump and symbols are two halves

Minidump made at crash time, on the user's machine

A snapshot of the dead process: threads, CPU registers, raw stack memory, and the list of loaded modules with their Debug IDs. It says what happened, but only in numbers: crashlab.exe +0x15f4.

Debug ID
must match

Debug files made at build time, on the build machine

The map for one exact build: address → function, file, line (PDB / DWARF / dSYM), plus the unwind info to walk the stack (in the EXE on 64-bit Windows). It says nothing about any crash.

Sentry joins them on the server (Symbolicator). No match for the Debug ID = no names. The dump can't be fixed later, the symbols can be uploaded later.

Scenarios

Click, open the issue, compare with the card. Images Loaded at the bottom of the event shows the status of every module.

Exercise: fix it in your own project

  1. Create a project with platform Native in your Sentry org. Tick Use my DSN above and paste its DSN.
  2. Send scenario 2. Open the event: Processing Error, <unknown> frames. Copy the Debug ID from the error.
  3. Download crashlab-1.0.1-symbols.zip, unzip, and check it is the right file:
    sentry-cli debug-files check crashlab.pdb
  4. Upload and wait until Sentry processed it:
    sentry-cli debug-files upload --wait -o ORG -p PROJECT crashlab.exe crashlab.pdb crashlab.src.zip
  5. Send scenario 2 again. Now it is readable. The old event is still broken: uploads work only for new events (or reprocess the issue, if the project stores minidumps).
  6. Now do 3 with the wrong zip first, and find out from the IDs why it does not help. Then 4, 5 and 6: upload one file at a time and watch Images Loaded change.
  7. Scenario 8: remove Microsoft in Project Settings → Debug Files → Built-in Repositories, send 1 again and count the frames.

Toolbox

# what is inside this file: type, Debug ID, what features it has
sentry-cli debug-files check crashlab.pdb

# is there a file with this ID in the project?
sentry-cli debug-files find -o ORG -p PROJECT dc70c17b-d25f-4dd3-94ab-e73d3dbbfbc4-1

# upload a folder: finds exe/dll/pdb/so/dSYM inside, also in zips
sentry-cli debug-files upload --wait --include-sources -o ORG -p PROJECT ./build

# send a dump by hand, no SDK needed
curl -X POST 'https://oORG.ingest.us.sentry.io/api/PROJECT/minidump/?sentry_key=KEY' \
  -F upload_file_minidump=@crash.dmp \
  -F 'sentry={"release":"crashlab@1.0.1"}'

# Windows: GUID + age of a binary, without Sentry tools
dumpbin /headers crashlab.exe | findstr /i "RSDS"