-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test failed at double initialization assert in System.Text.Json.Serialization.Metadata.JsonTypeInfo.InitializePropCache() #60962
Comments
Tagging subscribers to this area: @dotnet/area-system-text-json Issue DetailsThat one is unrelated - It's a double initialization bug in JSON's property cache cc @layomia: which is Line 580 in 8f8e8f0
From the log Stack of assertionProcess terminated due to " at System.Diagnostics.DebugProvider.Fail(String message, String detailMessage) in /_/src/libraries/System.Private.CoreLib/src/System/Diagnostics/DebugProvider.cs:line 22
at System.Diagnostics.Debug.Fail(String message, String detailMessage) in /_/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Debug.cs:line 134
at System.Diagnostics.Debug.Assert(Boolean condition, String message, String detailMessage) in /_/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Debug.cs:line 98
at System.Diagnostics.Debug.Assert(Boolean condition) in /_/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Debug.cs:line 83
at System.Text.Json.Serialization.Metadata.JsonTypeInfo.InitializePropCache() in /_/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonTypeInfo.Cache.cs:line 580
at System.Text.Json.Serialization.Converters.JsonMetadataServicesConverter`1[[System.Text.Json.SourceGeneration.Tests.RealWorldContextTests.ClassWithNullableProperties.GenericStruct`1[[System.Uri, System.Private.Uri, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]], System.Text.Json.SourceGeneration.Roslyn3.11.Tests, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]].OnTryWrite(Utf8JsonWriter writer, GenericStruct`1 value, JsonSerializerOptions options, WriteStack& state) in /_/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/JsonMetadataServicesConverter.cs:line 87
at System.Text.Json.Serialization.JsonConverter`1[[System.Text.Json.SourceGeneration.Tests.RealWorldContextTests.ClassWithNullableProperties.GenericStruct`1[[System.Uri, System.Private.Uri, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]], System.Text.Json.SourceGeneration.Roslyn3.11.Tests, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]].TryWrite(Utf8JsonWriter writer, GenericStruct`1& value, JsonSerializerOptions options, WriteStack& state) in /_/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverterOfT.cs:line 473
at System.Text.Json.Serialization.Metadata.JsonPropertyInfo`1[[System.Text.Json.SourceGeneration.Tests.RealWorldContextTests.ClassWithNullableProperties.GenericStruct`1[[System.Uri, System.Private.Uri, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]], System.Text.Json.SourceGeneration.Roslyn3.11.Tests, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]].GetMemberAndWriteJson(Object obj, WriteStack& state, Utf8JsonWriter writer) in /_/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonPropertyInfoOfT.cs:line 332
at System.Text.Json.Serialization.Converters.ObjectDefaultConverter`1[[System.Text.Json.SourceGeneration.Tests.RealWorldContextTests.ClassWithNullableProperties, System.Text.Json.SourceGeneration.Roslyn3.11.Tests, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]].OnTryWrite(Utf8JsonWriter writer, ClassWithNullableProperties value, JsonSerializerOptions options, WriteStack& state) in /_/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectDefaultConverter.cs:line 285
at System.Text.Json.Serialization.Converters.JsonMetadataServicesConverter`1[[System.Text.Json.SourceGeneration.Tests.RealWorldContextTests.ClassWithNullableProperties, System.Text.Json.SourceGeneration.Roslyn3.11.Tests, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]].OnTryWrite(Utf8JsonWriter writer, ClassWithNullableProperties value, JsonSerializerOptions options, WriteStack& state) in /_/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/JsonMetadataServicesConverter.cs:line 90
at System.Text.Json.Serialization.JsonConverter`1[[System.Text.Json.SourceGeneration.Tests.RealWorldContextTests.ClassWithNullableProperties, System.Text.Json.SourceGeneration.Roslyn3.11.Tests, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]].TryWrite(Utf8JsonWriter writer, ClassWithNullableProperties& value, JsonSerializerOptions options, WriteStack& state) in /_/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverterOfT.cs:line 473
at System.Text.Json.Serialization.JsonConverter`1[[System.Text.Json.SourceGeneration.Tests.RealWorldContextTests.ClassWithNullableProperties, System.Text.Json.SourceGeneration.Roslyn3.11.Tests, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]].WriteCore(Utf8JsonWriter writer, ClassWithNullableProperties& value, JsonSerializerOptions options, WriteStack& state) in /_/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverterOfT.WriteCore.cs:line 41
at System.Text.Json.JsonSerializer.WriteUsingSerializer[ClassWithNullableProperties](Utf8JsonWriter writer, ClassWithNullableProperties& value, JsonTypeInfo jsonTypeInfo) in /_/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Write.Helpers.cs:line 77
at System.Text.Json.JsonSerializer.WriteUsingGeneratedSerializer[ClassWithNullableProperties](Utf8JsonWriter writer, ClassWithNullableProperties& value, JsonTypeInfo jsonTypeInfo) in /_/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Write.Helpers.cs:line 52
at System.Text.Json.JsonSerializer.WriteStringUsingGeneratedSerializer[ClassWithNullableProperties](ClassWithNullableProperties& value, JsonTypeInfo jsonTypeInfo) in /_/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Write.String.cs:line 137
at System.Text.Json.JsonSerializer.Serialize[ClassWithNullableProperties](ClassWithNullableProperties value, JsonTypeInfo`1 jsonTypeInfo) in /_/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Write.String.cs:line 87
at System.Text.Json.SourceGeneration.Tests.RealWorldContextTests.<ClassWithNullableProperties_Roundtrip>g__RunTest|53_0(ClassWithNullableProperties expected) in /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/RealWorldContextTests.cs:line 768
at System.Text.Json.SourceGeneration.Tests.RealWorldContextTests.ClassWithNullableProperties_Roundtrip() in /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/RealWorldContextTests.cs:line 753
at System.Reflection.RuntimeMethodInfo.InternalInvoke(RuntimeMethodInfo , Object , Span`1& , Exception& )
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) in /_/src/libraries/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.cs:line 124
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) in /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBase.cs:line 55
at Xunit.Sdk.TestInvoker`1[[Xunit.Sdk.IXunitTestCase, xunit.core, Version=2.4.2.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c]].CallTestMethod(Object testClassInstance)
at Xunit.Sdk.TestInvoker`1.<>c__DisplayClass48_0.<<InvokeTestMethodAsync>b__1>d[[Xunit.Sdk.IXunitTestCase, xunit.core, Version=2.4.2.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c]].MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[<<InvokeTestMethodAsync>b__1>d](<<InvokeTestMethodAsync>b__1>d& stateMachine) in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncMethodBuilderCore.cs:line 38
at Xunit.Sdk.TestInvoker`1.<>c__DisplayClass48_0[[Xunit.Sdk.IXunitTestCase, xunit.core, Version=2.4.2.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c]].<InvokeTestMethodAsync>b__1()
at Xunit.Sdk.ExecutionTimer.AggregateAsync(Func`1 asyncAction)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[<AggregateAsync>d__4](<AggregateAsync>d__4& stateMachine) in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncMethodBuilderCore.cs:line 38
at Xunit.Sdk.ExecutionTimer.AggregateAsync(Func`1 asyncAction)
at Xunit.Sdk.TestInvoker`1.<>c__DisplayClass48_0[[Xunit.Sdk.IXunitTestCase, xunit.core, Version=2.4.2.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c]].<InvokeTestMethodAsync>b__0()
at Xunit.Sdk.ExceptionAggregator.RunAsync(Func`1 code)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[<RunAsync>d__9](<RunAsync>d__9& stateMachine) in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncMethodBuilderCore.cs:line 38
at Xunit.Sdk.ExceptionAggregator.RunAsync(Func`1 code)
at Xunit.Sdk.TestInvoker`1.<InvokeTestMethodAsync>d__48[[Xunit.Sdk.IXunitTestCase, xunit.core, Version=2.4.2.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c]].MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[<InvokeTestMethodAsync>d__48](<InvokeTestMethodAsync>d__48& stateMachine) in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncMethodBuilderCore.cs:line 38
at Xunit.Sdk.TestInvoker`1[[Xunit.Sdk.IXunitTestCase, xunit.core, Version=2.4.2.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c]].InvokeTestMethodAsync(Object testClassInstance)
at Xunit.Sdk.XunitTestInvoker.InvokeTestMethodAsync(Object testClassInstance)
at Xunit.Sdk.TestInvoker`1.<<RunAsync>b__47_0>d[[Xunit.Sdk.IXunitTestCase, xunit.core, Version=2.4.2.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c]].MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[<<RunAsync>b__47_0>d](<<RunAsync>b__47_0>d& stateMachine) in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncMethodBuilderCore.cs:line 38
at Xunit.Sdk.TestInvoker`1[[Xunit.Sdk.IXunitTestCase, xunit.core, Version=2.4.2.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c]].<RunAsync>b__47_0()
at Xunit.Sdk.ExceptionAggregator.<RunAsync>d__10`1[[System.Decimal, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[<RunAsync>d__10`1](<RunAsync>d__10`1& stateMachine) in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncMethodBuilderCore.cs:line 38
at Xunit.Sdk.ExceptionAggregator.RunAsync[Decimal](Func`1 code)
at Xunit.Sdk.TestInvoker`1[[Xunit.Sdk.IXunitTestCase, xunit.core, Version=2.4.2.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c]].RunAsync()
at Xunit.Sdk.XunitTestRunner.InvokeTestMethodAsync(ExceptionAggregator aggregator)
at Xunit.Sdk.XunitTestRunner.InvokeTestAsync(ExceptionAggregator aggregator)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[<InvokeTestAsync>d__4](<InvokeTestAsync>d__4& stateMachine) in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncMethodBuilderCore.cs:line 38
at Xunit.Sdk.XunitTestRunner.InvokeTestAsync(ExceptionAggregator aggregator)
at Xunit.Sdk.TestRunner`1.<>c__DisplayClass43_0[[Xunit.Sdk.IXunitTestCase, xunit.core, Version=2.4.2.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c]].<RunAsync>b__0()
at Xunit.Sdk.ExceptionAggregator.<RunAsync>d__10`1[[System.Tuple`2[[System.Decimal, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.String, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[<RunAsync>d__10`1](<RunAsync>d__10`1& stateMachine) in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncMethodBuilderCore.cs:line 38
at Xunit.Sdk.ExceptionAggregator.RunAsync[Tuple`2](Func`1 code)
at Xunit.Sdk.TestRunner`1.<RunAsync>d__43[[Xunit.Sdk.IXunitTestCase, xunit.core, Version=2.4.2.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c]].MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[<RunAsync>d__43](<RunAsync>d__43& stateMachine) in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncMethodBuilderCore.cs:line 38
at Xunit.Sdk.TestRunner`1[[Xunit.Sdk.IXunitTestCase, xunit.core, Version=2.4.2.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c]].RunAsync()
at Xunit.Sdk.XunitTestCaseRunner.RunTestAsync()
at Xunit.Sdk.TestCaseRunner`1.<RunAsync>d__19[[Xunit.Sdk.IXunitTestCase, xunit.core, Version=2.4.2.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c]].MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[<RunAsync>d__19](<RunAsync>d__19& stateMachine) in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncMethodBuilderCore.cs:line 38
at Xunit.Sdk.TestCaseRunner`1[[Xunit.Sdk.IXunitTestCase, xunit.core, Version=2.4.2.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c]].RunAsync()
at Xunit.Sdk.XunitTestCase.RunAsync(IMessageSink diagnosticMessageSink, IMessageBus messageBus, Object[] constructorArguments, ExceptionAggregator aggregator, CancellationTokenSource cancellationTokenSource)
at Xunit.Sdk.XunitTestMethodRunner.RunTestCaseAsync(IXunitTestCase testCase)
at Xunit.Sdk.TestMethodRunner`1.<RunTestCasesAsync>d__32[[Xunit.Sdk.IXunitTestCase, xunit.core, Version=2.4.2.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c]].MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[<RunTestCasesAsync>d__32](<RunTestCasesAsync>d__32& stateMachine) in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncMethodBuilderCore.cs:line 38
at Xunit.Sdk.TestMethodRunner`1[[Xunit.Sdk.IXunitTestCase, xunit.core, Version=2.4.2.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c]].RunTestCasesAsync()
at Xunit.Sdk.TestMethodRunner`1.<RunAsync>d__31[[Xunit.Sdk.IXunitTestCase, xunit.core, Version=2.4.2.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c]].MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[<RunAsync>d__31](<RunAsync>d__31& stateMachine) in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncMethodBuilderCore.cs:line 38
at Xunit.Sdk.TestMethodRunner`1[[Xunit.Sdk.IXunitTestCase, xunit.core, Version=2.4.2.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c]].RunAsync()
at Xunit.Sdk.XunitTestClassRunner.RunTestMethodAsync(ITestMethod testMethod, IReflectionMethodInfo method, IEnumerable`1 testCases, Object[] constructorArguments)
at Xunit.Sdk.TestClassRunner`1.<RunTestMethodsAsync>d__38[[Xunit.Sdk.IXunitTestCase, xunit.core, Version=2.4.2.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c]].MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[<RunTestMethodsAsync>d__38](<RunTestMethodsAsync>d__38& stateMachine) in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncMethodBuilderCore.cs:line 38
at Xunit.Sdk.TestClassRunner`1[[Xunit.Sdk.IXunitTestCase, xunit.core, Version=2.4.2.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c]].RunTestMethodsAsync()
at Xunit.Sdk.TestClassRunner`1.<RunAsync>d__37[[Xunit.Sdk.IXunitTestCase, xunit.core, Version=2.4.2.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c]].MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[<RunAsync>d__37](<RunAsync>d__37& stateMachine) in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncMethodBuilderCore.cs:line 38
at Xunit.Sdk.TestClassRunner`1[[Xunit.Sdk.IXunitTestCase, xunit.core, Version=2.4.2.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c]].RunAsync()
at Xunit.Sdk.XunitTestCollectionRunner.RunTestClassAsync(ITestClass testClass, IReflectionTypeInfo class, IEnumerable`1 testCases)
at Xunit.Sdk.TestCollectionRunner`1.<RunTestClassesAsync>d__28[[Xunit.Sdk.IXunitTestCase, xunit.core, Version=2.4.2.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c]].MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[<RunTestClassesAsync>d__28](<RunTestClassesAsync>d__28& stateMachine) in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncMethodBuilderCore.cs:line 38
at Xunit.Sdk.TestCollectionRunner`1[[Xunit.Sdk.IXunitTestCase, xunit.core, Version=2.4.2.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c]].RunTestClassesAsync()
at Xunit.Sdk.TestCollectionRunner`1.<RunAsync>d__27[[Xunit.Sdk.IXunitTestCase, xunit.core, Version=2.4.2.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c]].MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[<RunAsync>d__27](<RunAsync>d__27& stateMachine) in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncMethodBuilderCore.cs:line 38
at Xunit.Sdk.TestCollectionRunner`1[[Xunit.Sdk.IXunitTestCase, xunit.core, Version=2.4.2.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c]].RunAsync()
at Xunit.Sdk.XunitTestAssemblyRunner.RunTestCollectionAsync(IMessageBus messageBus, ITestCollection testCollection, IEnumerable`1 testCases, CancellationTokenSource cancellationTokenSource)
at Xunit.Sdk.XunitTestAssemblyRunner.<>c__DisplayClass14_2.<RunTestCollectionsAsync>b__2()
at System.Threading.Tasks.Task`1[[System.Threading.Tasks.Task`1[[Xunit.Sdk.RunSummary, xunit.core, Version=2.4.2.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c]], System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].InnerInvoke() in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Future.cs:line 503
at System.Threading.Tasks.Task.<>c.<.cctor>b__271_0(Object obj) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:line 2369
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.cs:line 183
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:line 2327
at System.Threading.Tasks.Task.ExecuteEntry() in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:line 2240
at System.Threading.Tasks.SynchronizationContextTaskScheduler.<>c.<.cctor>b__8_0(Object s) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/TaskScheduler.cs:line 631
at Xunit.Sdk.MaxConcurrencySyncContext.RunOnSyncContext(SendOrPostCallback callback, Object state)
at Xunit.Sdk.MaxConcurrencySyncContext.<>c__DisplayClass11_0.<WorkerThreadProc>b__0(Object _)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.cs:line 183
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.cs:line 147
at System.Object.lambda_method2(Closure , Object , Object )
at Xunit.Sdk.ExecutionContextHelper.Run(Object context, Action`1 action)
at Xunit.Sdk.MaxConcurrencySyncContext.WorkerThreadProc()
at Xunit.Sdk.XunitWorkerThread.<>c.<QueueUserWorkItem>b__5_0(Object _)
at System.Threading.Tasks.Task.InnerInvoke() in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:line 2387
at System.Threading.Tasks.Task.<>c.<.cctor>b__271_0(Object obj) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:line 2369
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.cs:line 183
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:line 2327
at System.Threading.Tasks.Task.ExecuteEntryUnsafe(Thread threadPoolThread) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:line 2265
at System.Threading.Tasks.ThreadPoolTaskScheduler.<>c.<.cctor>b__10_0(Object s) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/ThreadPoolTaskScheduler.cs:line 35
at System.Threading.Thread.StartCallback() in /_/src/mono/System.Private.CoreLib/src/System/Threading/Thread.Mono.cs:line 236" Originally posted by @hoyosjs in #60926 (comment)
|
On a related note, looks like this should be Lines 58 to 60 in 8f8e8f0
|
https://helixre8s23ayyeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-64899-merge-667161dabdb44c47a5/System.Text.Json.SourceGeneration.Roslyn4.0.Tests/1/console.7ec2dd77.log?sv=2019-07-07&se=2022-04-12T22%3A07%3A39Z&sr=c&sp=rl&sig=YfJ94pabSXVYILcJ0ZPwOXo%2F%2FtxdJpwX07S3Zu39cUk%3D |
in https://dev.azure.com/dnceng/public/_build/results?buildId=1679186&view=logs&jobId=4724cd84-0a26-56bc-9b1d-ca1983f340b0&j=4724cd84-0a26-56bc-9b1d-ca1983f340b0&t=bd2814f3-22fe-5d50-acb1-9c92a93a7f5f; it crashed but cores are not enabled. |
The recent increase in number of failures could be a side effect of the increased number of tests added to System.Text.Json. @layomia could you investigate this? |
I just hit the same crash on my local dev machine. @layomia can we safely remove the assertion or is a different type of fix necessary? |
IMO reusing same JsonTypeInfo on multiple threads is a valid scenario (and that's what we do in the tests) and as long as JsonTypeInfo isn't modified in that time it should be expected to work just fine. IMO check is invalid with that assumption although I cannot guarantee everything will just work so make sure to run all tests in a loop and make sure nothing other than this specific assert fails (also do manual skim through the code in that caching piece) |
@dotnet/area-system-text-json, can we prioritize getting this fixed? It's causing a fair number of crashes in CI. |
I hit this again in #66741. |
@jozkee did you rebase your branch over the latest main? |
Ah, I thought I merged with main yesterday but it was actually one day before this was fixed, so that must be the reason. Thanks. |
This is not fixed. Hit again in #67466
|
It's now triggering a different assertion in the same method. |
I think we can safely remove that assertion, but it won't prevent other potential concurrency bugs from being hit. Ultimately this method was not written with thread safety in mind, so longer term we should either lock or ensure initializations are performed on construction. @krwq is currently working on refactoring the metadata types for #63686 so perhaps we could permanently address that issue there? |
This stack trace will definitely not show up anymore because that code path no longer exists. I've created #67761 to track all flakiness in JSON tests so I'll close this issue in favor of the other one. I've already seen this manifest in some other way. We'll most likely need to add much more logging (i.e. printout all fields on JsonSerializerOptions/JsonTypeInfos/JsonPropertyInfos through reflection). |
That one is unrelated - It's a double initialization bug in JSON's property cache cc @layomia:
which is
runtime/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonTypeInfo.Cache.cs
Line 580 in 8f8e8f0
From the log
Stack of assertion
Originally posted by @hoyosjs in #60926 (comment)
The text was updated successfully, but these errors were encountered: