Repository navigation
fix(crashpad): buffer attachment updates - #2190
Merged
Merged
Conversation
`sentry_reinstall_backend()` currently destroys the Crashpad client and starts another handler with a new IPC pipe. Startup also replays scope breadcrumbs without resetting the ring counter, duplicating entries. Add a Windows reinstall hook that calls `CrashpadClient::RegisterHandlers()` on the existing client, preserving the handler process, pipe, and backend state. Reinstall fails if startup left no client; Linux and macOS retain their restart path. This is a prerequisite for the handler-side attachment buffering planned for #2182. Breadcrumb and scope updates will remain in the Windows handler until a report is built, so switching handlers during reinstall would strand pending data. Linux and macOS write attachments directly. Ref: #2182
Update Crashpad to buffer breadcrumb and scope attachment updates in the handler and acknowledge each update after it is stored. Report creation flushes that data before reading attachments or the external envelope. This removes disk I/O from pipe service threads and preserves per-file order for the SDK's serialized writers. Acknowledgment remains synchronous so accepted updates survive a client crash, including crashes handled through WER. The preceding reinstall change keeps the handler and its pending data when another runtime replaces the crash handlers. Linux and macOS write attachments directly. Overflow assertions now require the exact retained sequence and account for the fixture's three initial breadcrumbs. A shortened payload cannot fall back to the initial-breadcrumb check. Ref: #2182
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #2190 +/- ##
==========================================
+ Coverage 75.46% 75.56% +0.09%
==========================================
Files 103 103
Lines 28088 28178 +90
Branches 5150 5160 +10
==========================================
+ Hits 21197 21292 +95
+ Misses 5540 5533 -7
- Partials 1351 1353 +2 🚀 New features to boost your workflow:
|
JoshuaMoelans
approved these changes
Oct 12, 2026
mujacica
approved these changes
Oct 12, 2026
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.
Depends on:
Windows breadcrumb and scope IPC updates no longer block behind earlier disk writes occupying the handler's pipe instances. Crashpad now buffers updates before acknowledging them and writes them when a report is built, preserving update order.
Note: Backend reinstall now retains the handler so its pending attachment buffer survives the reinstall.
Fixes: #2182