Fix for issue 70385 (stack overflow in the CoreCLR runtime during SVM validation) #71135
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.
The issue is caused by the fact that in the presence of recursive generics
verification that all SVMs are implemented ends up loading base types
with the full (CLASS_LOADED) level; if the base type is generic and contains
the type being verified as a type parameter, it causes infinite recursion.
I have adjusted two places around the SVM resolution to only require
CLASS_LOAD_EXACTPARENTS to prevent this. I have created a regression
test for the issue and I verified locally that it crashes with stack overflow
without my fix and passes with it.
Thanks
Tomas
Fixes: #70385