Skip to content
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 for #89645, stack overflow in Crossgen2 #90229

Merged
merged 1 commit into from
Aug 11, 2023

Commits on Aug 9, 2023

  1. Fix for dotnet#89645, stack overflow in Crossgen2

    After David Wrighton's refactoring of type loadability check
    in dotnet#89415 we started seeing stack overflow in Crossgen2 compilation
    of the outerloop test
    
    Loader/classloader/generics/regressions/DD117522/Test.csproj
    
    This is because the test is a negative test that exercises runtime
    behavior in the presence of a non-loadable type with recursive
    definition. David's stricter descent into the type ends up in an
    infinite recursion when presented with this invalid type.
    
    I haven't found any easy way to incorporate the additional check
    for recursive types into the loadability algorithm - in fact I'm
    not even sure whether that's generally doable.
    
    As a very simple way to protect against the infinite recursion
    I propose adding a heuristic limit for the type analysis stack
    size. I assume the proposed value 1024 to be more than enough for
    both Crossgen2 and NativeAOT, if it's realistic that NativeAOT can
    encounter deeper types than this, I can make the check specific
    for Crossgen2.
    
    Thanks
    
    Tomas
    
    Fixes: dotnet#89645
    trylek committed Aug 9, 2023
    Configuration menu
    Copy the full SHA
    1547836 View commit details
    Browse the repository at this point in the history