Skip to content

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Aug 28, 2025

Backport of #119167 to release/10.0

/cc @jkotas

Customer Impact

  • Customer reported
  • Found internally

Throwing and catching exceptions in a loop consumes shadow stack memory, and eventually leads to stack overflow exception (after about 100,000 exceptions thrown and caught with default stack size). Windows 11 and Native AOT specific bug.

Regression

  • Yes
  • No

Regression .NET 8 -> .NET 9 regression introduced by CET support

Testing

Native AOT outer loop, re-enabled test disabled due to this bug

Risk

[High/Medium/Low. Justify the indication by mentioning how risks were measured and addressed.]

IMPORTANT: If this backport is for a servicing release, please verify that:

  • The PR target branch is release/X.0-staging, not release/X.0.

Package authoring no longer needed in .NET 9

IMPORTANT: Starting with .NET 9, you no longer need to edit a NuGet package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older versions.

This fixes unbounded shadow stack growth that leads to stack overflow
exception when exceptions are thrown and caught in a loop.

Fixes #118913
Fixes #107418
@jkotas jkotas requested a review from janvorli August 28, 2025 21:19
Copy link
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

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

approved. please get a code review. we can merge when ready

@jeffschwMSFT jeffschwMSFT added the Servicing-approved Approved for servicing release label Aug 29, 2025
@jeffschwMSFT jeffschwMSFT added this to the 10.0.0 milestone Aug 29, 2025
@dotnet-policy-service
Copy link
Contributor

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

@jeffschwMSFT jeffschwMSFT merged commit cdfae41 into release/10.0 Aug 29, 2025
109 of 113 checks passed
@jkotas jkotas deleted the backport/pr-119167-to-release/10.0 branch August 29, 2025 18:25
@github-actions github-actions bot locked and limited conversation to collaborators Sep 29, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-NativeAOT-coreclr Servicing-approved Approved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants