-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Fix release build infinite loop #49943
Conversation
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
@@ -5321,22 +5321,20 @@ bool Compiler::verMergeEntryStates(BasicBlock* block, bool* changed) | |||
/***************************************************************************** | |||
* 'logMsg' is true if a log message needs to be logged. false if the caller has | |||
* already logged it (presumably in a more detailed fashion than done here) | |||
* 'bVerificationException' is true for a verification exception, false for a |
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.
This argument no longer exists
@dotnet/jit-contrib PTAL |
/azp run runtime-coreclr outerloop |
/azp run runtime-coreclr jitstress |
Azure Pipelines successfully started running 1 pipeline(s). |
1 similar comment
Azure Pipelines successfully started running 1 pipeline(s). |
I thought all this was now dead code. How is this getting called? |
There is this:
The caller is runtime/src/coreclr/jit/importer.cpp Line 12117 in d64c11e
|
jitstress failure is #49954 |
I'm still confused as to how What I'm wondering is whether we should BADCODE at the point we decide calling the above makes sense, instead of trying to defer things to runtime. |
When runtime/src/coreclr/jit/importer.cpp Line 17785 in 389674d
which calls You're right that perhaps BADCODE is the right behavior; I don't understand why it was originally a verification error and deferred to runtime. I guess we allowed unverifiable code to run and only lazily fail? |
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.
We can sort out the rest when we delete all the verifier support.
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 failurein 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 statementlist twice, with the same
CATCH_ARG
node.Fixes #45580