Skip to content

ILC assertion failure: type == type.ConvertToCanonForm(CanonicalFormKind.Specific) #114934

@BruceForstall

Description

@BruceForstall
Contributor

There are quite a few ILC assertions in:

pipeline: runtime-coreclr superpmi-collection (https://dev.azure.com/dnceng/internal/_build?definitionId=977&_a=summary)
job: SuperPMI collect smoke_tests nativeaot linux x64 checked

of the form:

[08:44:40] Process terminated. Assertion failed.
[08:44:40] type == type.ConvertToCanonForm(CanonicalFormKind.Specific)
[08:44:40] at System.Diagnostics.DebugProvider.Fail(String, String) + 0x37
[08:44:40] at System.Diagnostics.Debug.Fail(String, String) + 0x30
[08:44:40] at ILCompiler.DependencyAnalysis.NecessaryCanonicalEETypeNode..ctor(NodeFactory, TypeDesc) + 0xb7
[08:44:40] at ILCompiler.DependencyAnalysis.NodeFactory.CreateNecessaryTypeNode(TypeDesc) + 0x11d
[08:44:40] at Internal.TypeSystem.LockFreeReaderHashtable`2.CreateValueAndEnsureValueIsInTable(TKey) + 0x14
[08:44:40] at ILCompiler.DependencyAnalysis.NodeFactory.NecessaryTypeSymbol(TypeDesc) + 0xd3
[08:44:40] at Internal.JitInterface.CorInfoImpl.embedClassHandle(CORINFO_CLASS_STRUCT_*, Void*&) + 0x90
[08:44:40] at Internal.JitInterface.CorInfoImpl._embedClassHandle(IntPtr, IntPtr*, CORINFO_CLASS_STRUCT_*, Void**) + 0x4b
[08:44:40] at Internal.JitInterface.CorInfoImpl.JitCompileMethod(IntPtr&, IntPtr, IntPtr, IntPtr, CORINFO_METHOD_INFO&, UInt32, IntPtr&, UInt32&) + 0xcd
[08:44:40] at Internal.JitInterface.CorInfoImpl.CompileMethodInternal(IMethodNode, MethodIL) + 0xe7
[08:44:40] at Internal.JitInterface.CorInfoImpl.CompileMethod(MethodCodeNode, MethodIL) + 0x67
[08:44:40] at ILCompiler.RyuJitCompilation.CompileSingleMethod(CorInfoImpl, MethodCodeNode) + 0xc1
[08:44:40] at ILCompiler.RyuJitCompilation.CompileSingleMethod(MethodCodeNode) + 0xf8
[08:44:40] at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker&, Int64, Boolean&) + 0x15c
[08:44:40] at System.Threading.Tasks.TaskReplicator.Replica.Execute() + 0x5f
[08:44:40] at System.Threading.ExecutionContext.RunInternal(ExecutionContext, ContextCallback, Object) + 0x9c
[08:44:40] at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task&, Thread) + 0x102
[08:44:40] at System.Threading.Tasks.ThreadPoolTaskScheduler.TryExecuteTaskInline(Task, Boolean) + 0xc0
[08:44:40] at System.Threading.Tasks.TaskScheduler.TryRunInline(Task, Boolean) + 0xa6
[08:44:40] at System.Threading.Tasks.Task.InternalRunSynchronously(TaskScheduler, Boolean) + 0xa7
[08:44:40] at System.Threading.Tasks.TaskReplicator.Run[TState](TaskReplicator.ReplicatableUserAction`1, ParallelOptions, Boolean) + 0x183
[08:44:40] at System.Threading.Tasks.Parallel.ForWorker[TLocal,TInt](TInt, TInt, ParallelOptions, Action`1, Action`2, Func`4, Func`1, Action`1) + 0x1f2
[08:44:40] at ILCompiler.RyuJitCompilation.CompileMultiThreaded(List`1) + 0x24a
[08:44:40] at ILCompiler.RyuJitCompilation.ComputeDependencyNodeDependencies(List`1) + 0x172
[08:44:40] at ILCompiler.DependencyAnalysisFramework.DependencyAnalyzer`2.ComputeMarkedNodes() + 0x161
[08:44:40] at ILCompiler.RyuJitCompilation.CompileInternal(String, ObjectDumper) + 0x23
[08:44:40] at ILCompiler.Compilation.ILCompiler.ICompilation.Compile(String, ObjectDumper) + 0x4c
[08:44:40] at ILCompiler.Program.Run() + 0x2b95
[08:44:40] at ILCompiler.ILCompilerRootCommand.<>c__DisplayClass249_0.<.ctor>b__0(ParseResult) + 0x30f
[08:44:40] at System.CommandLine.Invocation.InvocationPipeline.Invoke(ParseResult) + 0x69
[08:44:40] at ILCompiler.Program.Main(String[] args) + 0xde

example job:
https://dev.azure.com/dnceng/internal/_build/results?buildId=2692581&view=logs&j=5eaadb19-0c1f-5ec8-5e1a-fa86334b456a&t=726ae452-d9f7-5196-012c-0d1cf38578f2

These crashes seem to lead to SuperPMI collection data corruption, which ends up with ERROR: Method 2007 is of low integrity. messages, which, presumably, is what causes this job to be marked as "warning".

@dotnet/jit-contrib @MichalStrehovsky

Activity

added this to the 10.0.0 milestone on Apr 22, 2025
dotnet-policy-service

dotnet-policy-service commented on Apr 22, 2025

@dotnet-policy-service
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

MichalStrehovsky

MichalStrehovsky commented on Apr 28, 2025

@MichalStrehovsky
Member

The assert is caused by JIT asking for partially canonicalized types (think: Dictionary<__Canon, object>). These need to be concrete (e.g. Dictionary<string, object>) or fully canonical (Dictionary<__Canon, __Canon>).

amanasifkhalid

amanasifkhalid commented on Apr 30, 2025

@amanasifkhalid
Contributor

@BruceForstall are you still able to access the SPMI job logs? Using a new access token for the most recent run, I'm still getting "NotFound" responses on my end.

BruceForstall

BruceForstall commented on Apr 30, 2025

@BruceForstall
ContributorAuthor

@BruceForstall are you still able to access the SPMI job logs? Using a new access token for the most recent run, I'm still getting "NotFound" responses on my end.

Yes, it looks like the links are broken. Maybe they got rid of token authentication.

amanasifkhalid

amanasifkhalid commented on May 15, 2025

@amanasifkhalid
Contributor

This was likely introduced by #111293. @AndyAyersMS should we just skip the extra SPMI queries for shared instances, or are there some extra lookups stack allocation will do to handle these cases?

AndyAyersMS

AndyAyersMS commented on May 16, 2025

@AndyAyersMS
Member

This was likely introduced by #111293. @AndyAyersMS should we just skip the extra SPMI queries for shared instances, or are there some extra lookups stack allocation will do to handle these cases?

We can skip them.

added a commit that references this issue on May 16, 2025
2f8f6e7
locked and limited conversation to collaborators on Jun 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIblocking-clean-ci-optionalBlocking optional rolling runs

Type

No type

Projects

No projects

Relationships

None yet

    Development

    Participants

    @AndyAyersMS@BruceForstall@MichalStrehovsky@amanasifkhalid

    Issue actions

      ILC assertion failure: type == type.ConvertToCanonForm(CanonicalFormKind.Specific) · Issue #114934 · dotnet/runtime