Skip to content
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

Ensure that a native code version only ever gets one entry point that doesn't change #94542

Merged
merged 1 commit into from
Nov 9, 2023

Conversation

kouvel
Copy link
Member

@kouvel kouvel commented Nov 8, 2023

  • Fixed MethodDesc::SetNativeCodeInterlocked to use the passed-in expected entry point instead of the current entry point. It seems this is how it used to work before Remove PlainPointer, RelativePointer and RelativeFixupPointer #57707.
  • It's possible for a method to get jitted multiple times on the same thread due to reentry through class construction. Once a native code version is updated with an entry point, it can run and there are times when it's necessary to look up the native code version corresponding to the currently running code, such as when installing patchpoints. That would be impossible if the entry point is changed meanwhile to a different entry point.

Fixes #93849

… doesn't change

- Fixed `MethodDesc::SetNativeCodeInterlocked` to use the passed-in expected entry point instead of the current entry point. It seems this is how it used to work before dotnet#57707.
- It's possible for a method to get jitted multiple times on the same thread due to reentry through class construction. Once a native code version is updated with an entry point, it can run and there are times when it's necessary to look up the native code version corresponding to the currently running code, such as when installing patchpoints. That would be impossible if the entry point is changed meanwhile to a different entry point.

Fixes dotnet#93849
@kouvel
Copy link
Member Author

kouvel commented Nov 9, 2023

Thanks! Looks like the remaining issues in the CI are known issues.

@kouvel kouvel merged commit 8c02b08 into dotnet:main Nov 9, 2023
107 of 111 checks passed
@kouvel kouvel deleted the CvFix branch November 9, 2023 18:29
@github-actions github-actions bot locked and limited conversation to collaborators Dec 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[libraries-pgo] System.Tests.AppDomainTests.AssemblyLoad fails under jitosr_stress_random
2 participants