-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
JsonSerializer.Deserialize throws random errors running in parallel on 64-bit .NET Core 3.1 or .NET 6 runtime on Windows 7 #66272
Comments
Tagging subscribers to this area: @dotnet/area-system-text-json Issue DetailsDescriptionWhen This behaviour is observed in 64-bit runtime of .NET Core 3.1, .NET 5 and .NET 6 on Windows 7. Reproduction StepsCreate and run the following using System;
using System.Diagnostics;
using System.Linq;
using System.Text.Json;
using System.Threading.Tasks;
var data = Enumerable.Repeat("quick brown fox jumps over lazy dog", 1000);
var json = JsonSerializer.Serialize(data);
Parallel.For(0, 100000000, i =>
{
try
{
JsonSerializer.Deserialize<object>(json);
}
catch (Exception x)
{
var msg = $"{x.GetType().FullName}: {x.Message}";
Console.WriteLine(msg);
Trace.WriteLine(msg);
}
}); Try different Expected behaviorNo error messages in the console. Actual behaviorA lot of random errors like these (not a complete list):
Regression?
Known WorkaroundsNo response Configuration
Other informationNo response
|
Also if it is, did the necessary fixes get into 7.0 Preview 2 for them to try? I see it will be in 6.0.4. |
…ndom deserialization errors in System.Json.JsonSerializer (compare evidence dotnet/runtime#66272)
we've fixed bunch of issues similar to this in 7.0. I'd recommend to try preview and giving us feedback. I think the best workaround I can think of for previews versions is first running advanced serialization/deserialization scenario in single thread and after that running them in parallel since many of these bugs are related to how internal metadata is initialized |
This issue says that it's specific to Windows 7 and .Net 7 does not support Windows 7. |
I don't this is something we might want to service in .NET 6. Also, per dotnet/announcements#226 Windows 7 will not be supported in future releases so I'd be inclined to close this. |
Description
When
JsonSerializer.Deserialize
is invoked in parallel in multiple threads it throws random errors.This behaviour is observed in 64-bit runtime of .NET Core 3.1, .NET 5 and .NET 6 on Windows 7.
Reproduction Steps
Create and run the following
Console Application
for .NET 6 code:Try different
count
forEnumerable.Repeat
from 100 to 1000 to get different kind of errors.Expected behavior
No error messages in the console.
Actual behavior
A lot of random errors like these (not a complete list):
Regression?
System.Text.Json
v6.0.2 package works correctly on either 32-bit or 64-bit runtime on Windows 7.Known Workarounds
No response
Configuration
Other information
No response
The text was updated successfully, but these errors were encountered: