You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a CI test failure that indicates a dictionary getting modified while enumerating via a foreach loop. The failure repro's locally when running all the tests but I haven't been able to narrow it down to running a single failing test.
Given that the code does modify _typesInDynamicallyAccessedMembersHierarchy at ApplyDynamicallyAccessedMembersToTypeHierarchyInner() while enumerating, I think it might be faster to change the code to not do that.
Command to run the full tests (should see some tests failing):
Should be able to see test, EventSourcePropertyValueTest.cs, failing among others
Steps that I tried to repro a single test failure, EventSourcePropertyValueTest (have not been able to repro)
Open the TrimmingTests.binlog, search for illink failure related to EventSourcePropertyValueTest
Copy the illink failure commandline and run
Failure Callstack
##[error]ILLink(0,0): error IL1005: (NETCORE_ENGINEERING_TELEMETRY=Build) System.Diagnostics.Tracing.EventSource.g__GetCreateManifestAndDescriptorsViaLocalMethod|93_0(String): Error processing method 'System.Diagnostics.Tracing.EventSource.g__GetCreateManifestAndDescriptorsViaLocalMethod|93_0(String)' in assembly 'System.Private.CoreLib.dll'
Mono.Linker.LinkerFatalErrorException: ILLink: error IL1005: System.Diagnostics.Tracing.EventSource.g__GetCreateManifestAndDescriptorsViaLocalMethod|93_0(String): Error processing method 'System.Diagnostics.Tracing.EventSource.g__GetCreateManifestAndDescriptorsViaLocalMethod|93_0(String)' in assembly 'System.Private.CoreLib.dll'
---> System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.Collections.Generic.Dictionary2.Enumerator.MoveNext() at Mono.Linker.Dataflow.DynamicallyAccessedMembersTypeHierarchy.ApplyDynamicallyAccessedMembersToTypeHierarchy(ReflectionMethodBodyScanner reflectionMethodBodyScanner, ReflectionPatternContext& reflectionPatternContext, TypeDefinition type) at Mono.Linker.Dataflow.ReflectionMethodBodyScanner.HandleCall(MethodBody callingMethodBody, MethodReference calledMethod, Instruction operation, ValueNodeList methodParams, ValueNode& methodReturnValue) at Mono.Linker.Dataflow.MethodBodyScanner.HandleCall(MethodBody callingMethodBody, Instruction operation, Stack1 currentStack)
at Mono.Linker.Dataflow.MethodBodyScanner.Scan(MethodBody methodBody)
at Mono.Linker.Dataflow.ReflectionMethodBodyScanner.ScanAndProcessReturnValue(MethodBody methodBody)
at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method, DependencyInfo& reason)
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)
Optimizing assemblies for size, which may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink
D:\workspace_work\1\s.dotnet\sdk\6.0.100-preview.2.21155.3\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ILLink.targets(59,5): error NETSDK1144: Optimizing assemblies for size failed. Optimization can be disabled by setting the PublishTrimmed property to false. [D:\workspace_work\1\s\artifacts\bin\trimmingTests\projects\Microsoft.Extensions.Http.TrimmingTests\AddTypedClientTests\win-x64\project.csproj]
##[error].dotnet\sdk\6.0.100-preview.2.21155.3\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ILLink.targets(59,5): error
The text was updated successfully, but these errors were encountered:
There is a CI test failure that indicates a dictionary getting modified while enumerating via a foreach loop. The failure repro's locally when running all the tests but I haven't been able to narrow it down to running a single failing test.
Given that the code does modify _typesInDynamicallyAccessedMembersHierarchy at ApplyDynamicallyAccessedMembersToTypeHierarchyInner() while enumerating, I think it might be faster to change the code to not do that.
Command to run the full tests (should see some tests failing):
Sync to the PR, Fix EventSource trimmer warning runtime#51237, and build locally
build.cmd -ci -arch x64 -os windows -s libs.tests -c Release /p:TestAssemblies=false /p:TestTrimming=true /p:CrossBuild=false /bl:TrimmingTests.binlog
Should be able to see test, EventSourcePropertyValueTest.cs, failing among others
Steps that I tried to repro a single test failure, EventSourcePropertyValueTest (have not been able to repro)
Failure Callstack
##[error]ILLink(0,0): error IL1005: (NETCORE_ENGINEERING_TELEMETRY=Build) System.Diagnostics.Tracing.EventSource.g__GetCreateManifestAndDescriptorsViaLocalMethod|93_0(String): Error processing method 'System.Diagnostics.Tracing.EventSource.g__GetCreateManifestAndDescriptorsViaLocalMethod|93_0(String)' in assembly 'System.Private.CoreLib.dll'
Mono.Linker.LinkerFatalErrorException: ILLink: error IL1005: System.Diagnostics.Tracing.EventSource.g__GetCreateManifestAndDescriptorsViaLocalMethod|93_0(String): Error processing method 'System.Diagnostics.Tracing.EventSource.g__GetCreateManifestAndDescriptorsViaLocalMethod|93_0(String)' in assembly 'System.Private.CoreLib.dll'
---> System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.Collections.Generic.Dictionary
2.Enumerator.MoveNext() at Mono.Linker.Dataflow.DynamicallyAccessedMembersTypeHierarchy.ApplyDynamicallyAccessedMembersToTypeHierarchy(ReflectionMethodBodyScanner reflectionMethodBodyScanner, ReflectionPatternContext& reflectionPatternContext, TypeDefinition type) at Mono.Linker.Dataflow.ReflectionMethodBodyScanner.HandleCall(MethodBody callingMethodBody, MethodReference calledMethod, Instruction operation, ValueNodeList methodParams, ValueNode& methodReturnValue) at Mono.Linker.Dataflow.MethodBodyScanner.HandleCall(MethodBody callingMethodBody, Instruction operation, Stack
1 currentStack)at Mono.Linker.Dataflow.MethodBodyScanner.Scan(MethodBody methodBody)
at Mono.Linker.Dataflow.ReflectionMethodBodyScanner.ScanAndProcessReturnValue(MethodBody methodBody)
at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method, DependencyInfo& reason)
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)
Optimizing assemblies for size, which may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink
D:\workspace_work\1\s.dotnet\sdk\6.0.100-preview.2.21155.3\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ILLink.targets(59,5): error NETSDK1144: Optimizing assemblies for size failed. Optimization can be disabled by setting the PublishTrimmed property to false. [D:\workspace_work\1\s\artifacts\bin\trimmingTests\projects\Microsoft.Extensions.Http.TrimmingTests\AddTypedClientTests\win-x64\project.csproj]
##[error].dotnet\sdk\6.0.100-preview.2.21155.3\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ILLink.targets(59,5): error
The text was updated successfully, but these errors were encountered: