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

[release/8.0-staging] [mono][interp] Fix execution of delegate invoke wrapper with interpreter #112008

Open
wants to merge 1 commit into
base: release/8.0-staging
Choose a base branch
from

Conversation

BrzVlad
Copy link
Member

@BrzVlad BrzVlad commented Jan 30, 2025

Backport of #111310 to release/8.0-staging

/cc @BrzVlad

Customer Impact

This issue was customer reported #110995. It impacts customers using reflection to obtain the value of a virtual property, on iOS. This reflection capability requires fallback to interpreter, where the app crash occurs in this scenario.

Regression

This is a regression introduced in .NET8. The runtime bug causing the crash was introduced in #83461, but it seems there might have been additional changes leading to the crash actually reproducing to customers.

Testing

The fix was verified on the customer provided sample application. CI testing confirmed that JIT/AOT paths haven't been impacted.

Risk

Low risk. This commit contains a change to the IL code of a specific delegate invoke wrapper. For the interpreter, the previous path was crashing every time, so this fix can only make things better. For the rest of the execution engines (jit/aot) the change represents a minimal refactoring that shouldn't have any side effects.

Copy link
Contributor

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

…ter (dotnet#111310)

The wrapper was relatively recently changed to icall into mono_get_addr_compiled_method in order to obtain a native function pointer to call using calli. This is incorrect on interpreter where we expect an `InterpMethod*`. This commit adds a new opcode instead, that on jit it goes through the same icall path, while on interpeter in similarly computes the appropiate method to call.

On a separate track, it might be useful to investigate whether the necessary delegate invoke wrapper should have been present in the aot image and not be executed with the interpreter in the first place.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Codegen-Interpreter-mono Servicing-consider Issue for next servicing release review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant