Skip to content

Test failure: GC/API/GC/Collect/Collect.dll #131721

Closed

Description

@VincentBu

Failed in: runtime-coreclr jitstress2-jitstressregs 20260802.1

Failed tests:

coreclr windows x86 Checked jitstress2_jitstressregs1 @ Windows.10.Amd64.Open
- GC/API/GC/Collect/Collect.dll

Error message:

Assert.Equal() Failure: Values differ
Expected: 100
Actual:   1

Stack trace:

   at Xunit.Assert.Equal[T](T expected, T actual, IEqualityComparer`1 comparer) in /_/src/arcade/src/Microsoft.DotNet.XUnitAssert/src/EqualityAsserts.cs:line 102
   at Program.<<Main>$>g__TestExecutor14|0_15(StreamWriter tempLogSw, StreamWriter statsCsvSw, <>c__DisplayClass0_0&)

Activity

  1. added
    area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
    on Aug 3, 2026
  2. dotnet-policy-service commented on Aug 3, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
    See info in area-owners.md if you want to be subscribed.

  3. added this to the 11.0.0 milestone on Aug 3, 2026
  4. removed
    untriagedNew issue has not been triaged by the area owner
    on Aug 3, 2026
  5. JulieLeeMSFT commented on Aug 3, 2026

    @JulieLeeMSFT
    Member

    @AndyAyersMS, please check if this is a JIT issue.

  6. AndyAyersMS commented on Aug 3, 2026

    @AndyAyersMS
    Member

    Not a codegen issue; most likely a consequence of #126108 -- this test used to run in an isolated process.

    @jkoritzinsky FYI

  7. added and removed
    area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
    on Aug 4, 2026
  8. dotnet-policy-service commented on Aug 4, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @anicka-net, @dotnet/gc
    See info in area-owners.md if you want to be subscribed.

  9. kkokosa commented on Aug 7, 2026

    @kkokosa
    Member

    @jkoritzinsky - PR #126108 removed process isolation from Collect, Collect0, and Collect1, putting them in the shared GC runner. In the failing ordering, GCHandle/AddrOfPinnedObject runs immediately before Collect. It creates a pinned GCHandle, never frees it, and performs a full collection. Consequently, Collect tests start with a live pinned object and generation boundaries shaped by earlier collections rather than a fresh heap. On x86 segment GC, pinned-plug demotion can leave the tested survivor in gen0, making the observed 0 -> 0 result valid even though the test assumes promotion. More generally, GC.Collect does not guarantee survivor promotion, so all three tests’ exact-generation assertions are sensitive to prior process-wide GC state.

    I restored isolation for those three tests here: https://github.com/kkokosa/runtime/tree/fix-131721-gc-collect-isolation, WDYT?

  10. jkoritzinsky commented on Aug 9, 2026

    @jkoritzinsky
    Member

    @kkokosa that resolution sounds great. If that fixes the issues, I'm happy with it.

    You may also need to mark the tests as JitOptimizationSensitive (as this should fix #131893 too).

    I'll add you as assignee for both issues for easy tracking.

  11. VincentBu commented on Aug 10, 2026

    @VincentBu
    ContributorAuthor

    Failed in: runtime-coreclr jitstress-isas-x86 20260808.1

    Failed tests:

    coreclr linux x64 Checked jitstress_isas_1_x86_vectort512 @ AzureLinux.3.Amd64.Open
    - GC/API/GC/Collect/Collect.dll
    
    

    Error message:

    Assert.Equal() Failure: Values differ
    Expected: 100
    Actual:   1
    

    Stack trace:

       at Xunit.Assert.Equal[T](T expected, T actual, IEqualityComparer`1 comparer) in /_/src/arcade/src/Microsoft.DotNet.XUnitAssert/src/EqualityAsserts.cs:line 102
       at Program.<<Main>$>g__TestExecutor14|0_15(StreamWriter tempLogSw, StreamWriter statsCsvSw, StreamWriter outOfProcessPlanWriter, <>c__DisplayClass0_0&)
    
  12. kkokosa commented on Aug 10, 2026

    @kkokosa
    Member

    @jkoritzinsky I reproduced all three Collect* failures locally in the shared x86 Checked runner by accumulating leaked pinned handles; freeing the handles or excluding AddrOfPinnedObject produced zero failures in 10,000 iterations. The failures also occur under FullOpt, so JitOptimizationSensitive does not seem warranted. This explains both #131893 and the above Linux x64 failure as the same shared-state problem rather than architecture- or JIT-mode-specific behavior. I've created #132076

  13. added a commit that references this issue on Aug 12, 2026
    705bed2
  14. locked and limited conversation to collaborators on Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

  • Status
    No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions