runtime: CollectionsMarshal.AsSpan assertion failure in System.Text.Json tests
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: https://github.com/dotnet/runtime/pull/96870
Error Message
Fill 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 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
| 24-Hour Hit Count | 7-Day Hit Count | 1-Month Count |
|---|---|---|
| 0 | 43 | 43 |
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 17 (14 by maintainers)
Commits related to this issue
- Fix compareTypesForEquality Fixes #96876 — committed to jkotas/runtime by jkotas 3 years ago
- Fix compareTypesForEquality (#97062) Fixes #96876 — committed to tmds/runtime by jkotas 3 years ago
- Fix compareTypesForEquality (#97062) Fixes #96876 — committed to danmoseley/runtime by jkotas 3 years ago
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
runfo get-helix-payload -j ec78045b-ffd3-4800-9c13-a3f3db5a5b72 -w System.Text.Json.Tests -o $HOME/helix_payload/System.Text.Json.Tests.The codegen bug is in the PGO optimized
VerifyWeatherForecastWithPOCOsmethod. The JIT inlines theOrderByLinq call graph into the method, including theCollectionsMarshal.AsSpanmethod called by the Linq.Here is the disassembly of the inlined
CollectionsMarshal.AsSpanwith the codegen bug:Yes, that change included a fix in
HasSameTypeDefAsthat broke implementation ofcompareTypesForEquality. Thank you for tracking it down!