Skip to content

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Nov 4, 2024

Backport of #109381 to release/9.0-staging

/cc @steveisok

Customer Impact

  • Customer reported
  • Found internally

A customer was experiencing intermittent crashes with their android app around mono_method_to_ir. After testing multiple iterations, we found there were times when calls to try_prepare_objaddr_callvirt_optimization contained a null reference to a MonoClass. As a result, the app would crash.

To fix, we made a call to mono_class_from_mono_type_internal to make sure we would get a legit MonoClass.

Regression

  • Yes
  • No

[If yes, specify when the regression was introduced. Provide the PR or commit if known.]

Testing

Manual before and after. After app did not crash.

Risk

Low

IMPORTANT: If this backport is for a servicing release, please verify that:

  • The PR target branch is release/X.0-staging, not release/X.0.

  • If the change touches code that ships in a NuGet package, you have added the necessary package authoring and gotten it explicitly reviewed.

There exists a possibility where the klass being passed to try_prepare_objaddr_callvirt_optimization is not legit. This can result
in unpredictable crashes.

To fix, we pass the MonoType and flush out the MonoClass by calling mono_class_from_mono_type_internal.

Fixes #109111
Copy link
Contributor

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

@steveisok steveisok added the Servicing-consider Issue for next servicing release review label Nov 5, 2024
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

@steveisok
Copy link
Member

/ba-g Known infra related errors

@steveisok steveisok merged commit 29eae42 into release/9.0-staging Nov 11, 2024
75 of 84 checks passed
@steveisok steveisok deleted the backport/pr-109381-to-release/9.0-staging branch November 11, 2024 15:46
@carlossanlop carlossanlop modified the milestones: 9.0.1, 9.0.2 Nov 21, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Dec 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-Codegen-JIT-mono Servicing-approved Approved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants