Share on Twitter
Share on Facebook
Share on HackerNews

Native Crash Reporting: Symbol Servers, PDBs, and SDK for C and C++

Over a year ago, we first announced support for Minidumps in Sentry, which allows you to debug crashes from applications written in languages like C, C++, Objective-C and more — regardless of whether you’re targeting Windows, macOS, Linux, iOS, or Android.

This summer, we’re taking native crash reporting to the next level by introducing a couple of key features:

  • Support for symbol servers
  • Native handling for PDBs
  • A full SDK for C and C++

Symbol servers

Microsoft offers an online service — the symbol server — that provides debug information for most of their system and kernel libraries. Many platform and framework vendors have also adopted this approach and provide debugging information in a similar way. What makes symbol servers so convenient is that they integrate seamlessly with debuggers to improve the analysis of crash reports.

There’s a good chance this isn’t news to you. You might even be running your own symbol server already. Well, as seen in the list of new features above, we’ve got you covered.

Sentry will automatically download debug information as it is needed after you configure the symbol servers you’d like to use. There is also a convenient list of preconfigured symbol servers to choose from to get started even quicker. The initial launch includes symbol servers from Microsoft, Intel, Nvidia, AMD and a few others; and we would love to hear which other symbols you’d like to see Sentry provide.

Sentry symbol servers

Selecting Symbol Servers in Sentry

Symbol servers make your life easier in two ways:

  1. Selecting a public symbol server, such as the Microsoft symbol server, will instantly give you function names for frames that would otherwise display as <unknown>.
  2. Since Sentry downloads debug files automatically, there is no longer the need to upload them with sentry-cli. This will likely shave some time off your builds and further simplifies using Sentry in your release cycle.

Support for symbol servers is entering a closed beta today and will be available to all customers later this summer. If you’re interested and can’t wait to get started, reach out to us.

Microsoft PDBs

PDBs, short for program databases, are debug information files used on the Windows platform. For a long time, we have required you to convert them to a different format before uploading them to Sentry.

That time has come to an end. Starting this summer, you can upload PDBs directly to Sentry, just like Mac or Linux debug files. Additionally, Sentry uses PDBs from symbol servers, if you choose to configure some. Of course, you can also continue to upload Breakpad files to Sentry.

Sentry native program database

Native PDB upload to Sentry using sentry-cli

In addition to easier uploads and less tooling requirements, with PDBs, Sentry resolves inline function calls. That’s right, Sentry resolves the same call stack as if you were debugging directly in Visual Studio. And on top of that, we have cleaned up the stack trace view to show more concise function names.

Sentry Windows stack trace system function names

A Windows stack trace including inline frames and system function names

Sentry Native SDK

Native crash reporting at Sentry is enabled by the Crashpad or Breakpad open-source client libraries. They handle application crashes and record essential application state into a Minidump. After over a decade of development, these libraries cover a wide range of platforms to provide a unified crash reporting experience.

However, over the past year, we’ve learned that integrating Crashpad and Breakpad into your applications can be a complicated process. Building and using both libraries feels quite different from our usual SDKs and involves much more setup and configuration. Thus, we’re very excited to bring the Sentry SDK experience to native crash reporting. We call it Sentrypad.

Sentrypad is an easy-to-integrate high-level SDK that comes with a familiar face: initialize using a DSN, add breadcrumbs and tags, and capture events with custom attributes. Under the hood, Sentrypad configures Breakpad or Crashpad to capture native crashes and upload them reliably to Sentry. On the surface, it provides a convenient C API:

#include "sentry.h"

/* Configure the SDK */
sentry_options_t options;
sentry_options_init(&options);
options.dsn = "https://93b6c4c0c1a14bec977f0f1adf8525e6@sentry.io/0815";
options.handler_path = "bin/Release/crashpad_handler";

/* Start the SDK and install crash handlers */
sentry_init(&options);

/* Add tags */
sentry_set_tag("mode", "demo");

/* Add breadcrumbs */
sentry_breadcrumb_t default_crumb = {.message = "going to crash"};
sentry_add_breadcrumb(&default_crumb);

/* Crash to send report to Sentry */
(int*)0 = 0;

But don’t stop there! You can even attach custom files to crash reports, which allows you to get an even more detailed look at your users’ environments. These files show up with the minidump in Sentry and can be downloaded for full analysis.

options.attachments = {"path/to/my/file", NULL};

Of course, Sentrypad is open-source and available on GitHub. Feel free to stop by and say hi. 😉 As we are rapidly approaching the first stable release, we can’t wait to hear about your thoughts and feedback: How does Sentrypad integrate with your build process? Do you like the API? Are there more features you’d like to see? Let us know by opening an issue on the issue tracker.

The next level

Native applications are first class citizens at Sentry — whether computer games, high-performance applications, or embedded appliances. We are thrilled to deliver all the features you’ve come to love from Sentry, including first-class interplay with any major ecosystem, powerful workflows and analytics, and our brand-new and extensible integration platform.

Don’t hesitate to let us know what you think about using Sentry in your application (or about anything else, really). Post feedback in our forum, or shout out to our support engineers for help.

From Sentry, with ⌨️ and ❤️

Your code is broken. Let's Fix it.
Get Started