Skip to content

fix(native): Fix crash daemon premature exit on Windows#1600

Merged
tustanivsky merged 2 commits intomasterfrom
fix/native-daemon-exit
Mar 27, 2026
Merged

fix(native): Fix crash daemon premature exit on Windows#1600
tustanivsky merged 2 commits intomasterfrom
fix/native-daemon-exit

Conversation

@tustanivsky
Copy link
Copy Markdown
Collaborator

Summary

The out-of-process crash daemon (sentry-crash.exe) was exiting after exactly 5 seconds (SENTRY_CRASH_DAEMON_WAIT_TIMEOUT_MS) on Windows, regardless of whether the parent process is still running.

Root cause

The is_parent_alive() check used OpenProcess(SYNCHRONIZE, ...) but GetExitCodeProcess() requires PROCESS_QUERY_LIMITED_INFORMATION access. Without it, GetExitCodeProcess always failed causing the daemon to conclude the parent had exited after the first 5-seconds poll cycle.

Suggested fix

Add PROCESS_QUERY_LIMITED_INFORMATION to the OpenProcess() flags so GetExitCodeProcess() can actually query the parent's exit status.

@tustanivsky tustanivsky requested review from jpnurmi and mujacica March 27, 2026 06:42
Copy link
Copy Markdown
Collaborator

@jpnurmi jpnurmi left a comment

Choose a reason for hiding this comment

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

Ooh, good catch!

@tustanivsky tustanivsky merged commit 6310244 into master Mar 27, 2026
52 checks passed
@tustanivsky tustanivsky deleted the fix/native-daemon-exit branch March 27, 2026 06:56
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