Skip to content

JIT: Fix another issue when optimizing out async calls late - #121550

Merged
jakobbotsch merged 1 commit into
dotnet:mainfrom
jakobbotsch:fix-no-resumption-table
Nov 13, 2025
Merged

jakobbotsch merged 1 commit into
dotnet:mainfrom
jakobbotsch:fix-no-resumption-table

Conversation

@jakobbotsch

Copy link
Copy Markdown
Member

genAsyncResumeInfoTable may be null if we optimize out all async calls, so handle this case too.

`genAsyncResumeInfoTable` may be null if we optimize out all async
calls, so handle this case too.
Copilot AI review requested due to automatic review settings November 12, 2025 14:09
@github-actions github-actions Bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Nov 12, 2025

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 fixes a potential null reference crash when async calls are optimized out late in the JIT compilation process. The issue occurs when compSuspensionPoints exists (created during early async transformation) but genAsyncResumeInfoTable remains null because all GT_RECORD_ASYNC_RESUME nodes were removed by late optimizations.

  • Removes an assertion that incorrectly assumed genAsyncResumeInfoTable would always be non-null
  • Adds null check before accessing genAsyncResumeInfoTable to prevent crashes
  • Sets diagnostic native offsets to 0 when async resume info table doesn't exist

@jakobbotsch

Copy link
Copy Markdown
Member Author

PTAL @dotnet/jit-contrib

@jakobbotsch
jakobbotsch requested a review from a team November 12, 2025 17:15
@VSadov

VSadov commented Nov 12, 2025 •

Copy link
Copy Markdown
Member

@jakobbotsch what are the typical symptoms of this bug? Is it a JIT-time crash or run time NRE?

@jakobbotsch

Copy link
Copy Markdown
Member Author

@jakobbotsch what are the typical symptoms of this bug? Is it a JIT-time crash or run time NRE?

In checked builds you would see assert, and in release builds like JIT-time crashes.

I found this issue via Fuzzlyn. It's probably unlikely any of our tests are hitting it.

@VSadov

VSadov commented Nov 12, 2025 •

Copy link
Copy Markdown
Member

I am looking at something that may be a Linux-specific GC hole. At least it has symptoms of a GC hole (a variable becomes null and causes NRE, but not always).

Sounds like it cannot be possibly related to this.

@jakobbotsch

Copy link
Copy Markdown
Member Author

/ba-g Timeouts

@jakobbotsch
jakobbotsch merged commit 87f60f1 into dotnet:main Nov 13, 2025
109 of 119 checks passed
@jakobbotsch
jakobbotsch deleted the fix-no-resumption-table branch November 13, 2025 12:44
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants