Skip to content

ILC is hitting a NullReferenceException when processing linker XML from an assembly #108031

Closed

Description

@ericstj

Build Information

Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=812591
Build error leg or test failing: Build / osx-x64 Debug CoreCLR_Libraries / Build product
Pull request: #107639

Error Message

Fill the error message using step by step known issues guidance.

{
  "ErrorMessage": ["Code generation failed for method", "System.NullReferenceException", "System.Xml.XPath.XPathNodeIterator.Enumerator.MoveNext" ]
  "ErrorPattern": "",
  "BuildRetry": true,
  "ExcludeConsoleLog": false
}

error from ILC:

  ILLink.Tasks -> /Users/runner/work/1/s/artifacts/bin/ILLink.Tasks/Debug/net9.0/ILLink.Tasks.dll
  System.Private.CoreLib.Generators -> /Users/runner/work/1/s/artifacts/bin/System.Private.CoreLib.Generators/Release/netstandard2.0/System.Private.CoreLib.Generators.dll
  System.Private.CoreLib -> /Users/runner/work/1/s/artifacts/bin/System.Private.CoreLib/ref/Release/net9.0/System.Private.CoreLib.dll
  Microsoft.Interop.SourceGeneration -> /Users/runner/work/1/s/artifacts/bin/Microsoft.Interop.SourceGeneration/Debug/netstandard2.0/Microsoft.Interop.SourceGeneration.dll
  LibraryImportGenerator -> /Users/runner/work/1/s/artifacts/bin/LibraryImportGenerator/Debug/netstandard2.0/Microsoft.Interop.LibraryImportGenerator.dll
  System.Private.CoreLib -> /Users/runner/work/1/s/artifacts/bin/coreclr/osx.x64.Release/IL/System.Private.CoreLib.dll
  cdac-build-tool -> /Users/runner/work/1/s/artifacts/bin/coreclr/osx.x64.Release/cdac-build-tool/cdac-build-tool.dll
  Generating native code
EXEC : error : One or more errors occurred. (Code generation failed for method '[System.Runtime.InteropServices]System.Runtime.InteropServices.Marshalling.ComExposedClassAttribute`1<System.__Canon>..ctor()') [/Users/runner/work/1/s/src/native/managed/cdacreader/src/cdacreader.csproj]
##[error]EXEC(0,0): error : (NETCORE_ENGINEERING_TELEMETRY=Build) One or more errors occurred. (Code generation failed for method '[System.Runtime.InteropServices]System.Runtime.InteropServices.Marshalling.ComExposedClassAttribute`1<System.__Canon>..ctor()')
  System.AggregateException: One or more errors occurred. (Code generation failed for method '[System.Runtime.InteropServices]System.Runtime.InteropServices.Marshalling.ComExposedClassAttribute`1<System.__Canon>..ctor()')
   ---> ILCompiler.CodeGenerationFailedException: Code generation failed for method '[System.Runtime.InteropServices]System.Runtime.InteropServices.Marshalling.ComExposedClassAttribute`1<System.__Canon>..ctor()'
   ---> ILCompiler.NativeAotFatalErrorException: ILC: error IL1013: Error processing 'name'.
   ---> System.NullReferenceException: Object reference not set to an instance of an object.
     at System.Xml.XPath.XNodeNavigator.MoveToFirstChild() + 0x22
     at MS.Internal.Xml.XPath.XPathChildIterator.MoveNext() + 0x1c
     at System.Xml.XPath.XPathNodeIterator.Enumerator.MoveNext() + 0xe9
     at ILCompiler.ProcessLinkerXmlBase.ProcessAssemblies(XPathNavigator) + 0x169
     at ILCompiler.ProcessLinkerXmlBase.ProcessXml(Boolean) + 0x105
     --- End of inner exception stack trace ---
     at ILCompiler.ProcessLinkerXmlBase.ProcessXml(Boolean) + 0x25b
     at ILCompiler.SubstitutionProvider.AssemblyFeatureInfo..ctor(EcmaModule, Logger, IReadOnlyDictionary`2, BodyAndFieldSubstitutions) + 0x193
     at ILCompiler.SubstitutionProvider.FeatureSwitchHashtable.CreateValueFromKey(EcmaModule) + 0x35
     at Internal.TypeSystem.LockFreeReaderHashtable`2.CreateValueAndEnsureValueIsInTable(TKey) + 0x14
     at ILCompiler.SubstitutionProvider.GetSubstitution(MethodDesc) + 0x78
     at ILCompiler.SubstitutedILProvider.GetMethodIL(MethodDesc) + 0x20
     at ILCompiler.Compilation.CombinedILProvider.GetMethodIL(MethodDesc) + 0x1f
     at ILCompiler.Compilation.ILCache.CreateValueFromKey(MethodDesc) + 0x3a
     at Internal.TypeSystem.LockFreeReaderHashtable`2.CreateValueAndEnsureValueIsInTable(TKey) + 0x14
     at ILCompiler.Compilation.GetMethodIL(MethodDesc) + 0xc0
     at Internal.IL.ILImporter..ctor(ILScanner, MethodDesc, MethodIL) + 0x5a
     at ILCompiler.ILScanner.CompileSingleMethod(ScannedMethodNode) + 0x46
     --- End of inner exception stack trace ---
     at ILCompiler.ILScanner.CompileSingleMethod(ScannedMethodNode) + 0x20e
     at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker&, Int64, Boolean&) + 0x10a
  --- End of stack trace from previous location ---
     at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker&, Int64, Boolean&) + 0x51b
     at System.Threading.Tasks.TaskReplicator.Replica.Execute() + 0x8d
     --- End of inner exception stack trace ---
     at System.Threading.Tasks.TaskReplicator.Run[TState](TaskReplicator.ReplicatableUserAction`1, ParallelOptions, Boolean) + 0x2bf
     at System.Threading.Tasks.Parallel.ForWorker[TLocal,TInt](TInt, TInt, ParallelOptions, Action`1, Action`2, Func`4, Func`1, Action`1) + 0x216
  --- 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) + 0x42e
     at ILCompiler.ILScanner.CompileMultiThreaded(List`1) + 0x242
     at ILCompiler.ILScanner.ComputeDependencyNodeDependencies(List`1) + 0x170
     at ILCompiler.DependencyAnalysisFramework.DependencyAnalyzer`2.ComputeMarkedNodes() + 0x14e
     at ILCompiler.ILScanner.ILCompiler.IILScanner.Scan() + 0x19
     at ILCompiler.Program.<Run>g__RunScanner|4_0(Program.<>c__DisplayClass4_0&) + 0x21f
     at ILCompiler.Program.Run() + 0x29cd
     at ILCompiler.ILCompilerRootCommand.<>c__DisplayClass240_0.<.ctor>b__0(ParseResult) + 0x31e
/Users/runner/work/1/s/.packages/microsoft.dotnet.ilcompiler/9.0.0-rc.1.24431.7/build/Microsoft.NETCore.Native.targets(317,5): error MSB3073: The command ""/Users/runner/work/1/s/.packages/runtime.osx-x64.microsoft.dotnet.ilcompiler/9.0.0-rc.1.24431.7/tools/ilc" @"/Users/runner/work/1/s/artifacts/obj/cdacreader/Release/net9.0/osx-x64/native/libcdacreader.ilc.rsp"" exited with code 1. [/Users/runner/work/1/s/src/native/managed/cdacreader/src/cdacreader.csproj]

Report

Summary

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

Activity

  1. added
    blocking-clean-ci
    Known Build Error
    on Sep 19, 2024
  2. added
    untriaged
    on Sep 19, 2024
  3. dotnet-policy-service commented on Sep 19, 2024

    @dotnet-policy-service
    Contributor

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

  4. MichalStrehovsky commented on Sep 20, 2024

    @MichalStrehovsky
    Member

    This is very close to where we were hitting #104340 in the compiler. It's possible it's the same issue, just a different manifestation.

    We'll know when we update the SDK that builds the repo to RC2 (it has the fix).

  5. agocke commented on Sep 30, 2024

    @agocke
    Member

    Closing, as no more hits.

  6. removed
    untriaged
    on Sep 30, 2024
  7. martincostello commented on Oct 27, 2024

    @martincostello
    Member

    I just hit this building 2c471af locally on Windows 11:

    runtime on  main via .NET v9.0.100-rc.2.24474.11
    ❯ .\build.cmd
      Determining projects to restore...
      Tool 'coverlet.console' (version '6.0.0') was restored. Available commands: coverlet
      Tool 'dotnet-reportgenerator-globaltool' (version '5.3.0') was restored. Available commands: reportgenerator
      Tool 'microsoft.dotnet.xharness.cli' (version '10.0.0-prerelease.24524.3') was restored. Available commands: xhar
      ness
      Tool 'microsoft.visualstudio.slngen.tool' (version '11.1.0') was restored. Available commands: slngen
    
      Restore was successful.
      All projects are up-to-date for restore.
      Determining projects to restore...
      Restored D:\Coding\dotnet\runtime\src\libraries\pretest.proj (in 238 ms).
      621 of 622 projects are up-to-date for restore.
      ILLink.RoslynAnalyzer -> D:\Coding\dotnet\runtime\artifacts\bin\ILLink.RoslynAnalyzer\Debug\netstandard2.0\ILLink
      .RoslynAnalyzer.dll
      ILLink.CodeFixProvider -> D:\Coding\dotnet\runtime\artifacts\bin\ILLink.CodeFixProvider\Debug\netstandard2.0\ILLi
      nk.CodeFixProvider.dll
      Mono.Linker -> D:\Coding\dotnet\runtime\artifacts\bin\Mono.Linker\ref\Debug\net9.0\illink.dll
      Mono.Linker -> D:\Coding\dotnet\runtime\artifacts\bin\Mono.Linker\Debug\net9.0\illink.dll
      ILLink.Tasks -> D:\Coding\dotnet\runtime\artifacts\bin\ILLink.Tasks\Debug\net9.0\ILLink.Tasks.dll
      System.Private.CoreLib.Generators -> D:\Coding\dotnet\runtime\artifacts\bin\System.Private.CoreLib.Generators\Deb
      ug\netstandard2.0\System.Private.CoreLib.Generators.dll
      System.Private.CoreLib -> D:\Coding\dotnet\runtime\artifacts\bin\System.Private.CoreLib\ref\Debug\net10.0\System.
      Private.CoreLib.dll
      Microsoft.Interop.SourceGeneration -> D:\Coding\dotnet\runtime\artifacts\bin\Microsoft.Interop.SourceGeneration\D
      ebug\netstandard2.0\Microsoft.Interop.SourceGeneration.dll
      LibraryImportGenerator -> D:\Coding\dotnet\runtime\artifacts\bin\LibraryImportGenerator\Debug\netstandard2.0\Micr
      osoft.Interop.LibraryImportGenerator.dll
      System.Private.CoreLib -> D:\Coding\dotnet\runtime\artifacts\bin\coreclr\windows.x64.Debug\IL\System.Private.Core
      Lib.dll
      Microsoft.Diagnostics.DataContractReader.Abstractions -> D:\Coding\dotnet\runtime\artifacts\bin\Microsoft.Diagnos
      tics.DataContractReader.Abstractions\Debug\net9.0\Microsoft.Diagnostics.DataContractReader.Abstractions.dll
      cdac-build-tool -> D:\Coding\dotnet\runtime\artifacts\bin\coreclr\windows.x64.Debug\cdac-build-tool\cdac-build-to
      ol.dll
      Microsoft.Diagnostics.DataContractReader.Contracts -> D:\Coding\dotnet\runtime\artifacts\bin\Microsoft.Diagnostic
      s.DataContractReader.Contracts\Debug\net9.0\Microsoft.Diagnostics.DataContractReader.Contracts.dll
      Microsoft.Diagnostics.DataContractReader -> D:\Coding\dotnet\runtime\artifacts\bin\Microsoft.Diagnostics.DataCont
      ractReader\Debug\net9.0\Microsoft.Diagnostics.DataContractReader.dll
      cdacreader -> D:\Coding\dotnet\runtime\artifacts\bin\cdacreader\Debug\net9.0\win-x64\cdacreader.dll
      Generating native code
    EXEC : error : One or more errors occurred. (ILC: error IL1013: Error processing 'name'.) [D:\Coding\dotnet\runtime
    \src\native\managed\cdacreader\src\cdacreader.csproj]
      System.AggregateException: One or more errors occurred. (ILC: error IL1013: Error processing 'name'.)
       ---> ILCompiler.NativeAotFatalErrorException: ILC: error IL1013: Error processing 'name'.
       ---> System.NullReferenceException: Object reference not set to an instance of an object.
         at System.Xml.XPath.XNodeNavigator.MoveToFirstChild() + 0x22
         at MS.Internal.Xml.XPath.XPathChildIterator.MoveNext() + 0x19
         at System.Xml.XPath.XPathNodeIterator.Enumerator.MoveNext() + 0xd6
         at ILCompiler.ProcessLinkerXmlBase.ProcessAssemblies(XPathNavigator) + 0x15b
         at ILCompiler.ProcessLinkerXmlBase.ProcessXml(Boolean) + 0xfa
         --- End of inner exception stack trace ---
         at ILCompiler.ProcessLinkerXmlBase.ProcessXml(Boolean) + 0x1d9
         at ILCompiler.SubstitutionProvider.AssemblyFeatureInfo..ctor(EcmaModule, Logger, IReadOnlyDictionary`2, BodyAn
      dFieldSubstitutions) + 0x1ce
         at ILCompiler.SubstitutionProvider.FeatureSwitchHashtable.CreateValueFromKey(EcmaModule) + 0x4e
         at Internal.TypeSystem.LockFreeReaderHashtable`2.CreateValueAndEnsureValueIsInTable(TKey) + 0x18
         at ILCompiler.SubstitutionProvider.GetSubstitution(MethodDesc) + 0x77
         at ILCompiler.SubstitutedILProvider.GetMethodIL(MethodDesc) + 0x1b
         at ILCompiler.Compilation.CombinedILProvider.GetMethodIL(MethodDesc) + 0x21
         at ILCompiler.Compilation.ILCache.CreateValueFromKey(MethodDesc) + 0x3c
         at Internal.TypeSystem.LockFreeReaderHashtable`2.CreateValueAndEnsureValueIsInTable(TKey) + 0x18
         at ILCompiler.Compilation.GetMethodIL(MethodDesc) + 0xb6
         at Internal.JitInterface.CorInfoImpl.CompileMethod(MethodCodeNode, MethodIL) + 0x4a
         at ILCompiler.RyuJitCompilation.CompileSingleMethod(CorInfoImpl, MethodCodeNode) + 0x97
         at ILCompiler.RyuJitCompilation.CompileSingleMethod(MethodCodeNode) + 0xbf
         at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker&, Int64, Boolean&) + 0x
      10d
      --- End of stack trace from previous location ---
         at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker&, Int64, Boolean&) + 0x
      4e4
         at System.Threading.Tasks.TaskReplicator.Replica.Execute() + 0xb1
         --- End of inner exception stack trace ---
         at System.Threading.Tasks.TaskReplicator.Run[TState](TaskReplicator.ReplicatableUserAction`1, ParallelOptions,
       Boolean) + 0x2b2
         at System.Threading.Tasks.Parallel.ForWorker[TLocal,TInt](TInt, TInt, ParallelOptions, Action`1, Action`2, Fun
      c`4, Func`1, Action`1) + 0x21f
      --- End of stack trace from previous location ---
         at System.Threading.Tasks.Parallel.ThrowSingleCancellationExceptionOrOtherException(ICollection, CancellationT
      oken, Exception) + 0x30
         at System.Threading.Tasks.Parallel.ForWorker[TLocal,TInt](TInt, TInt, ParallelOptions, Action`1, Action`2, Fun
      c`4, Func`1, Action`1) + 0x449
         at ILCompiler.RyuJitCompilation.CompileMultiThreaded(List`1) + 0x267
         at ILCompiler.RyuJitCompilation.ComputeDependencyNodeDependencies(List`1) + 0x156
         at ILCompiler.DependencyAnalysisFramework.DependencyAnalyzer`2.ComputeMarkedNodes() + 0xa3
         at ILCompiler.RyuJitCompilation.CompileInternal(String, ObjectDumper) + 0x26
         at ILCompiler.Compilation.ILCompiler.ICompilation.Compile(String, ObjectDumper) + 0x5d
         at ILCompiler.Program.Run() + 0x2c4c
         at ILCompiler.ILCompilerRootCommand.<>c__DisplayClass240_0.<.ctor>b__0(ParseResult) + 0x321
    D:\packages\nuget\microsoft.dotnet.ilcompiler\9.0.0-rc.2.24473.5\build\Microsoft.NETCore.Native.targets(317,5): err
    or MSB3073: The command ""D:\packages\nuget\runtime.win-x64.microsoft.dotnet.ilcompiler\9.0.0-rc.2.24473.5\tools\\i
    lc" @"D:\Coding\dotnet\runtime\artifacts\obj\cdacreader\Debug\net9.0\win-x64\native\cdacreader.ilc.rsp"" exited wit
    h code 1. [D:\Coding\dotnet\runtime\src\native\managed\cdacreader\src\cdacreader.csproj]
    
    Build FAILED.
    
    EXEC : error : One or more errors occurred. (ILC: error IL1013: Error processing 'name'.) [D:\Coding\dotnet\runtime
    \src\native\managed\cdacreader\src\cdacreader.csproj]
    D:\packages\nuget\microsoft.dotnet.ilcompiler\9.0.0-rc.2.24473.5\build\Microsoft.NETCore.Native.targets(317,5): err
    or MSB3073: The command ""D:\packages\nuget\runtime.win-x64.microsoft.dotnet.ilcompiler\9.0.0-rc.2.24473.5\tools\\i
    lc" @"D:\Coding\dotnet\runtime\artifacts\obj\cdacreader\Debug\net9.0\win-x64\native\cdacreader.ilc.rsp"" exited wit
    h code 1. [D:\Coding\dotnet\runtime\src\native\managed\cdacreader\src\cdacreader.csproj]
        0 Warning(s)
        2 Error(s)
    
    Time Elapsed 00:01:22.85
    Build failed with exit code 1. Check errors above.
    Some builds failed:
            Configuration: Debug, Architecture: x64
  8. locked and limited conversation to collaborators on Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Known Build Errorarea-NativeAOT-coreclrblocking-clean-ci

    Type

    No type

    Projects

    • Status
      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions