Skip to content

fix: correct utility process exit code on Windows#50385

Merged
dsanders11 merged 2 commits into42-x-yfrom
trop/42-x-y-bp-fix-correct-utility-process-exit-code-on-windows-1773953902059
Mar 20, 2026
Merged

fix: correct utility process exit code on Windows#50385
dsanders11 merged 2 commits into42-x-yfrom
trop/42-x-y-bp-fix-correct-utility-process-exit-code-on-windows-1773953902059

Conversation

@trop
Copy link
Contributor

@trop trop bot commented Mar 19, 2026

Backport of #50256

See that PR for details.

Notes: Fixed utilityProcess exit event reporting incorrect exit codes on Windows when the exit code has the high bit

trop bot and others added 2 commits March 19, 2026 20:58
On Windows, process exit codes are 32-bit unsigned integers (DWORD).
When passed from Chromium to Electron as a signed int and then
implicitly converted to uint64_t, values with the high bit set
(e.g., NTSTATUS codes) undergo sign extension, producing incorrect
values.

Cast the exit code to uint32_t before widening to uint64_t to
prevent sign extension and preserve the original Windows exit code.

Fixes #49455

Co-authored-by: João Silva <joaomrsilva@tecnico.ulisboa.pt>
Co-authored-by: João Silva <joaomrsilva@tecnico.ulisboa.pt>
@trop trop bot requested a review from a team March 19, 2026 20:58
@trop trop bot added 42-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes labels Mar 19, 2026
@dsanders11 dsanders11 merged commit 0d0a58c into 42-x-y Mar 20, 2026
72 checks passed
@dsanders11 dsanders11 deleted the trop/42-x-y-bp-fix-correct-utility-process-exit-code-on-windows-1773953902059 branch March 20, 2026 01:48
@release-clerk
Copy link

release-clerk bot commented Mar 20, 2026

Release Notes Persisted

Fixed utilityProcess exit event reporting incorrect exit codes on Windows when the exit code has the high bit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

42-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant