feat(minidump): Add sentry-minidump integration - #1315
Open
timfish wants to merge 3 commits into
Open
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Adds a new
sentry-minidumpcrate that captures native crashes as minidumps in a separate process and sends them to Sentry as attachments. Enable it with theminidumpfeature onsentry. Linux, macOS and Windows only.The code is ported from the standalone
sentry-rust-minidumpcrate.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
Fatalevent, 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-minidumpIn
sentry-rust-minidumpthe process model is explicit: you callinit(&client), which re-executes the binary, and you then have to pass the client in by hand, keep the returnedHandlealive for the life of the program (orleak()it), and know that everything beforeinitruns in both processes.Here the process work moves inside
Integration::setup, which runs insideClient::with_optionsbeforesentry::initbinds the client to the hub. That removes most of the ceremony:setupspawns the reporter and keeps the handle inside the integration, which the client owns for the life of the process. NoHandle, noleak(), no client to pass in.setupnever returns. It builds its own client from the clonedClientOptions, runs the minidump server loop, and exits.sentry::initis the last line ofmainthat runs there.Scope sync is still manual, reached via
sentry::with_integrationinstead of a method on aHandle.inherit_argsnow defaults totruesince 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::initstill runs in both processes.is_crash_reporter_process()stays public so apps can gate on that.