Skip to content

CLR crashing when running RemoteExecutor tests locally on Debug builds #90485

@eiriktsarpalis

Description

@eiriktsarpalis

Using the latest commit (007cbcf) on windows-x64, running:

.\build.cmd clr+libs -rc release
dotnet test src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/System.Text.Json.SourceGeneration.Roslyn4.4.Tests.csproj -f net8.0

Will fail with the following stacktrace:

The active test run was aborted. Reason: Test host process crashed : Fatal error. Internal CLR error. (0x80131506)
   at System.Runtime.Serialization.SerializationGuard.<ThrowIfDeserializationInProgress>g__ThrowIfDeserializationInProgress|0_0(System.Runtime.Serialization.SerializationInfo, System.String, Int32 ByRef)
   at System.Runtime.Serialization.SerializationGuard.ThrowIfDeserializationInProgress(System.String, Int32 ByRef)
   at System.Diagnostics.Process.Start()
   at System.Diagnostics.Process.Start(System.Diagnostics.ProcessStartInfo)
   at Microsoft.DotNet.RemoteExecutor.RemoteExecutor.Invoke(System.Reflection.MethodInfo, System.String[], Microsoft.DotNet.RemoteExecutor.RemoteInvokeOptions, Boolean)
   at Microsoft.DotNet.RemoteExecutor.RemoteExecutor.Invoke(System.Action, Microsoft.DotNet.RemoteExecutor.RemoteInvokeOptions)
   at System.Text.Json.SourceGeneration.Tests.JsonSerializerContextTests.JsonSerializerContext_GeneratedDefault_IsSingleton()
   at System.RuntimeMethodHandle.InvokeMethod(System.Object, Void**, System.Signature, Boolean)
   at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(System.Object, IntPtr*)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(System.Object, System.Reflection.BindingFlags)
   at System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)
   at System.Reflection.MethodBase.Invoke(System.Object, System.Object[])
   at Xunit.Sdk.TestInvoker`1[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].CallTestMethod(System.Object)

Which seems to be originating from this call in Process.Start:

SerializationGuard.ThrowIfDeserializationInProgress("AllowProcessCreation", ref s_cachedSerializationSwitch);

This test has started failing on my local machine in the last few days, but strangely I don't see it impacting CI. Thought I'd file an issue in case others are having the same problem.

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions