Conversation
`Thread.FastPollGC()` (inlined from `Buffer.BulkMoveWithWriteBarrier`) can land in the block that terminates an EH region. `fgInsertGCPolls` asserted that such a block was one of the kinds the inline poll expansion knows how to split, so e.g. a `Span<object>.CopyTo` at the end of a `finally` or `catch` tripped 'block->KindIs(BBJ_RETURN, BBJ_ALWAYS, BBJ_COND, BBJ_SWITCH, BBJ_THROW, BBJ_CALLFINALLY)' (and would have hit a `NO_WAY` in release). An inline poll splits the block and `fgCreateGCPoll` only knows how to move the outgoing flow of the kinds above onto the new bottom block, so select a call poll for blocks with `hasEHBoundaryOut()`, just like we already do for switches. The call poll path already handles those blocks correctly. Fixes dotnet#134005 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 5 pipeline(s). 11 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The JIT control-flow change at EH boundaries warrants final human review.
Pull request overview
Fixes JIT GC poll insertion for blocks ending EH regions by routing them through call polls, with regression coverage for finally and catch cases.
Changes:
- Selects call GC polls for EH-boundary blocks.
- Adds
Runtime_134005regression coverage.
File summaries
| File | Summary |
|---|---|
src/tests/JIT/Regression_ro_2/Runtime_134005.cs |
Tests the reported finally and catch scenarios. |
src/coreclr/jit/flowgraph.cpp |
Routes EH-boundary blocks to call GC polls. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
Member
Author
|
PTAL @AndyAyersMS @dotnet/jit-contrib simple fix, no diffs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thread.FastPollGC()(inlined fromBuffer.BulkMoveWithWriteBarrier) can land in the block that terminates an EH region.fgInsertGCPollsasserted that such a block was one of the kinds the inline poll expansion knows how to split, so e.g. aSpan<object>.CopyToat the end of afinallyorcatchtripped 'block->KindIs(BBJ_RETURN, BBJ_ALWAYS, BBJ_COND, BBJ_SWITCH, BBJ_THROW, BBJ_CALLFINALLY)' (and would have hit aNO_WAYin release).An inline poll splits the block and
fgCreateGCPollonly knows how to move the outgoing flow of the kinds above onto the new bottom block, so select a call poll for blocks withhasEHBoundaryOut(), just like we already do for switches. The call poll path already handles those blocks correctly.Fixes #134005
No diffs