-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
gh-94445: add compiler test for another case of excessive stack use #99237
Merged
Conversation
This file contains 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
facebook-github-bot
pushed a commit
to facebookincubator/cinder
that referenced
this pull request
Nov 8, 2022
Summary: 3.10 added a new check in the compiler to error if a maximum stack size was exceeded, on the (mistaken) assumption that all cases in the compiler that could lead to very large stack sizes had been fixed. Later it was realized that large stack sizes were still possible, so this check was reverted (in 3.10.6+, 3.11, and 3.12.) Backport the revert to our 3.10 (which is based on 3.10.5.) There might be an argument for updating our 3.10 to the latest upstream 3.10 branch (or latest 3.10 minor release) to bring in more of these bugfixes and compatibility fixes before we have to hit them ourselves. But this might also bring conflict-resolution hassles for bugs we wouldn't even be affected by. For now, just backport this one fix. Also submitted python/cpython#99237 upstream to ensure this case isn't missed if/when the max stack size check is re-added in 3.12. Reviewed By: itamaro Differential Revision: D41111919 fbshipit-source-id: 5480357
iritkatriel
approved these changes
Nov 8, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks @carljm for the PR, and @iritkatriel for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Nov 8, 2022
… use (pythonGH-99237) (cherry picked from commit 027bc7e) Co-authored-by: Carl Meyer <[email protected]>
GH-99262 is a backport of this pull request to the 3.11 branch. |
miss-islington
added a commit
that referenced
this pull request
Nov 8, 2022
…H-99237) (cherry picked from commit 027bc7e) Co-authored-by: Carl Meyer <[email protected]>
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.
In GH-94329 the
MAX_ALLOWED_STACK_SIZE
check in the compiler (added in 3.10.0) was reverted,because it was discovered that a large sequence unpacking could use more than the allowed stack size.
A todo comment was left in the code to re-add this check in future, and GH-94445 was created to track
the todo item.
I've found another case in which unbounded stack can be consumed: a function with a very large number
of type-annotated arguments. This PR simply adds a test for that case, to ensure that if in future the
stack-size check is again enforced, the case won't be missed and cause another breakage for valid (if
pathological) code.