-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SystemError: <method 'is_done' of '_thread._ThreadHandle' objects> returned a result with an exception set #125842
Comments
cc @mpage. EDIT : I think it's unlikely that this is a bug in |
I can reproduce this on Windows with:
(Without the I think the problem is in
Lines 603 to 605 in 91ddde4
|
So the issue is that But since the C standard most probably defines Would it in this specific case be acceptable to reinterpret-cast the unsigned number, so that |
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.
Yes, we should interpret |
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.
) 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]>
…H-125925) 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]>
This is fixed now in the main and 3.13 branches, and it will be in the 3.13.1 release. |
Bug report
Bug description:
There is an unexpected SystemError which is completely outside of user code. I get it with Python 3.13.0 on Windows, but did never see it with Python 3.12.x:
Reproduction
The following minimal reproduction script:
Run the it and leave the ssh session with
sudo reboot now
. You get the following output (note the last 5 lines):There seems to be a strange interaction with async functions, local variables and return values:
return await p.wait()
prevents the warning messagepass
also omits the warning messageexit
also omits the warning messageCPython versions tested on:
3.13
Operating systems tested on:
Windows
Linked PRs
sys.exit(0xffff_ffff)
on Windows #125896sys.exit(0xffff_ffff)
on Windows (GH-125896) #125925The text was updated successfully, but these errors were encountered: