Skip to content

CollectionsMarshal.AsSpan assertion failure in System.Text.Json tests #96876

Closed

Description

@jkotas

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.

{
  "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

Build Definition Test Pull Request
524882 dotnet/runtime System.Text.Json.Tests.WorkItemExecution #95583
525560 dotnet/runtime System.Text.Json.Tests.WorkItemExecution #96609
526100 dotnet/runtime System.Text.Json.Tests.WorkItemExecution #96880
525785 dotnet/runtime System.Text.Json.Tests.WorkItemExecution #96913
525988 dotnet/runtime System.Text.Json.Tests.WorkItemExecution #96928
525991 dotnet/runtime System.Text.Json.Tests.WorkItemExecution #89472
525957 dotnet/runtime System.Text.Json.Tests.WorkItemExecution #96927
525923 dotnet/runtime System.Text.Json.Tests.WorkItemExecution #96926
525892 dotnet/runtime System.Text.Json.Tests.WorkItemExecution #96201
525842 dotnet/runtime System.Text.Json.Tests.WorkItemExecution #96924
525765 dotnet/runtime System.Text.Json.Tests.WorkItemExecution #96921
525686 dotnet/runtime System.Text.Json.Tests.WorkItemExecution #96916
525621 dotnet/runtime System.Text.Json.Tests.WorkItemExecution
525570 dotnet/runtime System.Text.Json.Tests.WorkItemExecution #96880
525477 dotnet/runtime System.Text.Json.Tests.WorkItemExecution #96805
525444 dotnet/runtime System.Text.Json.Tests.WorkItemExecution #96867
525362 dotnet/runtime System.Text.Json.Tests.WorkItemExecution #96880
525344 dotnet/runtime System.Text.Json.Tests.WorkItemExecution #96741
525094 dotnet/runtime System.Text.Json.Tests.WorkItemExecution #96894
525249 dotnet/runtime System.Text.Json.Tests.WorkItemExecution #96896
525236 dotnet/runtime System.Text.Json.Tests.WorkItemExecution #96445
525231 dotnet/runtime System.Text.Json.Tests.WorkItemExecution #96890
525196 dotnet/runtime System.Text.Json.Tests.WorkItemExecution #96214
525140 dotnet/runtime System.Text.Json.Tests.WorkItemExecution #96676
525086 dotnet/runtime System.Text.Json.Tests.WorkItemExecution #96893
525001 dotnet/runtime System.Text.Json.Tests.WorkItemExecution #96741
524968 dotnet/runtime System.Text.Json.Tests.WorkItemExecution #96892
524959 dotnet/runtime System.Text.Json.Tests.WorkItemExecution #96558
524862 dotnet/runtime System.Text.Json.Tests.WorkItemExecution #96889
524798 dotnet/runtime System.Text.Json.Tests.WorkItemExecution
524790 dotnet/runtime System.Text.Json.Tests.WorkItemExecution #95583
524621 dotnet/runtime System.Text.Json.Tests.WorkItemExecution #96860
524464 dotnet/runtime System.Text.Json.Tests.WorkItemExecution #96805
524458 dotnet/runtime System.Text.Json.Tests.WorkItemExecution #96867
524255 dotnet/runtime System.Text.Json.Tests.WorkItemExecution #96829
524448 dotnet/runtime System.Text.Json.Tests.WorkItemExecution #96858
524210 dotnet/runtime System.Text.Json.Tests.WorkItemExecution
524311 dotnet/runtime System.Text.Json.Tests.WorkItemExecution #96870
524291 dotnet/runtime System.Text.Json.Tests.WorkItemExecution #96867
524193 dotnet/runtime System.Text.Json.Tests.WorkItemExecution #96858
524168 dotnet/runtime System.Text.Json.Tests.WorkItemExecution #96805
524110 dotnet/runtime System.Text.Json.Tests.WorkItemExecution #96795
524101 dotnet/runtime System.Text.Json.Tests.WorkItemExecution #96699

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
0 43 43

Activity

  1. added
    blocking-clean-ciBlocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'
    Known Build ErrorUse this to report build issues in the .NET Helix tab
    on Jan 12, 2024
  2. ghost added
    untriagedNew issue has not been triaged by the area owner
    on Jan 12, 2024
  3. jkotas commented on Jan 12, 2024

    @jkotas
    MemberAuthor
  4. stephentoub commented on Jan 12, 2024

    @stephentoub
    Member

    bleh, the change is flawed. will revert and rethink.

  5. ghost added
    in-prThere is an active PR which will close this issue when it is merged
    on Jan 12, 2024
  6. jkotas commented on Jan 12, 2024

    @jkotas
    MemberAuthor

    bleh, the change is flawed. will revert and rethink.

    Where is the flaw?

  7. stephentoub commented on Jan 12, 2024

    @stephentoub
    Member

    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.

  8. added this to the 9.0.0 milestone on Jan 12, 2024
  9. ghost removed
    untriagedNew issue has not been triaged by the area owner
    on Jan 12, 2024
  10. 10 remaining items

  11. EgorBo commented on Jan 13, 2024

    @EgorBo
    Member

    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 gtFoldTypeCompare

  12. EgorBo commented on Jan 13, 2024

    @EgorBo
    Member

    This is the current culprit:

    image

    same VM call in .NET 8.0 (where bug is not manifested) returns May

  13. jakobbotsch commented on Jan 13, 2024

    @jakobbotsch
    Member

    From a bisection, the regression seems to have been introduced in range 82ac648...23a93aa.

  14. EgorBo commented on Jan 13, 2024

    @EgorBo
    Member

    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 compareTypesForEquality(string[], _Canon[]) returns MustNot now.

  15. jkotas commented on Jan 13, 2024

    @jkotas
    MemberAuthor

    Could it be #96466 ?

    Yes, that change included a fix in HasSameTypeDefAs that broke implementation of compareTypesForEquality. Thank you for tracking it down!

  16. added a commit that references this issue on Jan 17, 2024
    a9c69c9
  17. ghost added
    in-prThere is an active PR which will close this issue when it is merged
    on Jan 17, 2024
  18. added and removed
    area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
    on Jan 17, 2024
  19. ghost removed
    in-prThere is an active PR which will close this issue when it is merged
    on Jan 18, 2024
  20. added a commit that references this issue on Jan 23, 2024
    6a30885
  21. added a commit that references this issue on Jan 25, 2024
    5415bd2
  22. locked and limited conversation to collaborators on Feb 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Known Build ErrorUse this to report build issues in the .NET Helix tabarea-VM-coreclrblocking-clean-ciBlocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions