Skip to content

fix(crashpad): buffer attachment updates - #2190

Merged
jpnurmi merged 4 commits into
masterfrom
jpnurmi/fix/crashpad-pipe
Oct 12, 2026
Merged

jpnurmi merged 4 commits into
masterfrom
jpnurmi/fix/crashpad-pipe

Conversation

@jpnurmi

@jpnurmi jpnurmi commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator

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

`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

codecov Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 37.50000% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.56%. Comparing base (7ab37f5) to head (c51c19c).
⚠️ Report is 2 commits behind head on master.

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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jpnurmi
jpnurmi merged commit 756a379 into master Oct 12, 2026
70 checks passed
@jpnurmi
jpnurmi deleted the jpnurmi/fix/crashpad-pipe branch October 12, 2026 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants