[7.0] Fix the tiering delay to account for changing IL/native code versions during the delay #78669
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.
Fixes #77973
Customer Impact
Apps that use profiler APIs to modify a method's IL may occasionally crash. If a new IL code version is added to a method while it's queued for call counting during the tiering delay, after the delay expires a call counting stub may be created that when called, would cause the app to crash. A workaround is to disable tiered compilation.
Regression?
No
Testing
Reproed the issue by inducing the timing with code changes and verified the fix. Scanned over the few other paths where call counting stubs would be created and verified that all of them guarantee a non-null code entry point for the method.
Risk
Low