Skip to content

[release/11.0] JIT: Clear GC poll flags when converting unreachable blocks to throws - #138554

Open
EgorBo wants to merge 1 commit into
dotnet:release/11.0from
EgorBo:backport-136260-release-11.0
Open

EgorBo wants to merge 1 commit into
dotnet:release/11.0from
EgorBo:backport-136260-release-11.0

Conversation

@EgorBo

@EgorBo EgorBo commented Nov 30, 2026

Copy link
Copy Markdown
Member

Fixes Issue #136255

main PR #136260

Description

Backport of #136260 to release/11.0. fgRemoveUnreachableBlocks converts unreachable BBF_DONT_REMOVE blocks to throws but kept BBF_NEEDS_GCPOLL. fgCreateGCPoll then dereferenced a null statement. The fix clears the GC poll flags when the block's code is removed.

Customer Impact

  • Customer reported
  • Found internally

The JIT crashes (SIGSEGV) while recompiling a method at tier 1 with dynamic PGO, and the process dies.

Regression

  • Yes
  • No

Reported on 11.0 RC2. Not reproducible on .NET 10.

Testing

No regression test (the main PR has none).

Risk

Low. One-line fix, no diffs in main.

Note

PR description generated with GitHub Copilot.

…dotnet#136260)

Fixes dotnet#136255

`fgRemoveUnreachableBlocks` empties unreachable `BBF_DONT_REMOVE` blocks
and converts them to `BBJ_THROW`, but kept `BBF_NEEDS_GCPOLL` (here from
an inlined `Thread.FastPollGC()` that was compacted into a cloned
try-entry block, which RBO later made unreachable). `fgInsertGCPolls`
then tried to insert an inline poll into the empty throw block, and
`fgCreateGCPoll` dereferenced a null statement while moving the "last"
statement into the bottom block.

The fix clears the GC poll flags when the block's code is removed.

[No
diffs](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1644700&view=ms.vss-build-web.run-extensions-tab)

Copilot-Session: 03b08106-36f9-48c0-9efb-d9e33ca7965c
(cherry picked from commit a99fb4b)
@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 30, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

@EgorBo
EgorBo requested a review from adamperlin November 30, 2026 22:49

This branch has not been deployed

No deployments
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.

2 participants