Skip to content

Conversation

@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Oct 24, 2024

On Windows, long is a signed 32-bit integer so it can't represent
0xffff_ffff without overflow. Windows exit codes are unsigned 32-bit
integers, so if a child process exits with -1, it will be represented
as 0xffff_ffff.

Also fix a number of other possible cases where _Py_HandleSystemExit
could return with an exception set, leading to a SystemError (or
fatal error in debug builds) later on during shutdown.
(cherry picked from commit ad6110a)

Co-authored-by: Sam Gross [email protected]

)

On Windows, `long` is a signed 32-bit integer so it can't represent
`0xffff_ffff` without overflow. Windows exit codes are unsigned 32-bit
integers, so if a child process exits with `-1`, it will be represented
as `0xffff_ffff`.

Also fix a number of other possible cases where `_Py_HandleSystemExit`
could return with an exception set, leading to a `SystemError` (or
fatal error in debug builds) later on during shutdown.
(cherry picked from commit ad6110a)

Co-authored-by: Sam Gross <[email protected]>
@colesbury colesbury enabled auto-merge (squash) October 24, 2024 16:11
@colesbury colesbury merged commit 52b57ee into python:3.13 Oct 24, 2024
38 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