Skip to content

[tvOS] Crash in System.Text.Json NullableTests.ClassWithDictionariesWithNullableValues #79583

Description

@steveisok

NullableTests.ClassWithDictionariesWithNullableValues appears to be crashing reliably on tvOS runs.

AzDo build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=109880&view=logs&j=acac6bf3-3edd-5022-4e45-3362a02520b1&t=1de8bf71-8fe5-5d5c-4360-8c2eb159d012

public static void ClassWithDictionariesWithNullableValues()
{
string json =
@"{
""Dict"": {""key"": ""1995-04-16""},
""IDict"": {""key"": null},
""ImmutableDict"": {""key"": ""1997-03-22""},
""ImmutableSortedDict"": { ""key"": null}
}";
SimpleClassWithDictionariesWithNullableValues obj = JsonSerializer.Deserialize<SimpleClassWithDictionariesWithNullableValues>(json);
Assert.Equal(new DateTime(1995, 4, 16), obj.Dict["key"]);
Assert.Null(obj.IDict["key"]);
Assert.Equal(new DateTime(1997, 3, 22), obj.ImmutableDict["key"]);
Assert.Null(obj.ImmutableSortedDict["key"]);
string serialized = JsonSerializer.Serialize(obj);
Assert.Contains(@"""Dict"":{""key"":""1995-04-16T00:00:00""}", serialized);
Assert.Contains(@"""IDict"":{""key"":null}", serialized);
Assert.Contains(@"""ImmutableDict"":{""key"":""1997-03-22T00:00:00""}", serialized);
Assert.Contains(@"""ImmutableSortedDict"":{""key"":null}", serialized);
}

at <unknown> <0xffffffff>
at System.Object:__icall_wrapper_mono_gsharedvt_constrained_call <0x00007>
at System.Text.Json.Serialization.Converters.IDictionaryOfTKeyTValueConverter`3:Add <0x001cb>
at System.Object:gsharedvt_in <0x000db>
at System.Object:gsharedvt_out <0x000db>
at System.Text.Json.Serialization.JsonDictionaryConverter`3:OnTryRead <0x0054f>
at System.Text.Json.Serialization.JsonConverter`1:TryRead <0x001df>
at System.Text.Json.Serialization.Metadata.JsonPropertyInfo`1:ReadJsonAndSetMember <0x0011b>
at System.Text.Json.Serialization.Converters.ObjectDefaultConverter`1:OnTryRead <0x003ff>
at System.Text.Json.Serialization.JsonConverter`1:TryRead <0x001df>
at System.Text.Json.Serialization.JsonConverter`1:ReadCore <0x002a7>
at System.Text.Json.Serialization.Metadata.JsonTypeInfo`1:Deserialize <0x00047>
at System.Text.Json.JsonSerializer:ReadFromSpan <0x00123>
at System.Text.Json.JsonSerializer:ReadFromSpan <0x00117>
at System.Text.Json.JsonSerializer:Deserialize <0x0007b>
at System.Text.Json.Serialization.Tests.NullableTests:ClassWithDictionariesWithNullableValues <0x00047>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions