-
Notifications
You must be signed in to change notification settings - Fork 4.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
Test failure: System.Text.Json.Serialization.Tests.JsonElementTests.DeepEquals_TooDeepJsonDocument_ThrowsInsufficientExecutionStackException #105532
Comments
@stephentoub interesting. the test you updated doesn't throw when crossgen is enabled. I'm not sure if it's expected that crossgen'd code uses less stack. Is there a way to make that test case deeper? |
We can change this 10_000: Line 240 in bee05c8
to something arbitrarily large. The value should be limited only by available memory. The goal here is effectively to stack overflow, so, yeah 😄 |
Just for clarification, is this a test failure rather than a product failure? And is it being worked on already? @lambdageek @stephentoub |
@ivdiazsa yea my suspicion is that the test needs to create more recursion. the way the test works is it creates some data structure and then starts a new thread with a small amount of stack space and then does some recursive calls exploring the data structure. The expectation is that it will throw an InsufficientExecutionStackException. With the JIT the current test case is deep enough. but with ReadyToRun, apparently not. I don't think anyone is working on it. |
I'll submit a PR to bump up the value. |
Just a side note that such assumptions may not be valid when JIT applies tail-call optimizations. e.g.: void foo()
{
foo();
} does this code throw SO? the answer is: depends on optimization level |
I wouldn't expect tail call optimizations to kick in here, though: runtime/src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonElement.cs Lines 1353 to 1358 in 1337553
Is my mental model off? |
Agree |
Failed in: runtime-coreclr crossgen2 20240724.1
Failed tests:
Error message:
Stack trace:
The text was updated successfully, but these errors were encountered: