Skip to content

fix(win): time out attachment updates to a stalled handler - #178

Merged
jpnurmi merged 4 commits into
getsentry:getsentryfrom
Aureliolo:fix/win-ipc-timeout
Nov 9, 2026
Merged

jpnurmi merged 4 commits into
getsentry:getsentryfrom
Aureliolo:fix/win-ipc-timeout

Conversation

@Aureliolo

Copy link
Copy Markdown

An attachment update waits forever for a free pipe instance and its reply. A suspended or hung handler blocks every scope change and breadcrumb, and a crash never finishes. #174 made the handler acknowledge early (getsentry/sentry-native#2182) but added no timeout.

Each wait now times out after 5 s. After a failure, updates fail at once while no pipe instance is free, until one succeeds.

Two sentry-native tests hang today and pass with this: a suspended handler, and a crash with both pipe instances held.

An attachment update waited for a free pipe instance with
NMPWAIT_WAIT_FOREVER and then wrote and read with blocking I/O. A handler
that is suspended or hung never answers, so the update blocked the
calling thread for good. sentry-native sends one for every scope change
and breadcrumb and at crash time, so the app froze and a crash never
finished.

Each wait now gives up after 5 seconds. After an update fails, later
updates fail at once while no pipe instance is free, until one succeeds.
So a stalled handler no longer costs a timeout on every update.

@jpnurmi jpnurmi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Could you please revert the formatting-only changes (the attachment call sites, the SendPayloadToCrashHandlerServer signature, and the CreateFile call)? The existing code isn't strictly clang-formatted, and the reflow makes up about 40% of the diff.

Comment thread client/crashpad_client_win.cc Resolved
@Aureliolo

Aureliolo commented Nov 5, 2026 •

Copy link
Copy Markdown
Author

I reverted the reflow in the signature and the CreateFile call. The four call sites keep their old alignment, so under the helper's shorter name their argument lines only shift left. With whitespace hidden each one changes just the name and one new argument.

If you'd rather the four call sites stay as they are, I can drop the helper and pass &attachment_update_failed_ to SendPayloadToCrashHandlerServer as a last argument instead. Each call site would then change by one line.

@jpnurmi

jpnurmi commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

Thanks, looks good! 👍

Would you like to create a submodule bump PR at https://github.com/getsentry/sentry-native/pulls to run the whole sentry-native integration test suite against this?

@Aureliolo

Copy link
Copy Markdown
Author

I opened getsentry/sentry-native#2280. It bumps crashpad to this PR's head and adds my two tests for a stalled handler. I hope that's how you wanted it.

@jpnurmi
jpnurmi merged commit c818399 into getsentry:getsentry Nov 9, 2026
24 checks passed
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.

2 participants