dotnet / corert

This repo contains CoreRT, an experimental .NET Core runtime optimized for AOT (ahead of time compilation) scenarios, with the accompanying compiler toolchain.
http://dot.net
MIT License
2.91k stars 508 forks source link

Detect cycles while resolving a type in the presence of forwarders and fail with an error message #2105

Open nattress opened 8 years ago

nattress commented 8 years ago

The current set of framework assemblies in CoreRT has an infinite loop resolving System.Random. It is type forwarded from mscorlib to System.Runtime.Extensions, and forwarded back from System.Runtime.Extensions to mscorlib. This causes a StackOverflowException in ILC when resolving the type.

We should detect cycles while resolving a type in the presence of forwarders and fail with an error message.

MichalStrehovsky commented 6 years ago

I'm doing a type forwards related fix in the CLR right now - the code that handles this in the CLR is around const_cMaxTypeForwardingChainSize.