Native

Learn how to configure the native crash backend.

The native backend is an out-of-process backend available since SDK version 0.13.2. It is the most actively developed crash backend and is intended to become the default backend in the future. To use it, configure the CMake build with the SENTRY_BACKEND=native option:

Copied
cmake -B build -D SENTRY_BACKEND=native

This builds the sentry-crash executable alongside the sentry library. Ship the executable with your application so the SDK can start it during initialization.

Use sentry_options_set_crash_reporting_mode before sentry_init to configure which crash report format the backend sends when the application crashes.

ModeSendsStack walking
SENTRY_CRASH_REPORTING_MODE_MINIDUMPMinidumpServer-side
SENTRY_CRASH_REPORTING_MODE_NATIVEEventClient-side
SENTRY_CRASH_REPORTING_MODE_NATIVE_WITH_MINIDUMPEvent and minidumpClient-side

SENTRY_CRASH_REPORTING_MODE_NATIVE_WITH_MINIDUMP is the default. It sends an event with client-side stack traces and attaches a minidump for deeper crash analysis. Modes that include a minidump send it as an event.minidump attachment.

Use sentry_options_set_minidump_mode before sentry_init to control how much memory the backend captures in minidumps. This setting only affects crash reporting modes that send a minidump.

ModeCapturesTradeoff
SENTRY_MINIDUMP_MODE_STACK_ONLYStack memorySmallest and fastest, about 100 KB-1 MB
SENTRY_MINIDUMP_MODE_SMARTStack memory and heap memory around the crashBalanced default, about 5-10 MB
SENTRY_MINIDUMP_MODE_FULLFull process memoryMost detail, but largest and slowest, tens to hundreds of MB

For production builds, use SENTRY_MINIDUMP_MODE_STACK_ONLY or SENTRY_MINIDUMP_MODE_SMART. Use SENTRY_MINIDUMP_MODE_FULL only when you need the extra memory for development, staging, or a specific crash investigation.

For example, to send only a small minidump for server-side stack walking:

Copied
sentry_options_t *options = sentry_options_new();

sentry_options_set_crash_reporting_mode(
    options, SENTRY_CRASH_REPORTING_MODE_MINIDUMP);
sentry_options_set_minidump_mode(options, SENTRY_MINIDUMP_MODE_STACK_ONLY);

sentry_init(options);
Was this helpful?
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").