dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
14.89k stars 4.63k forks source link

Freezes When Blazor WebAssembly publish #93076

Open Ishikawa-Tatsuya opened 11 months ago

Ishikawa-Tatsuya commented 11 months ago

Is there an existing issue for this?

Describe the bug

When I try to deploy my Blazor WebAssembly from Visual Studio to Azure, it freezes midway through. Here is the information that will be displayed in the output window at the end.

--enable-serialization-discovery --skip-unresolved true --notrimwarn --link-attributes "C:\Program Files\dotnet\sdk\7.0.401\Sdks\Microsoft.NET.ILLink.Tasks\build\6.0_suppressions.xml"

When I tried the dotnet publish command, it also freezes.

After adding the following to WebAssembly's csproj, the problem no longer occurs, so I think it is stuck in the middle of trimming.

<PublishTrimmed>false</PublishTrimmed>

The dll referenced by WebAssembly makes heavy use of reflection. That dll is also created by me and also references Microsoft.CodeAnalysis.CSharp.

Since it is a commercial software, I cannot attach those codes. Also, since I have not determined which code caused the problem, I cannot attach the minimum reproduction environment.

WebAssembly and the dlls it references are made with .Net6.

Expected Behavior

No response

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

No response

Anything else?

No response

ghost commented 11 months ago

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

Issue Details
### Is there an existing issue for this? - [X] I have searched the existing issues ### Describe the bug When I try to deploy my Blazor WebAssembly from Visual Studio to Azure, it freezes midway through. Here is the information that will be displayed in the output window at the end. --enable-serialization-discovery --skip-unresolved true --notrimwarn --link-attributes "C:\Program Files\dotnet\sdk\7.0.401\Sdks\Microsoft.NET.ILLink.Tasks\build\6.0_suppressions.xml" When I tried the dotnet publish command, it also freezes. After adding the following to WebAssembly's csproj, the problem no longer occurs, so I think it is stuck in the middle of trimming. ``` false ``` The dll referenced by WebAssembly makes heavy use of reflection. That dll is also created by me and also references Microsoft.CodeAnalysis.CSharp. Since it is a commercial software, I cannot attach those codes. Also, since I have not determined which code caused the problem, I cannot attach the minimum reproduction environment. WebAssembly and the dlls it references are made with .Net6. ### Expected Behavior _No response_ ### Steps To Reproduce _No response_ ### Exceptions (if any) _No response_ ### .NET Version _No response_ ### Anything else? _No response_
Author: Ishikawa-Tatsuya
Assignees: -
Labels: `untriaged`, `area-Tools-ILLink`
Milestone: -
vitek-karas commented 11 months ago

Can you please share the version of the SDK you're using? Also - the version of the ILLink tool - this is probably easiest to get by running dotnet publish /bl and then opening the msbuild.binlog with the https://msbuildlog.com/. In it search for the "$task ILLink".

If you look at the running processes when the publish is "hung", do you see a dotnet process which consumes CPU all the time? Can you try attaching a debugger (a new instance of VS) to that process and break into it - it should show you the callstack of where it's stuck - that would helps us a lot (note that this callstack should not contain any information about the app being built, it should be purely info about the trimmer tool)

Ishikawa-Tatsuya commented 11 months ago

Thank you. I followed the steps you provided and opened msbuild.binlog in MSBuild Structured Log Viewer.

Searching for $task ILLink in Search Log 0 results. Search took: 00:00:00.0000668 was displayed. The log may not be output because ILLink has not completed its operation. MSBuild version was "17.7.3+8ec440e68".

Two dotnet.exe's were consuming CPU while it was hanging. I'll attach the call stacks for both, although it's long.

postscript I think there are two dotnet.exes because I ran dotnet publish twice during the investigation. I closed the command prompt, but I think dotnet.exe remained.

    System.Private.CoreLib.dll!System.Collections.Generic.Dictionary<int, Mono.Linker.Dataflow.ValueBasicBlockPair>.FindValue(int key) 行 1025   C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 70    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 37 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 37 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 37 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 45 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 45 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 45 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 37 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 37 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 45 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 45 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 37 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 37 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 37 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 45 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 37 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 45 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 45 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 37 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 37 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 45 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 45 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 37 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 37 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 45 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 37 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 45 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 45 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 45 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 37 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 37 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.AddIfNotPresent(ILLink.Shared.DataFlow.SingleValue value, out int location) 行 954 C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.UnionWith(System.Collections.Generic.IEnumerable<ILLink.Shared.DataFlow.SingleValue> other) 行 469 C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.HashSet(System.Collections.Generic.IEnumerable<ILLink.Shared.DataFlow.SingleValue> collection, System.Collections.Generic.IEqualityComparer<ILLink.Shared.DataFlow.SingleValue> comparer) 行 176   C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.DeepCopy() 行 286 C#
    illink.dll!Mono.Linker.Dataflow.TrimAnalysisMethodCallPattern.TrimAnalysisMethodCallPattern(Mono.Cecil.Cil.Instruction operation, Mono.Cecil.MethodReference calledMethod, ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue> instance, System.Collections.Immutable.ImmutableArray<ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>> arguments, Mono.Linker.MessageOrigin origin) 行 41 C#
    illink.dll!Mono.Linker.Dataflow.ReflectionMethodBodyScanner.HandleCall(Mono.Cecil.Cil.MethodBody callingMethodBody, Mono.Cecil.MethodReference calledMethod, Mono.Cecil.Cil.Instruction operation, Mono.Linker.Dataflow.ValueNodeList methodParams, out ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue> methodReturnValue) 行 177    C#
    illink.dll!Mono.Linker.Dataflow.MethodBodyScanner.HandleCall(Mono.Cecil.Cil.MethodBody callingMethodBody, Mono.Cecil.Cil.Instruction operation, System.Collections.Generic.Stack<Mono.Linker.Dataflow.StackSlot> currentStack, System.Collections.Generic.Dictionary<Mono.Cecil.Cil.VariableDefinition, Mono.Linker.Dataflow.ValueBasicBlockPair> locals, ref Mono.Linker.Dataflow.InterproceduralState interproceduralState, int curBasicBlock) 行 993  C#
    illink.dll!Mono.Linker.Dataflow.MethodBodyScanner.Scan(Mono.Linker.MethodIL methodIL, ref Mono.Linker.Dataflow.InterproceduralState interproceduralState) 行 520 C#
    illink.dll!Mono.Linker.Dataflow.ReflectionMethodBodyScanner.Scan(Mono.Linker.MethodIL methodIL, ref Mono.Linker.Dataflow.InterproceduralState interproceduralState) 行 82    C#
    illink.dll!Mono.Linker.Dataflow.MethodBodyScanner.InterproceduralScan(Mono.Linker.MethodIL startingMethodIL) 行 208  C#
    illink.dll!Mono.Linker.Dataflow.ReflectionMethodBodyScanner.InterproceduralScan(Mono.Linker.MethodIL methodIL) 行 74 C#
    illink.dll!Mono.Linker.Steps.MarkStep.MarkReflectionLikeDependencies(Mono.Linker.MethodIL methodIL, bool requiresReflectionMethodBodyScanner) 行 4000    C#
    illink.dll!Mono.Linker.Steps.MarkStep.MarkMethodBody(Mono.Cecil.Cil.MethodBody body) 行 3702 C#
    illink.dll!Mono.Linker.Steps.MarkStep.ProcessMethod(Mono.Cecil.MethodDefinition method, Mono.Linker.DependencyInfo reason, Mono.Linker.MessageOrigin origin) 行 3381 C#
    illink.dll!Mono.Linker.Steps.MarkStep.ProcessQueue() 行 547  C#
    illink.dll!Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue() 行 437   C#
    illink.dll!Mono.Linker.Steps.MarkStep.Process() 行 375   C#
    illink.dll!Mono.Linker.Steps.MarkStep.Process(Mono.Linker.LinkContext context) 行 173    C#
    illink.dll!Mono.Linker.Pipeline.Process(Mono.Linker.LinkContext context) 行 188  C#
    illink.dll!Mono.Linker.Driver.Run(Mono.Linker.ILogger customLogger) 行 885   C#
    illink.dll!Mono.Linker.Driver.Main(string[] args) 行 48  C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 284  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 45 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 37 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 37 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 37 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 45 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 37 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 45 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 37 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 45 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 45 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 45 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 45 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 37 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 45 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 37 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 37 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 45 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 37 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 37 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 45 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 45 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 37 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 45 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 45 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 37 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 37 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 45 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 45 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.FindItemIndex(ILLink.Shared.DataFlow.SingleValue item) 行 289  C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues.Equals(ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.EnumerableValues other) 行 37 C#
    illink.dll!ILLink.Shared.TrimAnalysis.ArrayValue.Equals(ILLink.Shared.TrimAnalysis.ArrayValue otherArr) 行 72    C#
    System.Private.CoreLib.dll!System.Collections.Generic.GenericEqualityComparer<ILLink.Shared.DataFlow.SingleValue>.Equals(ILLink.Shared.DataFlow.SingleValue x, ILLink.Shared.DataFlow.SingleValue y) 行 77   C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.AddIfNotPresent(ILLink.Shared.DataFlow.SingleValue value, out int location) 行 954 C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.UnionWith(System.Collections.Generic.IEnumerable<ILLink.Shared.DataFlow.SingleValue> other) 行 469 C#
    System.Private.CoreLib.dll!System.Collections.Generic.HashSet<ILLink.Shared.DataFlow.SingleValue>.HashSet(System.Collections.Generic.IEnumerable<ILLink.Shared.DataFlow.SingleValue> collection, System.Collections.Generic.IEqualityComparer<ILLink.Shared.DataFlow.SingleValue> comparer) 行 176   C#
    illink.dll!ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>.DeepCopy() 行 286 C#
    illink.dll!Mono.Linker.Dataflow.TrimAnalysisMethodCallPattern.TrimAnalysisMethodCallPattern(Mono.Cecil.Cil.Instruction operation, Mono.Cecil.MethodReference calledMethod, ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue> instance, System.Collections.Immutable.ImmutableArray<ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue>> arguments, Mono.Linker.MessageOrigin origin) 行 41 C#
    illink.dll!Mono.Linker.Dataflow.ReflectionMethodBodyScanner.HandleCall(Mono.Cecil.Cil.MethodBody callingMethodBody, Mono.Cecil.MethodReference calledMethod, Mono.Cecil.Cil.Instruction operation, Mono.Linker.Dataflow.ValueNodeList methodParams, out ILLink.Shared.DataFlow.ValueSet<ILLink.Shared.DataFlow.SingleValue> methodReturnValue) 行 177    C#
    illink.dll!Mono.Linker.Dataflow.MethodBodyScanner.HandleCall(Mono.Cecil.Cil.MethodBody callingMethodBody, Mono.Cecil.Cil.Instruction operation, System.Collections.Generic.Stack<Mono.Linker.Dataflow.StackSlot> currentStack, System.Collections.Generic.Dictionary<Mono.Cecil.Cil.VariableDefinition, Mono.Linker.Dataflow.ValueBasicBlockPair> locals, ref Mono.Linker.Dataflow.InterproceduralState interproceduralState, int curBasicBlock) 行 993  C#
    illink.dll!Mono.Linker.Dataflow.MethodBodyScanner.Scan(Mono.Linker.MethodIL methodIL, ref Mono.Linker.Dataflow.InterproceduralState interproceduralState) 行 520 C#
    illink.dll!Mono.Linker.Dataflow.ReflectionMethodBodyScanner.Scan(Mono.Linker.MethodIL methodIL, ref Mono.Linker.Dataflow.InterproceduralState interproceduralState) 行 82    C#
    illink.dll!Mono.Linker.Dataflow.MethodBodyScanner.InterproceduralScan(Mono.Linker.MethodIL startingMethodIL) 行 208  C#
    illink.dll!Mono.Linker.Dataflow.ReflectionMethodBodyScanner.InterproceduralScan(Mono.Linker.MethodIL methodIL) 行 74 C#
    illink.dll!Mono.Linker.Steps.MarkStep.MarkReflectionLikeDependencies(Mono.Linker.MethodIL methodIL, bool requiresReflectionMethodBodyScanner) 行 4000    C#
    illink.dll!Mono.Linker.Steps.MarkStep.MarkMethodBody(Mono.Cecil.Cil.MethodBody body) 行 3702 C#
    illink.dll!Mono.Linker.Steps.MarkStep.ProcessMethod(Mono.Cecil.MethodDefinition method, Mono.Linker.DependencyInfo reason, Mono.Linker.MessageOrigin origin) 行 3381 C#
    illink.dll!Mono.Linker.Steps.MarkStep.ProcessQueue() 行 547  C#
    illink.dll!Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue() 行 437   C#
    illink.dll!Mono.Linker.Steps.MarkStep.Process() 行 375   C#
    illink.dll!Mono.Linker.Steps.MarkStep.Process(Mono.Linker.LinkContext context) 行 173    C#
    illink.dll!Mono.Linker.Pipeline.Process(Mono.Linker.LinkContext context) 行 188  C#
    illink.dll!Mono.Linker.Driver.Run(Mono.Linker.ILogger customLogger) 行 885   C#
    illink.dll!Mono.Linker.Driver.Main(string[] args) 行 48  C#
vitek-karas commented 11 months ago

Thanks a lot for the callstacks. Unfortunately, I can't seem to figure out how to get it to behave that way locally.

We've had several issues around this code but most of them should be fixed in 7.0.401 which is what you're using. I can only think of one possible way which we've seen so far. The fix for that is basically this: https://github.com/dotnet/runtime/pull/87634.

The repro for that fix is based on analyzer - which has full method body CFG, which trimmer doesn't use, so it's not directly affected. But the trimmer does use the iterative analysis from interprocedural analysis around compiler generated code. I guess it's possible to create a state similar to the one in the analyzer around that. I played with it for a while, but couldn't make it to break.

@Ishikawa-Tatsuya you could check what code makes this a problem. When you have it under the debugger, go to this frame

    illink.dll!Mono.Linker.Steps.MarkStep.ProcessMethod(Mono.Cecil.MethodDefinition method

And look at the method local variable - it should be the name of the method which is caused the tool to break. For a repro I would expect we would just need just that method - and honestly not anything specific - basically whatever it's doing around arrays.

@sbomer Is there a magical incantation which can be used to run the 8.0 linker in 7.0 SDK targeting a 6.0 app? That way we could validate that this problem is fixed in 8 - without retargeting the app which could be a lot of work I guess.

Separately this raises a question: Should we proactively fix the "hang"/"crash" fixes we've made in 8 to 7.0 linker? Specifically I'm thinking:

Ishikawa-Tatsuya commented 11 months ago

I checked ProcessMethod and found out the method being processed there. InvokeMethod. Attach the method and related fields and methods.

I then tried changing the related assemblies to 7.0, but it froze as well.

readonly object _obj;
readonly string _member;

public async Task<object?> InvokeMethod(object?[] args)
{
    var method = _obj.GetType().GetMethods()
        .Where(e => e.Name == _member && (e.GetParameters().Length == args.Length ||
            (e.GetParameters().Length == 1 && e.GetParameters()[0].ParameterType.IsArray)))
        .FirstOrDefault();
    if (method == null) throw new Exception("Not found method. " + _member);
    var ps = method.GetParameters();
    if (ps.Length == 1 && ps[0].ParameterType.IsArray) args = new[] { args };
    return await AwaitIfTask(method.ReturnType, method!.Invoke(_obj, args));
}

static async Task<object?> AwaitIfTask(Type type, object? ret)
{
    if (ret is Task task)
    {
        if (type.IsGenericType)
        {
            var helper = (ITaskAwaitHelper)Activator.CreateInstance(typeof(TaskAwaitHelper<>).MakeGenericType(type.GetGenericArguments().First()), new object[] { task })!;
            return await helper.Await();
        }
        else
        {
            await task;
            return null;
        }
    }
    return ret;
}
public interface ITaskAwaitHelper
{
    public Task<object?> Await();
}
public class TaskAwaitHelper<T> : ITaskAwaitHelper
{
    Task<T> _task;
    public TaskAwaitHelper(object core) => _task = (Task<T>)core;
    public async Task<object?> Await()
    {
        var ret = await _task;
        return ret;
    }
}
Ishikawa-Tatsuya commented 11 months ago

I found that if I rewrite this line, it no longer freezes.

//if (ps.Length == 1 && ps[0].ParameterType.IsArray) args = new[] { args }; // -> var dstArgs = (ps.Length == 1 && ps[0].ParameterType.IsArray) ? new[] { args } : args;

public async Task<object?> InvokeMethod(object?[] args)
{
    var method = _obj.GetType().GetMethods()
        .Where(e => e.Name == _member && (e.GetParameters().Length == args.Length ||
            (e.GetParameters().Length == 1 && e.GetParameters()[0].ParameterType.IsArray)))
        .FirstOrDefault();
    if (method == null) throw new Exception("Not found method. " + _member);
    var ps = method.GetParameters();

    // !
    var dstArgs = (ps.Length == 1 && ps[0].ParameterType.IsArray) ? new[] { args } : args;

    return await AwaitIfTask(method.ReturnType, method!.Invoke(_obj, dstArgs));
}

I also found that this phenomenon occurred even when I simply added the above code to her BlazorWebAssebly that I had just created.

vitek-karas commented 11 months ago

Thanks a lot - I can repro it as well. Still looking through what's going on... and why it loops.

vitek-karas commented 11 months ago

I can also confirm that this doesn't repro on .NET 8 illink - so we've fixed it - somewhere :-). Still don't know which change fixed it though. It looks a little like recursive arrays, but not fully recursive, only in value not actual reference recursive.

Ishikawa-Tatsuya commented 11 months ago

Thank you. My project plans to replace .NET8 once it is released. Until then, I will deal with it temporarily.

vitek-karas commented 11 months ago

Really simple repro (Edit: even simpler):

        // Force state machine
        static async Task TestRec ()
        {
            typeof (TestType).RequiresAll (); // Force data flow analysis

            object[] args = null;
            args = new[] { args };
        }

On .NET 7 this hangs both the analyzer and illink.

vitek-karas commented 11 months ago

It is recursive - but it's an overwrite, so we don't hit the direct recursion (which would have crashed the trimmer). It's only recursive due to the state machine, which will continuously expand the possible values - effectively recursively. I assume that once it hits certain size it "hangs" because just equality is too expensive to compute, but eventually it would likely crash with stack overflow as well.

Ishikawa-Tatsuya commented 11 months ago

😢 I see, it is weak against array reassignment. This is not a good way of writing, so we will avoid this way of writing in the future.

vitek-karas commented 11 months ago

This a bug - we need to fix it. There's nothing wrong with the pattern as such, it's just uncovering a limitation in the trim analysis.

sbomer commented 10 months ago

Should we proactively fix the "hang"/"crash" fixes we've made in 8 to 7.0 linker?

Yes, I think we should. Did you figure out which change fixed this in 8.0?

vitek-karas commented 10 months ago

Did you figure out which change fixed this in 8.0?

Not yet - I think the change which prevents nested arrays will fix this as well, but I have to port it first.

vitek-karas commented 10 months ago

So porting trimmer/analyzer parts of https://github.com/dotnet/runtime/pull/82818 fixed the problem for trimmer. Analyzer hangs on a different test from the suite - so it's probably the other bug to port.

vitek-karas commented 10 months ago

I created a PR to port the relevant fix to 7.0: https://github.com/dotnet/linker/pull/3231

vitek-karas commented 10 months ago

Update: We hope to be able to port 2 more (3 total) stability fixes from 8 to 7: https://github.com/dotnet/linker/pull/3234 That includes the fix for this issue.