-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Infinite loop in stacklevelsetter #45580
Comments
@BruceForstall for loop related issue. |
This is most likely an importer issue. |
This is the code that is failing:
|
The two tests here are disabled in issues.targets for Windows x86/x64/arm64. |
Related: #42673 And the code that invokes it:
|
We get into an infinite loop because the
The corruption is happening in the Rationalizer. [Edit] Actually, it looks like the corruption happens in the trees before the rationalizer, where the same GT_CATCH_ARG gets in the trees twice.
It should look like:
|
The corruption was created due to the following code in
this was only under In this case, we had created an ASG(LCL_VAR, CATCH_ARG) in a filter before raising a verification exception (the stack was level 2 when reaching an |
The problem manifested as an infinite loop during the StackLevelSetter phase in the release build SuperPMI replay of the tests, but also occurs as a normal release build test run of the varargsupport.il test. The issue is we had corrupt LIR gtPrev links, with a cycle. The problem had nothing to do with StackLevelSetter -- it just happened to be the first phase that iterated in reverse over the gtPrev links. The corruption was introduced in the importer, in `verConvertBBToThrowVerificationException`. It required a verification failure in a filter (possibly also catch) clause where the JIT would throw away the currently imported code and convert the block to a call to the verification failure helper. This was a classic case of important, functional code being under `#ifdef DEBUG` that is needed in non-DEBUG as well. The result was we would end up adding an `ASG(LCL_VAR, CATCH_ARG)` to the statement list twice, with the same `CATCH_ARG` node. Fixes dotnet#45580
The problem manifested as an infinite loop during the StackLevelSetter phase in the release build SuperPMI replay of the tests, but also occurs as a normal release build test run of the varargsupport.il test. The issue is we had corrupt LIR gtPrev links, with a cycle. The problem had nothing to do with StackLevelSetter -- it just happened to be the first phase that iterated in reverse over the gtPrev links. The corruption was introduced in the importer, in `verConvertBBToThrowVerificationException`. It required a verification failure in a filter (possibly also catch) clause where the JIT would throw away the currently imported code and convert the block to a call to the verification failure helper. This was a classic case of important, functional code being under `#ifdef DEBUG` that is needed in non-DEBUG as well. The result was we would end up adding an `ASG(LCL_VAR, CATCH_ARG)` to the statement list twice, with the same `CATCH_ARG` node. Fixes #45580
Running superpmi with a release clrjit runs into an infinite loop in stacklevelsetter due to bad IR. I’ve traced this back to the importer, when it generates two statements that reference the same CATCH_ARG node. In checked it runs into “Verification failure: F:\git5\runtime\src\coreclr\src\jit\importer.cpp:11980 : stack must be 1 on end of filter, while compiling App.Foo:VargFuncWrapper():App.Foo:this opcode endfilter, IL offset 13”, but doesn't run into the infinite loop. I haven’t determined why the behavior is different between checked and release.
This happens with
\\jitrollingbuild\SuperPMI\Windows_NT.x64\tests.pmi.Windows_NT.x64.Release.mch
from 10/14/2020, with method context 462164 (superpmi.exe -c 462164 clrjit.dll \SuperPmi\tests.pmi.Windows_NT.x64.Release.mch
) fromartifacts\bin\coreclr\windows.x64.Checked
. (Adjusting as needed for where you've got the mch file.)The text was updated successfully, but these errors were encountered: