Repository navigation
Keep the recursion check on light-throw targets - #2210
Draft
romangolev wants to merge 2 commits into
Draft
romangolev wants to merge 2 commits into
romangolev wants to merge 2 commits into
Conversation
Light-throw targets compiled after a recursion limit was set skipped the check. Refs IronLanguages#1611.
Author
|
@dotnet-policy-service agree company="pyrevitlabs" |
With a recursion limit set, check the real stack in FunctionPushFrame so deep calls on small-stack threads raise RecursionError rather than crash.
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.
A function that raises more than 20 exceptions is recompiled in the background for light exceptions. The recompiled target replaced the normal one without
AddRecursionCheck, so a recursion limit set before the compile was not enforced for calls made from light-throw code (for example ineval). Deep recursion overflowed the stack instead of raisingRecursionError.The light-throw target of a function now gets the check like the normal target. The test runs in a new process on a 256 KB thread; without the change the process dies with a stack overflow. Tested locally on net8.0.
Related to #1611: this restores the check in one case where the limit was not enforced, but not the general stack usage that issue describes. It does not change the overflow in #2186, which still occurs with
-X MaxRecursionset.