Skip to content
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 failure System.Text.Json.Tests.Serialization.MetadataTests_String.RoundTripSerializerOverloads #51969

Closed
VincentBu opened this issue Apr 28, 2021 · 4 comments
Assignees
Milestone

Comments

@VincentBu
Copy link
Contributor

Run: runtime 20210427.88

Failed test:

net6.0-OSX-Release-x64-CoreCLR_release-OSX.1014.Amd64.Open
 -System.Text.Json.Tests.Serialization.MetadataTests_String.RoundTripSerializerOverloads

Error message:

System.NullReferenceException : Object reference not set to an instance of an object.


Stack trace
   at System.Text.Json.WriteStack.Initialize(JsonTypeInfo jsonTypeInfo, Boolean supportContinuation) in /_/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/WriteStack.cs:line 100
   at System.Text.Json.JsonSerializer.WriteUsingMetadata[TValue](TValue& value, JsonTypeInfo jsonTypeInfo) in /_/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Write.String.cs:line 126
   at System.Text.Json.JsonSerializer.Serialize[TValue](TValue value, JsonTypeInfo`1 jsonTypeInfo) in /_/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Write.String.cs:line 79
   at System.Text.Json.Serialization.Tests.SerializationWrapper.StringSerializerWrapper.SerializeWrapper[T](T value, JsonTypeInfo`1 jsonTypeInfo) in /_/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/SerializationWrapper.cs:line 78
   at System.Text.Json.Tests.Serialization.MetadataTests.RoundTripSerializerOverloads() in /_/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/MetadataTests/MetadataTests.JsonSerializer.cs:line 17
--- End of stack trace from previous location ---
@ghost
Copy link

ghost commented Apr 28, 2021

Tagging subscribers to this area: @eiriktsarpalis, @layomia
See info in area-owners.md if you want to be subscribed.

Issue Details

Run: runtime 20210427.88

Failed test:

net6.0-OSX-Release-x64-CoreCLR_release-OSX.1014.Amd64.Open
 -System.Text.Json.Tests.Serialization.MetadataTests_String.RoundTripSerializerOverloads

Error message:

System.NullReferenceException : Object reference not set to an instance of an object.


Stack trace
   at System.Text.Json.WriteStack.Initialize(JsonTypeInfo jsonTypeInfo, Boolean supportContinuation) in /_/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/WriteStack.cs:line 100
   at System.Text.Json.JsonSerializer.WriteUsingMetadata[TValue](TValue& value, JsonTypeInfo jsonTypeInfo) in /_/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Write.String.cs:line 126
   at System.Text.Json.JsonSerializer.Serialize[TValue](TValue value, JsonTypeInfo`1 jsonTypeInfo) in /_/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Write.String.cs:line 79
   at System.Text.Json.Serialization.Tests.SerializationWrapper.StringSerializerWrapper.SerializeWrapper[T](T value, JsonTypeInfo`1 jsonTypeInfo) in /_/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/SerializationWrapper.cs:line 78
   at System.Text.Json.Tests.Serialization.MetadataTests.RoundTripSerializerOverloads() in /_/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/MetadataTests/MetadataTests.JsonSerializer.cs:line 17
--- End of stack trace from previous location ---
Author: VincentBu
Assignees: -
Labels:

arch-x64, area-System.Text.Json, os-mac-os-x

Milestone: -

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Apr 28, 2021
@VincentBu
Copy link
Contributor Author

Failed in runtime-coreclr libraries-jitstress 20210506.1

Failed test:

net6.0-Linux-Release-arm-CoreCLR_checked-jitstress2-(Ubuntu.1804.Arm32.Open)[email protected]/dotnet-buildtools/prereqs:ubuntu-18.04-helix-arm32v7-bfcd90a-20200121150440
 -System.Text.Json.Tests.Serialization.MetadataTests_LowLevel.RoundTripSerializerOverloads

Error message:

System.NullReferenceException : Object reference not set to an instance of an object.


Stack trace
   at System.Text.Json.WriteStack.Initialize(JsonTypeInfo jsonTypeInfo, Boolean supportContinuation) in /_/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/WriteStack.cs:line 100
   at System.Text.Json.JsonSerializer.WriteUsingMetadata[TValue](Utf8JsonWriter writer, TValue& value, JsonTypeInfo jsonTypeInfo) in /_/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Write.Helpers.cs:line 44
   at System.Text.Json.JsonSerializer.Serialize[TValue](Utf8JsonWriter writer, TValue value, JsonTypeInfo`1 jsonTypeInfo) in /_/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Write.Utf8JsonWriter.cs:line 90
   at System.Text.Json.Serialization.Tests.SerializationWrapper.WriterSerializerWrapper.SerializeWrapper[T](T value, JsonTypeInfo`1 jsonTypeInfo) in /_/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/SerializationWrapper.cs:line 161
   at System.Text.Json.Tests.Serialization.MetadataTests.RoundTripSerializerOverloads() in /_/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/MetadataTests/MetadataTests.JsonSerializer.cs:line 17
--- End of stack trace from previous location ---

@ericstj
Copy link
Member

ericstj commented May 21, 2021

@layomia looks like we have a bug here. This tests seems to be failing intermittently on OSX since being introduced.

@eiriktsarpalis eiriktsarpalis added this to the 6.0.0 milestone Jul 16, 2021
@eiriktsarpalis eiriktsarpalis added needs-further-triage Issue has been initially triaged, but needs deeper consideration or reconsideration and removed untriaged New issue has not been triaged by the area owner labels Jul 16, 2021
@eiriktsarpalis eiriktsarpalis assigned steveharter and unassigned layomia Aug 9, 2021
@steveharter
Copy link
Member

I haven't seen any more hits; the test is not disabled.

The test uses a static JsonContext.Default that can be hit by multiple threads (i.e. other tests):

 string json = await Serializer.SerializeWrapper(expected, JsonContext.Default.WeatherForecastWithPOCOs);

and my guess is that the generated code for WeatherForecastWithPOCOs was not thread-safe when initializing the property:

        public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Text.Json.Serialization.Tests.WeatherForecastWithPOCOs> WeatherForecastWithPOCOs
        {
            get
            {
                if (_WeatherForecastWithPOCOs == null)

however it looks to be thread-safe now.

Closing until we get another hit or more information.

@steveharter steveharter added needs more info and removed needs-further-triage Issue has been initially triaged, but needs deeper consideration or reconsideration labels Aug 13, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Sep 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants