Skip to content

Fix OOM message in Native AOT#129256

Merged
eduardo-vp merged 2 commits into
dotnet:mainfrom
eduardo-vp:naot-OOM-message
Jun 17, 2026
Merged

Fix OOM message in Native AOT#129256
eduardo-vp merged 2 commits into
dotnet:mainfrom
eduardo-vp:naot-OOM-message

Conversation

@eduardo-vp

Copy link
Copy Markdown
Member

Fall back to a string literal when process finishes with an out of memory exception.

Fixes #129209.

Copilot AI review requested due to automatic review settings June 10, 2026 19:06

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.

Pull request overview

This PR improves NativeAOT fail-fast diagnostics for out-of-memory scenarios by ensuring stderr contains a reliable OOM token even when Exception.ToString() cannot be produced (e.g., due to OOM/initialization constraints), which unblocks the baseservices/exceptions/OutOfMemoryException test expectation.

Changes:

  • In RuntimeExceptionHelpers.FailFast, when printing exception.ToString() throws, special-case OutOfMemoryException to emit the allocation-free literal "Out of memory." instead of attempting to print the exception type name.
  • Update the nearby comment to reflect the simpler fallback behavior.

@eduardo-vp

Copy link
Copy Markdown
Member Author

/azp run runtime-nativeaot-outerloop

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@eduardo-vp

Copy link
Copy Markdown
Member Author

/azp run runtime-nativeaot-outerloop

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@eduardo-vp

Copy link
Copy Markdown
Member Author

/ba-g timeouts only

@eduardo-vp eduardo-vp merged commit 631b884 into dotnet:main Jun 17, 2026
129 of 137 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview6 milestone Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ci-scan] Test failure: OutOfMemoryException.cmd on NativeAOT CET/CFG

3 participants