This repository was archived by the owner on Sep 25, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 25, 2026. It is now read-only.
linker: NRE in Mono.Linker.TypeMapInfo.MapOverrides #2789
Copy link
Copy link
Closed
Labels
Milestone
Description
Hit on dotnet/runtime#68988 , build:
##[error]/_/src/libraries/System.Private.CoreLib/src/System/Reflection/AssemblyName.cs(192,13): error IL1005: (NETCORE_ENGINEERING_TELEMETRY=Build) System.Reflection.AssemblyName.GetAssemblyName(String): Error processing method 'System.Reflection.AssemblyName.InitGetAssemblyName()' in assembly 'System.Private.CoreLib.dll'.
Mono.Linker.LinkerFatalErrorException: /_/src/libraries/System.Private.CoreLib/src/System/Reflection/AssemblyName.cs(192,13): error IL1005: System.Reflection.AssemblyName.GetAssemblyName(String): Error processing method 'System.Reflection.AssemblyName.InitGetAssemblyName()' in assembly 'System.Private.CoreLib.dll'.
---> System.NullReferenceException: Object reference not set to an instance of an object.
at Mono.Linker.TypeMapInfo.MapOverrides(MethodDefinition method)
at Mono.Linker.TypeMapInfo.MapVirtualMethods(TypeDefinition type)
at Mono.Linker.TypeMapInfo.MapType(TypeDefinition type)
at Mono.Linker.TypeMapInfo.MapType(TypeDefinition type)
at Mono.Linker.TypeMapInfo.EnsureProcessed(AssemblyDefinition assembly)
at Mono.Linker.TypeMapInfo.GetBaseMethods(MethodDefinition method)
at Mono.Linker.Steps.MarkStep.IsMethodNeededByTypeDueToPreservedScope(MethodDefinition method)
at Mono.Linker.Steps.MarkStep.MarkMethodsIf(Collection`1 methods, Func`2 predicate, DependencyInfo& reason, MessageOrigin& origin)
at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference, DependencyInfo reason, Nullable`1 origin)
at Mono.Linker.Steps.MarkStep.MarkTypeVisibleToReflection(TypeReference type, TypeDefinition definition, DependencyInfo& reason, MessageOrigin& origin)
at Mono.Linker.Dataflow.ReflectionMarker.TryResolveTypeNameAndMark(String typeName, MessageOrigin origin, Boolean needsAssemblyName, TypeDefinition& type)
at ILLink.Shared.TrimAnalysis.RequireDynamicallyAccessedMembersAction.TryResolveTypeNameAndMark(String typeName, Boolean needsAssemblyName, TypeProxy& type)
at ILLink.Shared.TrimAnalysis.HandleCallAction.Invoke(MethodProxy calledMethod, ValueSet`1 instanceValue, IReadOnlyList`1 argumentValues, ValueSet`1& methodReturnValue, IntrinsicId& intrinsicId)
at Mono.Linker.Dataflow.ReflectionMethodBodyScanner.HandleCall(MethodBody callingMethodBody, MethodReference calledMethod, Instruction operation, ValueNodeList methodParams, ValueSet`1& methodReturnValue)
at Mono.Linker.Dataflow.MethodBodyScanner.HandleCall(MethodBody callingMethodBody, Instruction operation, Stack`1 currentStack, Int32 curBasicBlock)
at Mono.Linker.Dataflow.MethodBodyScanner.Scan(MethodBody methodBody)
at Mono.Linker.Dataflow.ReflectionMethodBodyScanner.ScanAndProcessReturnValue(MethodBody methodBody)
at Mono.Linker.Steps.MarkStep.MarkReflectionLikeDependencies(MethodBody body, Boolean requiresReflectionMethodBodyScanner)
at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method, DependencyInfo& reason, MessageOrigin& origin)
at Mono.Linker.Steps.MarkStep.ProcessQueue()
--- End of inner exception stack trace ---
at Mono.Linker.Steps.MarkStep.ProcessQueue()
at Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue()
at Mono.Linker.Steps.MarkStep.Process()
at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
at Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step)
at Mono.Linker.Pipeline.Process(LinkContext context)
at Mono.Linker.Driver.Run(ILogger customLogger, Boolean throwOnFatalLinkerException)
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNo status
Activity
marek-safar commentedon May 10, 2022
/cc @vitek-karas @sbomer
vitek-karas commentedon May 10, 2022
@radical does it repro still? The link to the failing build seems broken (I can't open that page, AzDo errors), but honestly looking around the code we would need a repro to diagnose this - it's really weird.
radical commentedon May 28, 2022
Hit this again - build:
sbomer commentedon Jul 25, 2022
I suspect this is another case of a GC hole causing a linker crash. Closing as a duplicate of dotnet/runtime#69536, but please re-open if this shows up again.