Skip to content

Test failure: GC/Features/HeapExpansion/bestfit-finalize/bestfit-finalize.cmd #132107

Description

@VincentBu

Failed in: runtime-coreclr outerloop 20260809.3

Failed tests:

coreclr browser wasm Checked no_tiered_compilation @ (Ubuntu.2604.Amd64.Open)AzureLinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-26.04-helix-webassembly-amd64@sha256:0be8725e08b6d0f58ec0290f3f3b70c449123e78b2b33853e9049df84b912fa8
- GC/Features/HeapExpansion/bestfit-finalize/bestfit-finalize.cmd

Error message:

Out-of-process wrapper failed with exit code 1.
BEGIN EXECUTION
Running with node
CORE_ROOT: /root/helix/work/correlation
ExePath: /root/helix/work/workitem/e/GC/Features/HeapExpansion/bestfit-finalize/bestfit-finalize.dll
CLRTestExecutionArguments:
node version: v23.11.1
Timeout in ms: 900000
Running: node --experimental-wasm-exnref --stack-size=8192 /root/helix/work/correlation/corerun.js -c /root/helix/work/correlation -p System.Reflection.Metadata.MetadataUpdater.IsSupported=false -p System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization=true /root/helix/work/workitem/e/GC/Features/HeapExpansion/bestfit-finalize/bestfit-finalize.dll
Using defaults: 1 1200 100000
Using random seed: 246730784
Took 13950 iterations to reach steady state
OOM
3841357900
Test Failed
Kill watchdog with PID 225
Expected: 100
Actual: 1
END EXECUTION - FAILED

Stack trace:

   at Xunit.Assert.True(Nullable`1 condition, String userMessage) in /_/src/arcade/src/Microsoft.DotNet.XUnitAssert/src/BooleanAsserts.cs:line 135
   at Xunit.Assert.True(Boolean condition, String userMessage) in /_/src/arcade/src/Microsoft.DotNet.XUnitAssert/src/BooleanAsserts.cs:line 117
   at TestLibrary.OutOfProcessTest.ImportPrecomputedResult(String assemblyPath, String testPathPrefix) in /__w/1/s/src/tests/Common/CoreCLRTestLibrary/OutOfProcessTest.cs:line 285
   at TestLibrary.OutOfProcessTest.RunOutOfProcessTest(String assemblyPath, String testPathPrefix) in /__w/1/s/src/tests/Common/CoreCLRTestLibrary/OutOfProcessTest.cs:line 84
   at Program.<<Main>$>g__TestExecutor15|0_16(StreamWriter tempLogSw, StreamWriter statsCsvSw, StreamWriter outOfProcessPlanWriter, <>c__DisplayClass0_0&)

Known Issue Error Message

DO NOT USE JSON BELOW IF THIS IS A BUILD BREAK otherwise build analysis will allow pull requests to merge that break the build worse. For a build break, do not use this issue form. Make a regular new issue.

Fill the error message using step by step known issues guidance.

{
  "ErrorMessage": "Failed test: GC/Features/HeapExpansion/bestfit-finalize",
  "ErrorPattern": "",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=1545892
Error message validated: [Failed test: GC/Features/HeapExpansion/bestfit-finalize]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 8/24/2026 11:48:43 AM UTC

Report

Build Repository Test Pull Request
1641274 dotnet/runtime GC/Features/HeapExpansion/bestfit-finalize/bestfit-finalize.cmd
1640303 dotnet/runtime GC/Features/HeapExpansion/bestfit-finalize/bestfit-finalize.cmd #136077
1640439 dotnet/runtime GC/Features/HeapExpansion/bestfit-finalize/bestfit-finalize.cmd #136080
1637158 dotnet/runtime GC/Features/HeapExpansion/bestfit-finalize/bestfit-finalize.cmd
1633691 dotnet/runtime GC/Features/HeapExpansion/bestfit-finalize/bestfit-finalize.cmd
1630399 dotnet/runtime GC/Features/HeapExpansion/bestfit-finalize/bestfit-finalize.cmd #135541
1628720 dotnet/runtime GC/Features/HeapExpansion/bestfit-finalize/bestfit-finalize.cmd
1621260 dotnet/runtime GC/Features/HeapExpansion/bestfit-finalize/bestfit-finalize.cmd #135105

Summary

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

Activity

  1. added
    blocking-outerloopBlocking the 'runtime-coreclr outerloop' and 'runtime-libraries-coreclr outerloop' runs
    on Aug 11, 2026
  2. added
    area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
    on Aug 11, 2026
  3. dotnet-policy-service commented on Aug 11, 2026

    @dotnet-policy-service
    Contributor

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

  4. self-assigned this
    on Aug 11, 2026
  5. removed
    untriagedNew issue has not been triaged by the area owner
    on Aug 11, 2026
  6. added this to the 12.0.0 milestone on Aug 11, 2026
  7. JulieLeeMSFT commented on Aug 27, 2026

    @JulieLeeMSFT
    Member

    @AndyAyersMS, this failure is affecting many pipelines. PTAL.

  8. tannergooding commented on Sep 12, 2026

    @tannergooding
    Member

    The browser CoreCLR OOM is reproducible and appears to be finalizer starvation, rather than excessive live-request memory or a timeout.

    I replayed the normal/non-R2R failure from build 1593908 on #133774 using the original test DLL and browser Wasm Checked runtime from its GC-features Helix payload. The local host was Windows with Node 23.11.1 and tiering disabled, matching the CI Node version and scenario, but not its Linux container.

    With unchanged arguments 1 1200 100000 1094640032, the original binary reaches steady state after 15,970 requests, then throws OOM with GC.GetTotalMemory(false) reporting 3,841,467,072 bytes. The CI log reports 3,841,067,724 bytes.

    The relevant scheduling behavior is:

    • Each Request retains its survivor arrays and a pinned GCHandle; its finalizer releases the handle.
    • Go() synchronously constructs requests until five times the steady-state count: 79,850 for this seed.
    • Browser FinalizerThread::EnableFinalization defers execution to the host. SystemJS_ScheduleFinalization uses safeSetTimeout(..., 0).
    • This synchronous loop never returns control to the JS event loop. Collections continue, but the scheduled finalizers do not run, leaving dead requests' object graphs and pinned handles retained.

    An instrumented copy counted completed constructors and finalizers (the latter after pin.Free()), sampling memory once per 1,200 requests:

    Run Constructed requests Finalizers observed Managed heap Result
    No scheduling change 59,739 0 3,841,635,812 bytes at OOM Exit 1
    Drain pending finalizers every 1,200 requests 79,850 76,547 376,938,324 bytes at the last observation; maximum sampled value 405,719,424 bytes Exit 100

    The control performed 291 full collections without executing a single Request finalizer. The drain run still used natural collections; no GC.Collect() was added. The sampled maximum is not a continuous peak measurement, and the finalizer counts were observed before post-loop cleanup.

    An applicable test workaround is to add this immediately after requests[i] = new Request():

    if (OperatingSystem.IsBrowser() && (totalReqs % NumRequests == 0))
    {
        // Browser finalizers cannot run while this synchronous loop holds the JS thread.
        // Drain once per live-set-sized batch so dead requests can release their pins
        // and survivor arrays, without forcing collections.
        GC.WaitForPendingFinalizers();
    }

    On this runtime, WaitForPendingFinalizers drains synchronously outside the collection; it does not require returning to JavaScript. This preserves the random sequence, request count, allocation volume, survivor selection, pinning, and existing success/failure conditions.

    The uninstrumented workaround passed the failing seed, seed 0, and a two-outer-iteration run with the original 1200 100000 workload. Original and patched versions also passed on desktop. These were direct test-source compilations against the downloaded CI runtime, not a fresh runtime build or a rerun of the full Helix harness.

    This is a workaround for the test, not a general runtime fix: ordinary synchronous user allocation loops can encounter the same lack of finalizer progress. The reproduced failure is on CoreCLR Wasm; these experiments do not establish Mono Wasm behavior or a RyuJIT codegen defect.

    Note

    This analysis and workaround were drafted by GitHub Copilot from source inspection and local reproduction results.

  9. added a commit that references this issue on Oct 1, 2026
    9e2b506
  10. reopened this on Oct 1, 2026
  11. lewing commented on Oct 1, 2026

    @lewing
    Member

    reopening temporarily to let ci clear

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Known Build ErrorUse this to report build issues in the .NET Helix tabarea-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIblocking-clean-ci-optionalBlocking optional rolling runsblocking-outerloopBlocking the 'runtime-coreclr outerloop' and 'runtime-libraries-coreclr outerloop' runs

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions