Skip to content

feat(minidump): Add sentry-minidump integration - #1315

Open
timfish wants to merge 3 commits into
getsentry:masterfrom
timfish:feat/minidump-integration
Open

feat(minidump): Add sentry-minidump integration#1315
timfish wants to merge 3 commits into
getsentry:masterfrom
timfish:feat/minidump-integration

Conversation

@timfish

@timfish timfish commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Adds a new sentry-minidump crate that captures native crashes as minidumps in a separate process and sends them to Sentry as attachments. Enable it with the minidump feature on sentry. Linux, macOS and Windows only.

The code is ported from the standalone sentry-rust-minidump crate.

How it works

The integration re-executes the current binary as a crash reporter process. The app process spawns the reporter and connects to it; the reporter attaches a native crash handler and waits. On a crash it writes a minidump, attaches it to a Fatal event, and uploads it. Scope does not cross the process boundary on its own. To give the crash event context (user, tags, extra, breadcrumbs), the app sends updates to the reporter explicitly through methods on the integration; each call is forwarded over a socket and applied to the reporter's scope.

Difference from sentry-rust-minidump

In sentry-rust-minidump the process model is explicit: you call init(&client), which re-executes the binary, and you then have to pass the client in by hand, keep the returned Handle alive for the life of the program (or leak() it), and know that everything before init runs in both processes.

Here the process work moves inside Integration::setup, which runs inside Client::with_options before sentry::init binds the client to the hub. That removes most of the ceremony:

  • In the app process, setup spawns the reporter and keeps the handle inside the integration, which the client owns for the life of the process. No Handle, no leak(), no client to pass in.
  • In the reporter process, setup never returns. It builds its own client from the cloned ClientOptions, runs the minidump server loop, and exits. sentry::init is the last line of main that runs there.

Scope sync is still manual, reached via sentry::with_integration instead of a method on a Handle. inherit_args now defaults to true since I suspect this will be more useful to most without causing pain for others.

The one caveat is inherent to re-executing the binary: code before sentry::init still runs in both processes. is_crash_reporter_process() stays public so apps can gate on that.

@timfish
timfish requested a review from a team as a code owner September 11, 2026 12:50
@sdk-maintainer-bot

This comment was marked as resolved.

Comment thread sentry-minidump/src/lib.rs

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit cf9094b. Configure here.

Comment thread sentry-minidump/src/lib.rs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant