Skip to content

Conversation

filipnavara
Copy link
Member

Contributes to #113985

#113985 (comment) identified an issue where GC info is not correctly recorded for inline jumps to finally blocks. It shows up in GC stress testing. This issue already exists on NativeAOT on win-x86 but we didn't have sufficient coverage to identify it.

For fully interruptible methods we can now encode a table in the x86 GC info that describes the no-GC regions as pair of (offset, size) tuples. The presence of the table is indicated by a new header opcode (SET_NOGCREGIONS_CNT + count for count >= 0 && count <= 4 or FFFF_NOGCREGION_CNT and extra count field after the header).

@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 May 15, 2025
@filipnavara filipnavara requested review from jkotas, davidwrighton and a team May 15, 2025 05:43
@filipnavara
Copy link
Member Author

cc @dotnet/dotnet-diag If this gets approved the shared files for GC info parsing and dumping will need to be synced to the dotnet/diagnostics repo.

@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label May 15, 2025
{
// TODO-Linux-x86: Do we need to handle the GC information for this NOP or JMP specially, as is done for other
// architectures?
#ifndef JIT32_GCENCODER
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ This is the primary issue addressed by this PR

@filipnavara filipnavara requested a review from a team May 15, 2025 06:18
@jkotas
Copy link
Member

jkotas commented May 15, 2025

/azp run runtime-coreclr gcstress0x3-gcstress0xc

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@filipnavara
Copy link
Member Author

filipnavara commented May 15, 2025

/azp run runtime-coreclr gcstress0x3-gcstress0xc

I don't expect this to reveal anything. It's now a strictly zero-diff change with x86 funclets disabled. May be worth running the same check on #113576 which has essentially the same commit applied with x86 funclets enabled (- the disabled cpObj optimization).

(In fact, give me a sec, I'll push the exact same change there... and DONE.)

@jkotas
Copy link
Member

jkotas commented May 15, 2025

I don't expect this to reveal anything.

Right, I just want to make sure that there is nothing subtle broken in the x86 GC encoder/decoder.

@davidwrighton
Copy link
Member

I've taken a pass through this and it looks good, although I haven't looked at the test failures to see if they are related.

@filipnavara
Copy link
Member Author

filipnavara commented May 15, 2025

I haven't looked at the test failures to see if they are related.

The osx failure is unrelated. I will check the GC stress failures tomorrow. I believe I have previously seen them and there's one issue filed for x86 unwinding (broken by async2 codegen change using a slightly different pattern in few epilogs).

@filipnavara
Copy link
Member Author

The two x86 GC stress failures are indeed instances of #115120.

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@jkotas
Copy link
Member

jkotas commented May 16, 2025

/ba-g intermittent nuget restore failure in unrelated leg

@jkotas jkotas merged commit b8752af into dotnet:main May 16, 2025
117 of 123 checks passed
@jkotas
Copy link
Member

jkotas commented May 16, 2025

If this gets approved the shared files for GC info parsing and dumping will need to be synced to the dotnet/diagnostics repo.

Could you please send matching update PR to the diagnostics repo?

@filipnavara
Copy link
Member Author

Could you please send matching update PR to the diagnostics repo?

Of course.

@filipnavara filipnavara deleted the nogcregions-x86 branch June 5, 2025 06:44
@github-actions github-actions bot locked and limited conversation to collaborators Jul 5, 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 community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants