Skip to content

IndexOutOfRangeException in ILCompiler.LazyGenericsSupport.GraphBuilder.WalkMethod #122845

@am11

Description

@am11

Build Information

Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=1242593&view=logs&j=7dbf7d19-364a-5b42-ef94-ed3a1f9dc4c8
Build error leg or test failing: Build / linux_musl-x64 Debug Libraries_CheckedCoreCLR / Build product
Pull request: #122833

Error Message

  XUnitLogChecker -> /__w/1/s/artifacts/tests/coreclr/linux.x64.Release/Common/XUnitLogChecker/XUnitLogChecker/XUnitLogChecker.dll
  Generating native code
##[error]EXEC(0,0): error : (NETCORE_ENGINEERING_TELEMETRY=Build) One or more errors occurred. (Code generation failed for method '[S.P.CoreLib]System.AppContext.OnUnhandledException(object)')
EXEC : error : One or more errors occurred. (Code generation failed for method '[S.P.CoreLib]System.AppContext.OnUnhandledException(object)') [/__w/1/s/src/tests/Common/XUnitLogChecker/XUnitLogChecker.csproj]
  System.AggregateException: One or more errors occurred. (Code generation failed for method '[S.P.CoreLib]System.AppContext.OnUnhandledException(object)')
   ---> ILCompiler.CodeGenerationFailedException: Code generation failed for method '[S.P.CoreLib]System.AppContext.OnUnhandledException(object)'
   ---> System.IndexOutOfRangeException: Index was outside the bounds of the array.
     at ILCompiler.LazyGenericsSupport.GraphBuilder.WalkMethod(EcmaMethod) + 0xc5f
     at ILCompiler.LazyGenericsSupport.GraphBuilder..ctor(EcmaModule) + 0x637
     at ILCompiler.LazyGenericsSupport.CycleInfoHashtable.CreateValueFromKey(EcmaModule) + 0x3c
     at Internal.TypeSystem.LockFreeReaderHashtable`2.CreateValueAndEnsureValueIsInTable(TKey) + 0x14
     at ILCompiler.LazyGenericsSupport.GenericCycleDetector.FormsCycle(TypeSystemEntity, LazyGenericsSupport.ModuleCycleInfo&) + 0xaf
     at ILCompiler.LazyGenericsSupport.GenericCycleDetector.DetectCycle(TypeSystemEntity, TypeSystemEntity) + 0x14f
     at Internal.IL.ILImporter.GetMethodEntrypoint(MethodDesc) + 0x62
     at Internal.IL.ILImporter.ImportCall(ILOpcode, Int32) + 0xe85
     at Internal.IL.ILImporter.ImportBasicBlock(ILImporter.BasicBlock) + 0x1583
     at Internal.IL.ILImporter.ImportBasicBlocks() + 0x59
     at Internal.IL.ILImporter.Import() + 0x6cb
     at ILCompiler.ILScanner.CompileSingleMethod(ScannedMethodNode) + 0x53
     --- End of inner exception stack trace ---
     at ILCompiler.ILScanner.CompileSingleMethod(ScannedMethodNode) + 0x104
     at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker&, Int64, Boolean&) + 0x362
  --- End of stack trace from previous location ---
     at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker&, Int64, Boolean&) + 0x51a
     at System.Threading.Tasks.TaskReplicator.Replica.Execute() + 0x65
     --- End of inner exception stack trace ---
     at System.Threading.Tasks.TaskReplicator.Run[TState](TaskReplicator.ReplicatableUserAction`1, ParallelOptions, Boolean) + 0x155
     at System.Threading.Tasks.Parallel.ForWorker[TLocal,TInt](TInt, TInt, ParallelOptions, Action`1, Action`2, Func`4, Func`1, Action`1) + 0x2d4
  --- End of stack trace from previous location ---
     at System.Threading.Tasks.Parallel.ThrowSingleCancellationExceptionOrOtherException(ICollection, CancellationToken, Exception) + 0x31
     at System.Threading.Tasks.Parallel.ForWorker[TLocal,TInt](TInt, TInt, ParallelOptions, Action`1, Action`2, Func`4, Func`1, Action`1) + 0x403
     at ILCompiler.ILScanner.CompileMultiThreaded(List`1) + 0x22e
     at ILCompiler.ILScanner.ComputeDependencyNodeDependencies(List`1) + 0x16f
     at ILCompiler.DependencyAnalysisFramework.DependencyAnalyzer`2.ComputeMarkedNodes() + 0x9f
     at ILCompiler.ILScanner.ILCompiler.IILScanner.Scan() + 0x55f
     at ILCompiler.Program.<Run>g__RunScanner|4_0(Program.<>c__DisplayClass4_0&) + 0x19c
     at ILCompiler.Program.Run() + 0x2c3d
     at ILCompiler.ILCompilerRootCommand.<>c__DisplayClass261_0.<.ctor>b__0(ParseResult) + 0x31a
##[error].packages/microsoft.dotnet.ilcompiler/10.0.0/build/Microsoft.NETCore.Native.targets(330,5): error MSB3073: (NETCORE_ENGINEERING_TELEMETRY=Build) The command ""/__w/1/s/.packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/10.0.0/tools/ilc" @"/__w/1/s/artifacts/tests/coreclr/obj/linux.x64.Release/Managed/Common/XUnitLogChecker/XUnitLogChecker/native/XUnitLogChecker.ilc.rsp"" exited with code 1.
/__w/1/s/.packages/microsoft.dotnet.ilcompiler/10.0.0/build/Microsoft.NETCore.Native.targets(330,5): error MSB3073: The command ""/__w/1/s/.packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/10.0.0/tools/ilc" @"/__w/1/s/artifacts/tests/coreclr/obj/linux.x64.Release/Managed/Common/XUnitLogChecker/XUnitLogChecker/native/XUnitLogChecker.ilc.rsp"" exited with code 1. [/__w/1/s/src/tests/Common/XUnitLogChecker/XUnitLogChecker.csproj]

Build FAILED.
{
  "ErrorMessage": ["CodeGenerationFailedException", "IndexOutOfRangeException", "LazyGenericsSupport"],
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=1242593
Error message validated: [ILCompiler.CodeGenerationFailedException: Code generation failed for method '[S.P.CoreLib]System.AppContext.OnUnhandledException(object)']
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 1/4/2026 1:34:38 AM UTC

Report

Build Definition Step Name Console log Pull Request
1242593 dotnet/runtime Build product Log #122833

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
0 1 1

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=1242593
Error message validated: [CodeGenerationFailedException IndexOutOfRangeException LazyGenericsSupport]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 1/5/2026 5:54:08 AM UTC

Report

Build Definition Step Name Console log Pull Request
1242593 dotnet/runtime Build product Log #122833

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
0 1 1

Report

Build Definition Step Name Console log Pull Request
1242593 dotnet/runtime Build product Log #122833

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
0 1 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Known Build ErrorUse this to report build issues in the .NET Helix tabarea-NativeAOT-coreclrblocking-clean-ciBlocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'untriagedNew issue has not been triaged by the area owner

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions