Skip to content

Conversation

tommcdon
Copy link
Member

@tommcdon tommcdon commented Aug 6, 2025

Internal Visual Studio diagnostic testing caught an issue related to ICorProfiler rejit changing the callsite of a method in a different assembly can result in a BadFormatException. Regressed by #118318

@tommcdon tommcdon added this to the 10.0.0 milestone Aug 6, 2025
@tommcdon tommcdon requested a review from jkotas August 6, 2025 21:14
@tommcdon tommcdon self-assigned this Aug 6, 2025
@Copilot Copilot AI review requested due to automatic review settings August 6, 2025 21:14
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a BadFormatException that occurs when using ICorProfiler rejit to change the callset of a method in a different assembly. The issue was introduced by a previous change (#118318) and affects the MethodDesc::GetILHeader method in the CoreCLR runtime.

Key Changes:

  • Reorders the RVA (Relative Virtual Address) validation check to occur after attempting to retrieve dynamic IL
  • Ensures dynamic IL overrides are always checked before falling back to the original IL, even when RVA is 0

Copy link
Contributor

Tagging subscribers to this area: @steveisok, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.

@jkotas
Copy link
Member

jkotas commented Aug 6, 2025

ICorProfiler rejit changing the callset of a method in a different

What's a callset of a method?

@tommcdon
Copy link
Member Author

tommcdon commented Aug 6, 2025

ICorProfiler rejit changing the callset of a method in a different

What's a callset of a method?

That's a typo - it should be callsite not callset.

@tommcdon tommcdon merged commit f868efe into dotnet:main Aug 7, 2025
92 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Sep 7, 2025
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.

3 participants