Repository navigation
test(query): check the nesting limit on a thread with a known stack - #131
Merged
Merged
Conversation
ParserDepthTest asserted that 300 nested abs( calls are refused with "expression nested deeper than 256 levels". On the Linux CI runner the test thread's stack runs out before the 256th level, so the parser's overflow guard refuses the statement first, with "statement is nested too deeply to parse". Both are clean refusals; only the message differed. The limit checks now parse on an 8 MB thread, as the large-stack test already does. Refusal on a small stack stays covered by the 64 KB test. On a 256 KB thread the old assertion fails with the message CI showed.
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.
CI failed on the #128 merge (run 45506997080), in
ParserDepthTest.longArithmeticChainsAndNestedCallsCountTowardsTheNestingLimit:statement is nested too deeply to parse ==> expected: <true> but was: <false>.The test expected 300 nested
abs(calls to hit the 256-level limit. On the Linux runner the test thread's stack runs out first, so the parser's overflow guard refuses the statement with the other message. The statement is refused cleanly either way. The test assumed the stack was deep enough to reach 256 levels, and that depends on the platform. The test that #128 was written to fix,SecurityTest.extremeInputsFailCleanly, passed in the same run.This PR moves the limit checks onto an 8 MB thread, like
deepStatementsStillParseOnALargeStack. The 64 KB test still covers refusal on a small stack.Checked:
ParserDepthTestpasses 3/3 both normally and with-Xint.Test-only change.