Skip to content

Release test1_539509's large static array before shutdown - #136869

Merged
AndyAyersMS merged 1 commit into
dotnet:mainfrom
AndyAyersMS:fix-135042-gcstress-shutdown-array
Nov 3, 2026
Merged

AndyAyersMS merged 1 commit into
dotnet:mainfrom
AndyAyersMS:fix-135042-gcstress-shutdown-array

Conversation

@AndyAyersMS

Copy link
Copy Markdown
Member

Summary

Release App.m_alFwd20 at the end of TestEntryPoint, after BB.Method1 and its exception handler, before printing Passed.. All existing allocations, byref stores, test calls, and exception handling remain unchanged.

Static5 leaves an array with 31,298,400 reference slots rooted in this static field (125 MB on x86). The Windows timeout dump from build 1648012 shows shutdown waiting for an ETW callback that is generating the runtime EventSource manifest and repeatedly scanning this array under GCStress.

Addresses the Windows x86 GCStress occurrence reported in #135042. The browser-Wasm failure was not reproduced locally and is not claimed to be fixed.

Validation

Recompiled the complete modified test source with Roslyn, /optimize- /debug:full, against the recovered matching Windows x86 Checked CI runtime from build 1648012. Compilation passed.

A session-only diagnostic driver calls the complete App.TestEntryPoint, checks that the static root was cleared, and then generates the NativeRuntimeEventSource manifest. Commands below ran from that recovered CI layout:

DOTNET_GCStress Command Result
0 corerun.exe test1_539509_check_baseline.dll Original CI test prints Passed., then fails the added cleanup check as expected (exit 1).
0 corerun.exe test1_539509_check_fixed.dll manifest Passed, exit 100, 1.7 seconds.
3 corerun.exe test1_539509_check_fixed.dll manifest Passed, exit 100, 81.8 seconds including post-test manifest generation.

All seven original test operations and six handled-exception messages match the baseline in both patched runs.

An isolated probe using the same CI runtime measured 100 forced compacting full GCs at 9.265 seconds with the array rooted versus 0.022 seconds after clearing the root. This is a GC-cost probe, not a full-test benchmark.

git diff --check passed. No repository SDK/project build, full test suite, or browser-Wasm validation was run for this patch.

Note

This fix and pull request description were prepared with GitHub Copilot.

@github-actions github-actions Bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Nov 2, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
12 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

@AndyAyersMS

Copy link
Copy Markdown
Member Author

Seems like recent changes in reflection have increased the numbers of GCs that need to run during shutdown (via EventSource) and may have lead to this test now taking too long.

I couldn't reproduce the Wasm timeout locally, so am not sure that this will fix the problem there. But it seems possible.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

There are no active review issues for the targeted cleanup of the static array before runtime shutdown.

No open issues 🎉

What changed in this PR

This PR clears the regression test’s large static array before runtime shutdown to address the Windows x86 GCStress timeout reported in #135042. It does not claim to fix the browser-Wasm failure.

Changes:

  • Sets App.m_alFwd20 to null after the final test operation and exception handler, before printing Passed..
  • Adds a comment explaining the cleanup while preserving existing test operations and exception handling.
File Description
src/​tests/​JIT/​jit64/​regress/​vsw/​539509/​test1.cs Clears the large static array reference at test completion to avoid retaining it during shutdown.

Review effort: Balanced

@AndyAyersMS

Copy link
Copy Markdown
Member Author

/ba-g osx-arm64 unrelated build timeout / disconnect

@AndyAyersMS
AndyAyersMS merged commit b259fef into dotnet:main Nov 3, 2026
78 of 81 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants