Skip to content

CharClassSubtraction_DeepNesting_DoesNotStackOverflow fails with PlatformNotSupportedException on browser-wasm (NonBacktracking) #125020

@lewing

Description

@lewing
System.Text.RegularExpressions.Tests.RegexMatchTests.CharClassSubtraction_DeepNesting_DoesNotStackOverflow(engine: NonBacktracking) [FAIL]
  System.PlatformNotSupportedException
  Stack Trace:
    at System.Text.RegularExpressions.Symbolic.SymbolicRegexRunnerFactory..ctor(RegexTree regexTree, RegexOptions options, TimeSpan matchTimeout)

Build Information

Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=1314573
Build error leg or test failing: CharClassSubtraction_DeepNesting_DoesNotStackOverflow with NonBacktracking engine on browser-wasm
Pull request: #124125

Details

The test CharClassSubtraction_DeepNesting_DoesNotStackOverflow was added in #124995 (commit 50f4fec, merged Feb 27). It runs across all RegexEngine values via AvailableEngines_MemberData, including NonBacktracking.

On browser-wasm (single-threaded), the deep nesting with the NonBacktracking engine triggers internal threading APIs (Task.InternalWaitCoreThrowIfMultithreadingIsNotSupported) that are not supported. The NonBacktracking engine works fine on browser-wasm for normal patterns — only this extreme nesting depth triggers the threading code path. The fix is an in-test guard that skips only NonBacktracking on Browser, keeping Interpreter and Compiled coverage.

Affects 3 browser-wasm LibraryTests jobs:

  • LibraryTests browser-wasm linux Release
  • LibraryTests_EAT browser-wasm linux Release
  • LibraryTests browser-wasm windows Release

Not related to any PR changes ΓÇö this is a main-branch regression in test coverage.

Error Message

{
  "ErrorPattern": "[FAIL].*_DeepNesting_DoesNotStackOverflow",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=1314573
Error message validated: [[FAIL].*_DeepNesting_DoesNotStackOverflow]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 3/1/2026 3:37:52 AM UTC

Report

Build Definition Test Pull Request
1315244 dotnet/runtime WasmTestOnChrome-MONO-ST-System.Text.RegularExpressions.Tests.WorkItemExecution #124125
1315234 dotnet/runtime WasmTestOnChrome-MONO-ST-System.Text.RegularExpressions.Tests.WorkItemExecution #124492
1315225 dotnet/runtime WasmTestOnChrome-MONO-ST-System.Text.RegularExpressions.Tests.WorkItemExecution #124478
1315220 dotnet/runtime WasmTestOnChrome-MONO-ST-System.Text.RegularExpressions.Tests.WorkItemExecution #122950
1315183 dotnet/runtime WasmTestOnChrome-MONO-ST-System.Text.RegularExpressions.Tests.WorkItemExecution #124375
1315178 dotnet/runtime WasmTestOnChrome-MONO-ST-System.Text.RegularExpressions.Tests.WorkItemExecution #125022
1315153 dotnet/runtime WasmTestOnChrome-MONO-ST-System.Text.RegularExpressions.Tests.WorkItemExecution #124959
1315149 dotnet/runtime WasmTestOnChrome-MONO-ST-System.Text.RegularExpressions.Tests.WorkItemExecution #124969
1315116 dotnet/runtime WasmTestOnChrome-MONO-ST-System.Text.RegularExpressions.Tests.WorkItemExecution #124964
1315088 dotnet/runtime WasmTestOnChrome-MONO-ST-System.Text.RegularExpressions.Tests.WorkItemExecution #125024
1315035 dotnet/runtime WasmTestOnChrome-MONO-ST-System.Text.RegularExpressions.Tests.WorkItemExecution #124994
1315019 dotnet/runtime WasmTestOnChrome-MONO-ST-System.Text.RegularExpressions.Tests.WorkItemExecution #124969
1315007 dotnet/runtime WasmTestOnChrome-MONO-ST-System.Text.RegularExpressions.Tests.WorkItemExecution #124959
1315005 dotnet/runtime WasmTestOnChrome-MONO-ST-System.Text.RegularExpressions.Tests.WorkItemExecution
1314989 dotnet/runtime WasmTestOnChrome-MONO-ST-System.Text.RegularExpressions.Tests.WorkItemExecution #124904
1314994 dotnet/runtime WasmTestOnChrome-MONO-ST-System.Text.RegularExpressions.Tests.WorkItemExecution #124850
1314965 dotnet/runtime WasmTestOnChrome-MONO-ST-System.Text.RegularExpressions.Tests.WorkItemExecution #125024
1314845 dotnet/runtime WasmTestOnChrome-MONO-ST-System.Text.RegularExpressions.Tests.WorkItemExecution #125021
1314811 dotnet/runtime WasmTestOnChrome-MONO-ST-System.Text.RegularExpressions.Tests.WorkItemExecution #125022
1314732 dotnet/runtime WasmTestOnChrome-MONO-ST-System.Text.RegularExpressions.Tests.WorkItemExecution #124408
1314713 dotnet/runtime WasmTestOnChrome-MONO-ST-System.Text.RegularExpressions.Tests.WorkItemExecution #125017
1314573 dotnet/runtime WasmTestOnChrome-MONO-ST-System.Text.RegularExpressions.Tests.WorkItemExecution #124125

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
21 22 22

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions