Repository navigation
Closed
Labels
Description
I was trying to debug why compilation of the repro above takes 10+ hours (never managed to actually run to the end). When running with debug version of ILCompiler I hit the following assertion early on:
Asking for Array<T> MethodTable
at ILCompiler.DependencyAnalysis.EETypeNode.OnMarked(NodeFactory context) in C:\Users\filip_pq4cffv\Documents\runtime\src\coreclr\tools\aot\ILCompiler.Compiler\Compiler\DependencyAnalysis\EETypeNode.cs:line 1331
at ILCompiler.DependencyAnalysisFramework.DependencyNodeCore`1.CallOnMarked(DependencyContextType context) in C:\Users\filip_pq4cffv\Documents\runtime\src\coreclr\tools\aot\ILCompiler.DependencyAnalysisFramework\DependencyNodeCore.cs:line 134
at ILCompiler.DependencyAnalysisFramework.DependencyAnalyzer`2.AddToMarkStack(DependencyNodeCore`1 node, String reason, DependencyNodeCore`1 reason1, DependencyNodeCore`1 reason2) in C:\Users\filip_pq4cffv\Documents\runtime\src\coreclr\tools\aot\ILCompiler.DependencyAnalysisFramework\DependencyAnalyzer.cs:line 363
at ILCompiler.DependencyAnalysisFramework.DependencyAnalyzer`2.GetStaticDependenciesImpl(DependencyNodeCore`1 node) in C:\Users\filip_pq4cffv\Documents\runtime\src\coreclr\tools\aot\ILCompiler.DependencyAnalysisFramework\DependencyAnalyzer.cs:line 187
at ILCompiler.DependencyAnalysisFramework.DependencyAnalyzer`2.GetStaticDependencies(DependencyNodeCore`1 node) in C:\Users\filip_pq4cffv\Documents\runtime\src\coreclr\tools\aot\ILCompiler.DependencyAnalysisFramework\DependencyAnalyzer.cs:line 222
at ILCompiler.DependencyAnalysisFramework.DependencyAnalyzer`2.ProcessMarkStack() in C:\Users\filip_pq4cffv\Documents\runtime\src\coreclr\tools\aot\ILCompiler.DependencyAnalysisFramework\DependencyAnalyzer.cs:line 257
at ILCompiler.DependencyAnalysisFramework.DependencyAnalyzer`2.ComputeMarkedNodes() in C:\Users\filip_pq4cffv\Documents\runtime\src\coreclr\tools\aot\ILCompiler.DependencyAnalysisFramework\DependencyAnalyzer.cs:line 308
at ILCompiler.RyuJitCompilation.CompileInternal(String outputFile, ObjectDumper dumper) in C:\Users\filip_pq4cffv\Documents\runtime\src\coreclr\tools\aot\ILCompiler.RyuJit\Compiler\RyuJitCompilation.cs:line 88
at ILCompiler.Compilation.ILCompiler.ICompilation.Compile(String outputFile, ObjectDumper dumper) in C:\Users\filip_pq4cffv\Documents\runtime\src\coreclr\tools\aot\ILCompiler.Compiler\Compiler\Compilation.cs:line 523
at ILCompiler.Program.Run() in C:\Users\filip_pq4cffv\Documents\runtime\src\coreclr\tools\aot\ILCompiler\Program.cs:line 545
at ILCompiler.ILCompilerRootCommand.<>c__DisplayClass215_0.<.ctor>b__0(InvocationContext context) in C:\Users\filip_pq4cffv\Documents\runtime\src\coreclr\tools\aot\ILCompiler\ILCompilerRootCommand.cs:line 286
at System.CommandLine.Invocation.AnonymousCommandHandler.Invoke(InvocationContext context)
at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<BuildInvocationChain>b__0(InvocationContext invocationContext, Func`2 _)
at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseParseErrorReporting>b__0>d.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<UseParseErrorReporting>b__0(InvocationContext context, Func`2 next)
at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass11_0.<<UseHelp>b__0>d.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass11_0.<UseHelp>b__0(InvocationContext context, Func`2 next)
at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseVersionOption>b__0>d.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<UseVersionOption>b__0(InvocationContext context, Func`2 next)
at System.CommandLine.Invocation.InvocationPipeline.<Invoke>g__FullInvocationChain|3_0(InvocationContext context)
at System.CommandLine.Invocation.InvocationPipeline.Invoke(IConsole console)
at ILCompiler.Program.Main(String[] args) in C:\Users\filip_pq4cffv\Documents\runtime\src\coreclr\tools\aot\ILCompiler\Program.cs:line 709
Note: The assemblies were preprocessed with Xamarin ILLink steps with the following PRs applied - dotnet/macios#18524, dotnet/macios#18519, and dotnet/macios#18421
Activity
filipnavara commentedon Jul 1, 2023
Apparently basically all the assemblies end up as
--rooton the ILC command line. I'm going back in the MSBuild chain to figure out how that happened.filipnavara commentedon Jul 1, 2023
Looks like this may affect any publish with
-c Debugfor Xamarin+NativeAOT. In that configuration it usescopytrim mode by default and it ends up having some unintended side effects. It's fine if that's unsupported but it should be caught early instead of running for hours with no error.cc @ivanpovazan
filipnavara commentedon Jul 1, 2023
Interestingly, it also fails in release mode but at least it produces some warning:
There may be something wrong in the project file (although it doesn't obviously set
TrimModeorLinkModein the .csproj files). I'll close the issue until I can provide some meaningful details.filipnavara commentedon Jul 1, 2023
This seems to be caused by inverted condition: dotnet/macios#18530