Skip to content

[release/11.0] [mono][aot] Fix recursive struct wrapper normalization - #135334

Merged
eiriktsarpalis merged 4 commits into
release/11.0from
backport/pr-135029-to-release/11.0
Nov 16, 2026
Merged

eiriktsarpalis merged 4 commits into
release/11.0from
backport/pr-135029-to-release/11.0

Conversation

@github-actions

@github-actions github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Backport of #135438 to release/11.0.

/cc @pavelsavara

Customer Impact

  • Customer reported
  • Found internally

Blazor WebAssembly AOT publishing deterministically crashes
mono-aot-cross with a native stack overflow when a value type contains a
generic value-type field instantiated over the containing type. The customer
reproduction is tracked by #132071 and reproduces on .NET 10 and .NET 11.

Regression

  • Yes
  • No

This is an existing Mono AOT compiler limitation rather than a regression.

Testing

The corrected backport removes the invalid mutually recursive generic test
types from #135029 that caused #135348. It retains only the valid
self-recursive shape and makes the helper types private.

  • .\build.cmd -bl -os browser -subset mono+libs -c Release /p:RuntimeFlavor=Mono
    • Passed with 0 warnings and 0 errors.
  • Mono browser AOT on Chrome,
    System.Tests.ValueTypeTests
    • AOT-compiled 80 assemblies.
    • 23/23 tests passed.
    • XHarness exit code 0.
  • Original source-only Blazor reproduction from Blazor WASM AOT Compilation Failure #132071, using the
    release/11.0 mono-aot-cross
    • App assembly compiled successfully.
    • Dedup aot-instances.dll compiled successfully (14,712/14,747 methods).
  • The corrected test shape was also verified on main before [mono][aot] Fix recursive struct wrapper normalization #135438:
    • The compiler without the fix exits with 0xC00000FD.
    • The compiler with the fix successfully compiles the same test assembly.

Risk

Low. The native change is limited to recursive gsharedvt wrapper-signature
normalization. It uses the existing non-shared fallback when a value type is
encountered again or the bounded recursion depth is reached. Acyclic value
types retain their prior normalization behavior. The corrected test avoids the
invalid cross-runtime metadata that caused the original CI regression.

Note

This PR description was updated with GitHub Copilot.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 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: @dotnet/area-system-numerics
See info in area-owners.md if you want to be subscribed.

@pavelsavara pavelsavara self-assigned this Oct 7, 2026
@pavelsavara pavelsavara added the arch-wasm WebAssembly architecture label Oct 7, 2026
@pavelsavara pavelsavara added this to the 11.0.0 milestone Oct 7, 2026
@pavelsavara
pavelsavara requested review from BrzVlad and lewing October 7, 2026 09:50
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara
See info in area-owners.md if you want to be subscribed.

@jkotas

jkotas commented Oct 7, 2026

Copy link
Copy Markdown
Member

The tests introduced by this PR are failing - #135348 . The fix for these failures should be included in this PR.

@pavelsavara
pavelsavara marked this pull request as draft October 8, 2026 08:44
Remove the mutually recursive generic value types added by the original test.
CoreCLR rejects that metadata while loading System.Runtime.Tests, before test
discovery, which caused #135348 across unrelated CI legs.

Keep the valid self-recursive shape that reproduces the Mono AOT compiler stack
overflow and make its helper types private. This matches the corrected test in
#135438.

Co-authored-by: Copilot <[email protected]>
@pavelsavara pavelsavara changed the title [release/11.0] [mono][aot] Fix stack overflow normalizing self-referencing struct wrappers [release/11.0] [mono][aot] Fix recursive struct wrapper normalization Oct 8, 2026
@ViveliDuCh

Copy link
Copy Markdown
Member

Hi,

the code complete date for GA is Monday 19th October. Make sure to merge this PR on that date at the latest, or it won't make it into that release.

As a reminder, if this is a product change, you also need Tactics approval before merging this PR (test-only or infra-only changes don't require Tactics approval).

Happy to help with the merge if needed!

@pavelsavara

Copy link
Copy Markdown
Member

The tests introduced by this PR are failing - #135348 . The fix for these failures should be included in this PR.

Done

@pavelsavara
pavelsavara marked this pull request as ready for review October 21, 2026 10:17
@pavelsavara pavelsavara added the Servicing-consider Issue for next servicing release review label Oct 26, 2026
@pavelsavara

Copy link
Copy Markdown
Member

The new automated test passed on CI.
image

@kotlarmilos kotlarmilos removed the Servicing-consider Issue for next servicing release review label Oct 26, 2026
@kotlarmilos kotlarmilos added the Servicing-approved Approved for servicing release label Oct 26, 2026
@ViveliDuCh

ViveliDuCh commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Hi,

the code complete date for 11.0.1 (the December 2026 release) is Monday 16 November. Make sure to merge this PR on that date at the latest, or it won't make it into that release.

As a reminder, if this is a product change, you also need Tactics approval before merging this PR (test-only or infra-only changes don't require Tactics approval).

Happy to help with the merge if needed (please, make sure CI is green).

@akoeplinger

Copy link
Copy Markdown
Member

/ba-g unrelated Mutex test failures

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

Labels

arch-wasm WebAssembly architecture area-System.Numerics Servicing-approved Approved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants