dotnet / runtimelab

This repo is for experimentation and exploring new ideas that may or may not make it into the main dotnet/runtime repo.
MIT License
1.42k stars 198 forks source link

Recent regression in the ILCompiler #927

Closed adamsitnik closed 3 years ago

adamsitnik commented 3 years ago

It seems that one of the BenchmarkDotNet tests that ensures that latest CoreRT is supported started failing very recently.

Repro

git clone https://github.com/dotnet/BenchmarkDotNet.git
cd BenchmarkDotNet/tests/BenchmarkDotNet.IntegrationTests
dotnet test -c Release -f net5.0 --filter LatestCoreRT

Error

  C:\Users\adsitnik\.nuget\packages\microsoft.dotnet.ilcompiler\6.0.0-preview.4.21206.3\build\Microsoft.NETCore.Native.targets(259,5): error MSB3073: The command ""C:\Users\adsitnik\.nuget\packages\runtime.win-x64.microsoft.dotnet.ilcompiler\6.0.0-preview.4.21206.3\tools\ilc" @"obj\Release\net5.0\win-x64\native\de91d975-d000-4dbe-9465-6ebfcab9d56f.ilc.rsp"" exited with code 1. [C:\Projects\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net5.0\de91d975-d000-4dbe-9465-6ebfcab9d56f\BenchmarkDotNet.Autogenerated.csproj]
      at ILCompiler.Program.Main(String[] args)
      at ILCompiler.Program.Run(String[] args)
      at ILCompiler.Compilation.ILCompiler.ICompilation.Compile(String outputFile, ObjectDumper dumper)
      at ILCompiler.RyuJitCompilation.CompileInternal(String outputFile, ObjectDumper dumper)
      at ILCompiler.DependencyAnalysis.ObjectWriter.EmitObject(String objectFilePath, IEnumerable`1 nodes, NodeFactory factory, ObjectWritingOptions options, IObjectDumper dumper)
      at ILCompiler.DependencyAnalysis.MetadataNode.GetData(NodeFactory factory, Boolean relocsOnly)
      at ILCompiler.AnalysisBasedMetadataManager.ComputeMetadata(NodeFactory factory, Byte[]& metadataBlob, List`1& typeMappings, List`1& methodMappings, List`1& fieldMappings, List`1& stackTraceMapping)
      at ILCompiler.GeneratingMetadataManager.ComputeMetadata[TPolicy](TPolicy policy, NodeFactory factory, Byte[]& metadataBlob, List`1& typeMappings, List`1& methodMappings, List`1& fieldMappings, List`1& stackTraceMapping)
      at ILCompiler.Metadata.MetadataTransform.Run[TPolicy](TPolicy policy, IEnumerable`1 modules)
      at ILCompiler.Metadata.Transform`1.HandleType(TypeDesc type)
      at ILCompiler.Metadata.EntityMap`2.Create[TConcreteEntity,TConcreteRecord](TConcreteEntity entity, Action`2 initializer)
      at ILCompiler.Metadata.Transform`1.InitializeTypeDef(MetadataType entity, TypeDefinition record)
      at ILCompiler.Metadata.Transform`1.HandleNamespaceDefinition(ModuleDesc parentScope, String namespaceString)
      at ILCompiler.Metadata.EntityMap`2.GetOrCreate[TConcreteEntity,TConcreteRecord](TConcreteEntity entity, Action`2 initializer)
      at ILCompiler.Metadata.Transform`1.InitializeScopeDefinition(ModuleDesc module, ScopeDefinition scopeDefinition)
      at ILCompiler.Metadata.Transform`1.HandleTypeForwarders(EcmaModule module)
      at ILCompiler.AnalysisBasedMetadataManager.Policy.GeneratesMetadata(EcmaModule module, ExportedTypeHandle exportedTypeHandle)
      at System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value)
      at System.Collections.Generic.Dictionary`2.FindValue(TKey key)
   System.ArgumentNullException: Value cannot be null. (Parameter 'key')
 EXEC : error : Value cannot be null. (Parameter 'key') [C:\Projects\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net5.0\de91d975-d000-4dbe-9465-6ebfcab9d56f\BenchmarkDotNet.Autogenerated.csproj]
 ILC : AOT analysis warning IL9701: System.Management.WbemDefPath.WbemDefPath(): COM interop is not supported with full ahead of time compilation [C:\Projects\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net5.0\de91d975-d000-4dbe-9465-6ebfcab9d56f\BenchmarkDotNet.Autogenerated.csproj]
 ILC : AOT analysis warning IL9701: System.Management.WbemObjectTextSrc.WbemObjectTextSrc(): COM interop is not supported with full ahead of time compilation [C:\Projects\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net5.0\de91d975-d000-4dbe-9465-6ebfcab9d56f\BenchmarkDotNet.Autogenerated.csproj]
 ILC : AOT analysis warning IL9701: System.Management.WbemLocator.WbemLocator(): COM interop is not supported with full ahead of time compilation [C:\Projects\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net5.0\de91d975-d000-4dbe-9465-6ebfcab9d56f\BenchmarkDotNet.Autogenerated.csproj]
 ILC : AOT analysis warning IL9701: System.Management.WbemStatusCodeText.WbemStatusCodeText(): COM interop is not supported with full ahead of time compilation [C:\Projects\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net5.0\de91d975-d000-4dbe-9465-6ebfcab9d56f\BenchmarkDotNet.Autogenerated.csproj]
 ILC : AOT analysis warning IL9701: System.Management.WbemContext.WbemContext(): COM interop is not supported with full ahead of time compilation [C:\Projects\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net5.0\de91d975-d000-4dbe-9465-6ebfcab9d56f\BenchmarkDotNet.Autogenerated.csproj]
   Generating native code

cc @MichalStrehovsky

MichalStrehovsky commented 3 years ago

Thanks for reporting this. It's a duplicate of #926.

adamsitnik commented 3 years ago

It's a duplicate of #926.

Then I am going to close this one and follow #926. Thanks!

adamsitnik commented 3 years ago

The fix (#936) has solved the problem

MichalStrehovsky commented 3 years ago

Thank you for confirming!