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
bpo-42500: Fix recursion in or after except #23568
bpo-42500: Fix recursion in or after except #23568
Conversation
🤖 New build scheduled with the buildbot fleet by @markshannon for commit 04d97f3 🤖 If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again. |
Thanks @markshannon for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9. |
Sorry, @markshannon, I could not cleanly backport this to |
* Use counter, rather boolean state when handling soft overflows. (cherry picked from commit 4e7a69b)
GH-24501 is a backport of this pull request to the 3.9 branch. |
* Use counter, rather boolean state when handling soft overflows.
…nGH-23568) (python#24501)" This reverts commit 8b795ab. It changed the PyThreadState structure size, breaking the ABI in 3.9.3.
Currently we try to track whether we are handling an exception, and adapt behavior accordingly.
This is fragile, and may cause the C stack to overflow, even if the Python stack does not.
Instead, this PR allows some headroom for exception formatting and initialization code. This means we can create exceptions and handle
RecursionError
s more reliably.This is still an imperfect solution, as we really should distinguish between recursion errors (the Python stack is too deep) and stack overflow errors (the C stack is near exhaustion).
https://bugs.python.org/issue42500