Skip to content

[wasm][coreclr] Fix Regressions test crash by increasing Node.js stack size#126601

Merged
radekdoulik merged 1 commit intodotnet:mainfrom
radekdoulik:fix/wasm-coreclr-test-node-stack-size
Apr 7, 2026
Merged

[wasm][coreclr] Fix Regressions test crash by increasing Node.js stack size#126601
radekdoulik merged 1 commit intodotnet:mainfrom
radekdoulik:fix/wasm-coreclr-test-node-stack-size

Conversation

@radekdoulik
Copy link
Copy Markdown
Member

Note

This PR was created with the help of GitHub Copilot.

Summary

Tests running CoreCLR on WASM via Node.js can overflow V8's JavaScript call stack when the test suite loads many assemblies and a test exercises deep recursive exception handling (e.g. test104820 with 100 levels of recursion and when filter funclets).

Changes

  • Increase the Node.js stack size from the default (~1MB) to 8MB via --stack-size=8192 in the WASM test runner scripts for both Linux/macOS (CLRTest.Execute.Bash.targets) and Windows (CLRTest.Execute.Batch.targets).
  • Disable test100536 on platforms without native test assets (P/Invoke test).

Root Cause

In the full Regressions suite, 87 test assemblies are loaded into a single process. The combined V8 call stack usage from assembly loading + xunit infrastructure + the deep recursive EH in test104820 (100,000 filter funclet invocations) exceeds V8's default stack limit, causing a silent crash (exit 0). The test passes in isolation because less V8 stack is consumed.

…k size

Tests running CoreCLR on WASM via Node.js can overflow V8's JavaScript
call stack when the test suite loads many assemblies and a test exercises
deep recursive exception handling (e.g. test104820 with 100 levels of
recursion and filter funclets).

Increase the Node.js stack size from the default (~1MB) to 8MB via
--stack-size=8192 in the test runner scripts for both Linux/macOS and
Windows.

Also disable test100536 on platforms without native test assets, since
it requires P/Invoke support.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 7, 2026 11:25
@radekdoulik radekdoulik added this to the Future milestone Apr 7, 2026
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke, @dotnet/runtime-infrastructure
See info in area-owners.md if you want to be subscribed.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the CoreCLR WASM (browser) test execution scripts to avoid Node.js/V8 JavaScript call stack overflows seen when running large test suites, and disables a P/Invoke regression test on platforms that don’t support native test assets.

Changes:

  • Add node --stack-size=8192 to the WASM (browser) test runner command line in both Bash and Batch execution targets.
  • Mark GitHub_100536/test100536 as an active issue on platforms lacking native test assets via PlatformDetection.PlatformDoesNotSupportNativeTestAssets.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/tests/Regressions/coreclr/GitHub_100536/test100536.cs Disables the test on platforms where native test assets aren’t supported.
src/tests/Common/CLRTest.Execute.Batch.targets Increases Node.js stack size for Windows WASM (browser) test execution.
src/tests/Common/CLRTest.Execute.Bash.targets Increases Node.js stack size for Unix WASM (browser) test execution.

@radekdoulik
Copy link
Copy Markdown
Member Author

/ba-g Build coreclr Pri0 Runtime Tests Run browser wasm checked succeeded, shouldn't affect other jobs

@radekdoulik radekdoulik enabled auto-merge (squash) April 7, 2026 15:19
@radekdoulik radekdoulik merged commit 556ab28 into dotnet:main Apr 7, 2026
94 of 102 checks passed
radekdoulik added a commit to radekdoulik/runtime that referenced this pull request Apr 9, 2026
…k size (dotnet#126601)

> [!NOTE]
> This PR was created with the help of GitHub Copilot.

## Summary

Tests running CoreCLR on WASM via Node.js can overflow V8's JavaScript
call stack when the test suite loads many assemblies and a test
exercises deep recursive exception handling (e.g. `test104820` with 100
levels of recursion and `when` filter funclets).

## Changes

- Increase the Node.js stack size from the default (~1MB) to 8MB via
`--stack-size=8192` in the WASM test runner scripts for both Linux/macOS
(`CLRTest.Execute.Bash.targets`) and Windows
(`CLRTest.Execute.Batch.targets`).
- Disable `test100536` on platforms without native test assets (P/Invoke
test).

## Root Cause

In the full Regressions suite, 87 test assemblies are loaded into a
single process. The combined V8 call stack usage from assembly loading +
xunit infrastructure + the deep recursive EH in `test104820` (100,000
filter funclet invocations) exceeds V8's default stack limit, causing a
silent crash (exit 0). The test passes in isolation because less V8
stack is consumed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants