cpython icon indicating copy to clipboard operation
cpython copied to clipboard

gh-125842: Fix `sys.exit(0xffff_ffff)` on Windows

Open colesbury opened this issue 1 year ago • 1 comments

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.

  • Issue: gh-125842

colesbury avatar Oct 23 '24 19:10 colesbury

:robot: New build scheduled with the buildbot fleet by @colesbury for commit 8864fef683af3f2551e91fe59cc1783d2f7c22b9 :robot:

If you want to schedule another build, you need to add the :hammer: test-with-buildbots label again.

bedevere-bot avatar Oct 23 '24 21:10 bedevere-bot

Thanks @colesbury for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. 🐍🍒⛏🤖

miss-islington-app[bot] avatar Oct 24 '24 16:10 miss-islington-app[bot]

GH-125925 is a backport of this pull request to the 3.13 branch.

bedevere-app[bot] avatar Oct 24 '24 16:10 bedevere-app[bot]