Process is terminating due to StackOverflowException.
System.OutOfMemoryException: Insufficient memory to continue the execution of the program.
at System.Text.StringBuilder.ToString()
at Internal.TypeSystem.NoMetadata.NoMetadataType.ToString()
at Internal.TypeSystem.TypeSystemContext.ResolveGenericInstantiation(DefType, Instantiation)
at Internal.Runtime.TypeLoader.NativeLayoutInfoLoadContext.GetInstantiationType(NativeParser&, UInt32)
at Internal.Runtime.TypeLoader.NativeLayoutInfoLoadContext.GetType(NativeParser&)
at Internal.Runtime.TypeLoader.NativeLayoutInfoLoadContext.GetTypeSequence(NativeParser&)
at Internal.Runtime.TypeLoader.NativeLayoutInfoLoadContext.GetMethod(NativeParser&)
at Internal.Runtime.TypeLoader.GenericDictionaryCell.ParseAndCreateCell(NativeLayoutInfoLoadContext, NativeParser&)
at Internal.Runtime.TypeLoader.GenericDictionaryCell.BuildDictionary(TypeBuilder, NativeLayoutInfoLoadContext, NativeParser)
at Internal.Runtime.TypeLoader.TypeBuilder.ParseNativeLayoutInfo(InstantiatedMethod)
at Internal.Runtime.TypeLoader.TypeBuilder.PrepareMethod(MethodDesc)
at Internal.Runtime.TypeLoader.GenericDictionaryCell.MethodCell.Prepare(TypeBuilder)
at Internal.Runtime.TypeLoader.GenericDictionaryCell.BuildDictionary(TypeBuilder, NativeLayoutInfoLoadContext, NativeParser)
...
at Internal.Runtime.TypeLoader.TypeBuilder.ParseNativeLayoutInfo(InstantiatedMethod)
at Internal.Runtime.TypeLoader.TypeBuilder.PrepareMethod(MethodDesc)
at Internal.Runtime.TypeLoader.GenericDictionaryCell.MethodCell.Prepare(TypeBuilder)
at Internal.Runtime.TypeLoader.GenericDictionaryCell.BuildDictionary(TypeBuilder, NativeLayoutInfoLoadContext, NativeParser)
at Internal.Runtime.TypeLoader.TypeBuilder.ParseNativeLayoutInfo(InstantiatedMethod)
at Internal.Runtime.TypeLoader.TypeBuilder.PrepareMethod(MethodDesc)
at Internal.Runtime.TypeLoader.GenericDictionaryCell.MethodCell.Prepare(TypeBuilder)
at Internal.Runtime.TypeLoader.GenericDictionaryCell.BuildDictionary(TypeBuilder, NativeLayoutInfoLoadContext, NativeParser)
at Internal.Runtime.TypeLoader.TypeBuilder.ParseNativeLayoutInfo(InstantiatedMethod)
at Internal.Runtime.TypeLoader.TypeBuilder.PrepareMethod(MethodDesc)
at Internal.Runtime.TypeLoader.GenericDictionaryCell.MethodCell.Prepare(TypeBuilder)
at Internal.Runtime.TypeLoader.GenericDictionaryCell.BuildDictionary(TypeBuilder, NativeLayoutInfoLoadContext, NativeParser)
at Internal.Runtime.TypeLoader.TypeBuilder.ParseNativeLayoutInfo(InstantiatedMethod)
at Internal.Runtime.TypeLoader.TypeBuilder.PrepareMethod(MethodDesc)
at Internal.Runtime.TypeLoader.GenericDictionaryCell.MethodCell.Prepare(TypeBuilder)
at Internal.Runtime.TypeLoader.GenericDictionaryCell.BuildDictionary(TypeBuilder, NativeLayoutInfoLoadContext, NativeParser)
at Internal.Runtime.TypeLoader.TypeBuilder.ParseNativeLayoutInfo(InstantiatedMethod)
at Internal.Runtime.TypeLoader.TypeBuilder.PrepareMethod(MethodDesc)
at Internal.Runtime.TypeLoader.GenericDictionaryCell.MethodCell.Prepare(TypeBuilder)
at Internal.Runtime.TypeLoader.GenericDictionaryCell.BuildDictionary(TypeBuilder, NativeLayoutInfoLoadContext, NativeParser)
at Internal.Runtime.TypeLoader.TypeBuilder.ParseNativeLayoutInfo(InstantiatedMethod)
at Internal.Runtime.TypeLoader.TypeBuilder.PrepareMethod(MethodDesc)
at Internal.Runtime.TypeLoader.GenericDictionaryCell.MethodCell.Prepare(TypeBuilder)
at Internal.Runtime.TypeLoader.GenericDictionaryCell.BuildDictionary(TypeBuilder, NativeLayoutInfoLoadContext, NativeParser)
at Internal.Runtime.TypeLoader.TypeBuilder.ParseNativeLayoutInfo(InstantiatedMethod)
at Internal.Runtime.TypeLoader.TypeBuilder.PrepareMethod(MethodDesc)
at Internal.Runtime.TypeLoader.GenericDictionaryCell.MethodCell.Prepare(TypeBuilder)
at Internal.Runtime.TypeLoader.GenericDictionaryCell.BuildDictionary(TypeBuilder, NativeLayoutInfoLoadContext, NativeParser)
at Internal.Runtime.TypeLoader.TypeBuilder.ParseNativeLayoutInfo(InstantiatedMethod)
at Internal.Runtime.TypeLoader.TypeBuilder.PrepareMethod(MethodDesc)
at Internal.Runtime.TypeLoader.GenericDictionaryCell.MethodCell.Prepare(TypeBuilder)
at Internal.Runtime.TypeLoader.GenericDictionaryCell.BuildDictionary(TypeBuilder, NativeLayoutInfoLoadContext, NativeParser)
at Internal.Runtime.TypeLoader.TypeBuilder.ParseNativeLayoutInfo(InstantiatedMethod)
at Internal.Runtime.TypeLoader.TypeBuilder.PrepareMethod(MethodDesc)
at Internal.Runtime.TypeLoader.TypeBuilder.BuildMethod(InstantiatedMethod)
at Internal.Runtime.TypeLoader.TypeBuilder.TryBuildGenericMethod(InstantiatedMethod, IntPtr&)
at Internal.Runtime.TypeLoader.TypeLoaderEnvironment.TryGetGenericVirtualMethodPointer(InstantiatedMethod, IntPtr&, IntPtr&)
at Internal.Runtime.TypeLoader.TypeLoaderEnvironment.ResolveGenericVirtualMethodTarget(RuntimeTypeHandle, RuntimeMethodHandle)
at System.Runtime.TypeLoaderExports.<>c.<GVMLookupForSlotSlow>b__8_0(IntPtr context, IntPtr signature, Object contextObject, IntPtr& auxResult)
at System.Runtime.TypeLoaderExports.CacheMiss(IntPtr, IntPtr, RuntimeObjectFactory, Object)
at System.Runtime.TypeLoaderExports.GVMLookupForSlotSlow(Object, RuntimeMethodHandle)
at System.Runtime.TypeLoaderExports.GVMLookupForSlot(Object, RuntimeMethodHandle)
at RuntimeLookupDelegateGenericVirtual.TestGenericMethodOnNonGenericType[T]()
at GenericVirtualMethodTests.RuntimeLookupDelegate()
at Program.<<Main>$>g__TestExecutor117|0_118(StreamWriter, StreamWriter, Program.<>c__DisplayClass0_0&)
Found in #128702. See details in https://dev.azure.com/dnceng-public/public/_build/results?buildId=1480580&view=ms.vss-test-web.build-test-results-tab&runId=40860540&resultId=116527&paneView=debug
Repro:
Publish and run with NativeAOT:
Stacktrace under Checked configuration:
cc: @MichalStrehovsky