-
Notifications
You must be signed in to change notification settings - Fork 5k
[release/8.0-staging] [mono][interp] Fix execution of delegate invoke wrapper with interpreter #112008
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
Conversation
Tagging subscribers to this area: @BrzVlad, @kotlarmilos |
…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.
5e902bc
to
0d48811
Compare
Hi @BrzVlad @steveisok :) Has this been released with the latest service release? It doesn't seem to be in the release notes: |
@BrzVlad @steveisok @jeffschwMSFT @vitek-karas We will appreciate any update on this. |
@shnaz this will be in 8.0.15. I'll own this one. We have a certain window each month to get servicing changes in. This could have made 8.0.14 and I unfortunately spotted it approved but not merged too late. I'll work to make sure that doesn't happen generally moving forward. |
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.