Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[release/9.0-staging] NativeAOT/Arm64: Do not overwrite gcinfo tracking registers for TLS #112549

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Feb 14, 2025

Backport of #112469 to release/9.0-staging

/cc @kunalspathak

Customer Impact

  • Customer reported
  • Found internally

We were wrongly reporting certain registers has gc references which would lead the GC would interpret the values as them as valid object addresses and enumerate over them. This would lead to an undefined behavior or crash. Although it is a rare occurrence and certain events need to line up in place (method's register requirements in given method, trigger of GC at the instruction where wrong registers are tracked, etc.), it is still a potential issue because it can lead to fatal crash and diagnosing that crash would take an area expert (hard to root cause).

Regression

  • Yes
  • No

In #97910, we started inlining TLS access for NativeAOT for linux/arm64 and the issue was introduced since then.

Testing

The failing test was reverified and the asmdiffs were studied to make sure that we are reporting the gc references correctly.

Risk

Low. This optimization is present in our mainline for almost a year now and was found from our internal tool just recently.

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Feb 14, 2025
@kunalspathak
Copy link
Member

@dotnet/jit-contrib @jeffschwMSFT

Copy link
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

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

lgtm. we will take for consideration in 9.0.x

@jeffschwMSFT jeffschwMSFT added the Servicing-consider Issue for next servicing release review label Feb 14, 2025
@jeffschwMSFT jeffschwMSFT added this to the 9.0.x milestone Feb 14, 2025
@jeffschwMSFT jeffschwMSFT added Servicing-approved Approved for servicing release and removed area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI labels Feb 14, 2025
@jeffschwMSFT jeffschwMSFT modified the milestones: 9.0.x, 9.0.4 Feb 14, 2025
@jeffschwMSFT jeffschwMSFT added area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI and removed Servicing-consider Issue for next servicing release review labels Feb 18, 2025
Copy link
Contributor

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

@jeffschwMSFT
Copy link
Member

@kunalspathak please take a look at the PR failures. we can merge when ready

@kunalspathak
Copy link
Member

@jeffschwMSFT - this should be ready to merge. Thanks!

@jeffschwMSFT
Copy link
Member

go for it, I just hit the rebase button. the *-stagging branches are open to all committers to merge :)

@kunalspathak
Copy link
Member

@jeffschwMSFT - any idea how to make check-labels pass?

@jeffschwMSFT jeffschwMSFT merged commit 296586b into release/9.0-staging Mar 6, 2025
91 checks passed
@jeffschwMSFT
Copy link
Member

not sure everything looks in order, merged

@jkotas jkotas deleted the backport/pr-112469-to-release/9.0-staging branch March 16, 2025 05:28
@github-actions github-actions bot locked and limited conversation to collaborators Apr 15, 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 Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants