bpo-42500: Fix recursion in or after except#23568
Merged
markshannon merged 2 commits intopython:masterfrom Dec 2, 2020
Merged
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. |
Contributor
|
Thanks @markshannon for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9. |
Contributor
|
Sorry, @markshannon, I could not cleanly backport this to |
markshannon
added a commit
to markshannon/cpython
that referenced
this pull request
Feb 10, 2021
* 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. |
ambv
pushed a commit
that referenced
this pull request
Mar 2, 2021
adorilson
pushed a commit
to adorilson/cpython
that referenced
this pull request
Mar 13, 2021
* Use counter, rather boolean state when handling soft overflows.
gpshead
added a commit
to gpshead/cpython
that referenced
this pull request
Apr 4, 2021
…nGH-23568) (python#24501)" This reverts commit 8b795ab. It changed the PyThreadState structure size, breaking the ABI in 3.9.3.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
RecursionErrors 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