-
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
CollectionsMarshal.AsSpan assertion failure in System.Text.Json tests #96876
Comments
Tagging subscribers to this area: @dotnet/area-infrastructure-libraries Issue DetailsBuild InformationBuild: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=524311 Error MessageFill the error message using step by step known issues guidance. {
"ErrorMessage": "Implementation depends on List<T> always using a T[] and not U[] where U : T.",
"ErrorPattern": "",
"BuildRetry": false,
"ExcludeConsoleLog": false
}
|
cc @stephentoub |
bleh, the change is flawed. will revert and rethink. |
Where is the flaw? |
Hmm, I was thinking for a moment it would still need to check and actually throw, but with lists being invariant, it shouldn't be possible to specify a T and pass in a List of a derived type. So now I don't know what's going on and will need to look at what the failing test is doing, but I'm away from my computer through the weekend. |
Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis Issue DetailsBuild InformationBuild: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=524311 Error MessageFill the error message using step by step known issues guidance. {
"ErrorMessage": "Implementation depends on List<T> always using a T[] and not U[] where U : T.",
"ErrorPattern": "",
"BuildRetry": false,
"ExcludeConsoleLog": false
} Known issue validationBuild: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=524311 Report
Summary
|
I am not able to reproduce the failure. It seems to be Linux Alpine Arm64 specific. |
I've tried a few things to reproduce it with no success. However, it reproduces on checked builds on x64 Linux (ubuntu!) (here's one for example). I've just noticed that it only happens on checked runtimes so I'm currently building one to verify it. I do have a guess as to what could be the issue: in the span ctor there is a type check however it gets skipped if the type is a value type, the failing code does the check for value types as well. As the stack traces make no sense I'm not sure if it's in any way realistic that |
This is codegen bug in PGO optimized code. The repro is not deterministic since it is triggered by a particular profile. I have looked at the dump from The codegen bug is in the PGO optimized Here is the disassembly of the inlined
|
I am commenting out the assert in #96877 to workaround the bug. Please add the assert back once the issue is fixed. |
Managed to repro locally on Main, investigating... |
Minimal repro: class Program
{
static void Main()
{
Console.WriteLine(foo<string>(new string[1]));
Console.ReadKey();
}
[MethodImpl(MethodImplOptions.NoInlining)]
static bool foo<T>(string[] list) => typeof(T[]) == list.GetType();
} Reproduces without PGO, seems like the bug is in |
From a bisection, the regression seems to have been introduced in range 82ac648...23a93aa. |
cc @davidwrighton @jkotas Could it be #96466 ? TLDR: it seems that JIT-EE |
Yes, that change included a fix in |
Build Information
Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=524311
Build error leg or test failing: System.Text.Json.Tests.WorkItemExecution
Pull request: #96870
Error Message
Fill the error message using step by step known issues guidance.
Known issue validation
Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=524311
Error message validated:
Implementation depends on List<T> always using a T[] and not U[] where U : T.
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 1/12/2024 1:31:48 AM UTC
Report
Summary
The text was updated successfully, but these errors were encountered: