Skip to content

Conversation

@jakobbotsch
Copy link
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
Copy link
Contributor

Copilot AI left a comment

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
Member Author

PTAL @dotnet/jit-contrib

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

VSadov commented Nov 12, 2025

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

@jakobbotsch
Copy link
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
Copy link
Member

VSadov commented Nov 12, 2025

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
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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.

3 participants