dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.37k stars 4.75k forks source link

Internal CLR error while ILC.exe compiling Microsoft.CSharp in multifile mode #69593

Closed MichalStrehovsky closed 2 years ago

MichalStrehovsky commented 2 years ago

Seen in this CI run: https://dev.azure.com/dnceng/public/_build/results?buildId=1780244&view=logs&jobId=310a6d4b-19ba-5a3a-d7f8-7eef1d10e31f&j=310a6d4b-19ba-5a3a-d7f8-7eef1d10e31f&t=18f80362-701c-5056-2790-aab686841135

I've not seen this before. ILC.exe is running on top of whatever dotnet/CoreCLR we use in the repo which is currently .NET 7 Preview 3. This is not self-hosted NativeAOT and likely not a NativeAOT bug.

2022-05-19T20:19:42.4156624Z   Fatal error. Internal CLR error. (0x80131506)
2022-05-19T20:19:42.4158726Z      at Internal.TypeSystem.Ecma.EcmaModule+IEntityHandleObject.get_Handle()
2022-05-19T20:19:42.4171990Z      at Internal.TypeSystem.Ecma.EcmaModule+EcmaObjectLookupHashtable.CompareKeyToValue(System.Reflection.Metadata.EntityHandle, IEntityHandleObject)
2022-05-19T20:19:42.4207064Z      at Internal.TypeSystem.LockFreeReaderHashtable`2[[System.Reflection.Metadata.EntityHandle, System.Reflection.Metadata, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].TryGetValue(System.Reflection.Metadata.EntityHandle, System.__Canon ByRef)
2022-05-19T20:19:42.4226480Z      at ILCompiler.LazyGenericsSupport+GraphBuilder.WalkMethod(Internal.TypeSystem.Ecma.EcmaMethod)
2022-05-19T20:19:42.4234505Z      at ILCompiler.LazyGenericsSupport+GraphBuilder..ctor(Internal.TypeSystem.Ecma.EcmaModule)
2022-05-19T20:19:42.4240090Z      at ILCompiler.LazyGenericsSupport+CycleInfoHashtable.CreateValueFromKey(Internal.TypeSystem.Ecma.EcmaModule)
2022-05-19T20:19:42.4246260Z      at Internal.TypeSystem.LockFreeReaderHashtable`2[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].CreateValueAndEnsureValueIsInTable(System.__Canon)
2022-05-19T20:19:42.4249860Z      at ILCompiler.LazyGenericsSupport+GenericCycleDetector.DetectCycle(Internal.TypeSystem.TypeSystemEntity, Internal.TypeSystem.TypeSystemEntity)
2022-05-19T20:19:42.4255173Z      at Internal.JitInterface.CorInfoImpl.GetMethodEntrypoint(Internal.JitInterface.CORINFO_MODULE_STRUCT_*, Internal.TypeSystem.MethodDesc)
2022-05-19T20:19:42.4262677Z      at Internal.JitInterface.CorInfoImpl.getCallInfo(Internal.JitInterface.CORINFO_RESOLVED_TOKEN ByRef, Internal.JitInterface.CORINFO_RESOLVED_TOKEN*, Internal.JitInterface.CORINFO_METHOD_STRUCT_*, Internal.JitInterface.CORINFO_CALLINFO_FLAGS, Internal.JitInterface.CORINFO_CALL_INFO*)
2022-05-19T20:19:42.4276561Z      at Internal.JitInterface.CorInfoImpl._getCallInfo(IntPtr, IntPtr*, Internal.JitInterface.CORINFO_RESOLVED_TOKEN*, Internal.JitInterface.CORINFO_RESOLVED_TOKEN*, Internal.JitInterface.CORINFO_METHOD_STRUCT_*, Internal.JitInterface.CORINFO_CALLINFO_FLAGS, Internal.JitInterface.CORINFO_CALL_INFO*)
2022-05-19T20:19:42.4285443Z      at Internal.JitInterface.CorInfoImpl.JitCompileMethod(IntPtr ByRef, IntPtr, IntPtr, IntPtr, Internal.JitInterface.CORINFO_METHOD_INFO ByRef, UInt32, IntPtr ByRef, UInt32 ByRef)
2022-05-19T20:19:42.4288953Z      at Internal.JitInterface.CorInfoImpl.JitCompileMethod(IntPtr ByRef, IntPtr, IntPtr, IntPtr, Internal.JitInterface.CORINFO_METHOD_INFO ByRef, UInt32, IntPtr ByRef, UInt32 ByRef)
2022-05-19T20:19:42.4295063Z      at Internal.JitInterface.CorInfoImpl.CompileMethodInternal(ILCompiler.DependencyAnalysis.IMethodNode, Internal.IL.MethodIL)
2022-05-19T20:19:42.4302808Z      at Internal.JitInterface.CorInfoImpl.CompileMethod(ILCompiler.DependencyAnalysis.MethodCodeNode, Internal.IL.MethodIL)
2022-05-19T20:19:42.4308504Z      at ILCompiler.RyuJitCompilation.CompileSingleMethod(Internal.JitInterface.CorInfoImpl, ILCompiler.DependencyAnalysis.MethodCodeNode)
2022-05-19T20:19:42.4319081Z      at ILCompiler.RyuJitCompilation.CompileSingleMethod(ILCompiler.DependencyAnalysis.MethodCodeNode)
2022-05-19T20:19:42.4330825Z      at System.Threading.Tasks.Parallel+<>c__DisplayClass19_0`1[[System.__Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].<ForWorker>b__1(System.Threading.Tasks.RangeWorker ByRef, Int32, Boolean ByRef)
2022-05-19T20:19:47.6722523Z      at System.Threading.Tasks.TaskReplicator+Replica.Execute()
2022-05-19T20:19:47.6726731Z      at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(System.Threading.Thread, System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
2022-05-19T20:19:47.6728763Z      at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef, System.Threading.Thread)
2022-05-19T20:19:47.6730129Z      at System.Threading.ThreadPoolWorkQueue.Dispatch()
2022-05-19T20:19:47.6731433Z      at System.Threading.PortableThreadPool+WorkerThread.WorkerThreadStart()

/snip

2022-05-19T20:19:57.6629308Z D:\a\_work\1\s\artifacts\bin\coreclr\windows.x64.Checked\build\Microsoft.NETCore.Native.targets(270,5): error MSB3073: The command ""D:\a\_work\1\s\artifacts\bin\coreclr\windows.x64.Checked\ilc\\ilc" @"D:\a\_work\1\s\artifacts\tests\coreclr/obj/windows.x64.Checked/Managed/.\build\/NativeAOTFX\Microsoft.CSharp.ilc.rsp"" exited with code 57005. [D:\a\_work\1\s\artifacts\bin\coreclr\windows.x64.Checked\build\BuildFrameworkNativeObjects.proj]
jkotas commented 2 years ago

This is likely caused by https://github.com/dotnet/runtime/issues/68443 . We need to wait for the repo SDK to be updated to preview5.

https://github.com/dotnet/runtime/issues/69454 and https://github.com/dotnet/runtime/issues/69192 are potentially related.

mangod9 commented 2 years ago

since this is waiting on preview5 probably not actionable currently. Perhaps we should consolidate the intermittent AVs into a single issue till preview5 is integrated.

MichalStrehovsky commented 2 years ago

Perhaps we should consolidate the intermittent AVs into a single issue till preview5 is integrated.

We could also just close all that show up before Preview 5 update.