-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Reduce time taken to test StackGuard and move to innerloop. #14444
Conversation
|
@bartdesmet changing your test of your functionality here, so PTAL |
|
@dotnet-bot test code coverage |
|
(And I just remembered that code coverage isn't going to show anything useful due to the existing issue there 😞 ) |
bartdesmet
left a comment
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
| // This reduces the size of tree needed to risk a stack overflow. | ||
| Thread t = new Thread(() => f = Expression.Lambda<Func<int>>(e).Compile(useInterpreter), 1); | ||
| t.Start(); | ||
| t.Join(); |
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.
Did the previous code overflow more than once? Presumably this new version won't, so maybe we still need the old test as outerloop in addition to the new one as inner?
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.
Good point.
We have a test that verifies that Expression compilation is protected against stack overflow in the case of compiling deep expression trees, but forcing a case that would cause such a problem by necessity requires a large tree that takes a long time to compiile, so the test is outerloop only. Forcing the compilation to happen on the smallest possible stack reduces the size of tree that would risk a stack overflow, and so can test the same functionality in less than a second. Do this, and move the test to innerloop.
583e550 to
99975c9
Compare
|
Brought the old version back beside the new, to test the multiple-overflow case. |
|
Test Innerloop OSX Release Build and Test |
The manually assigned 128 KiB stack here is bordering on the amount of stack space that release JIT needs to JIT functions with deep trees. Since the JIT already has a limit on the depth of trees it creates https://github.com/dotnet/runtime/blob/44f050acc0f7791d6cd7ac772945444912bcf299/src/coreclr/jit/importer.cpp#L11234-L11252 it seems unnecessary to pressimize the JIT further to allow this test to pass. Also, the test was originally added as a faster equivalent to the test above it that could run in inner loop (dotnet/corefx#14444), but it was subsequently moved to outer loop (dotnet/corefx#19563), so now it does not seem like there's much point in retaining it. Fix dotnet#53309
…innerloop Reduce time taken to test StackGuard and move to innerloop. Commit migrated from dotnet/corefx@bdfe654
We have a test that verifies that
Expressioncompilation is protected against stack overflow in the case of compiling deep expression trees, but forcing a case that would cause such a problem by necessity requires a large tree that takes a long time to compile, so the test is outerloop only.Forcing the compilation to happen on the smallest possible stack reduces the size of tree that would risk a stack overflow, and so can test the same functionality in less than a second.
Do this, and move the test to innerloop.