-
Notifications
You must be signed in to change notification settings - Fork 5.1k
[release/9.0-staging] [mono][interp] Fix execution of delegate invoke wrapper with interpreter #111700
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/9.0-staging] [mono][interp] Fix execution of delegate invoke wrapper with interpreter #111700
Conversation
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.
Tagging subscribers to this area: @BrzVlad, @kotlarmilos |
merge it? |
/ba-g BA showing all known test errors. |
@kotlarmilos @BrzVlad Hey, as was also written (but for 8.0.14) in #112008 (comment) I cannot see that this change is on the 9.0.3 release. Is this intentional? |
@carlossanlop Do you have more info on this ? |
This unfortunately got merged after the 9.0.3 window closed. It'll be in 9.0.4. |
@BrzVlad @steveisok Ah okay, that's unfortunate. Is that also the case for the 8.0.14 window? I.e. that it will come out with 8.0.15 instead? |
Yes, same case for 8.0.15. All servicing branches have the same code complete date. |
The efficiency is really too low, one and half month has passed and there is still no patch. |
Backport of #111310 to release/9.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.
Package authoring no longer needed in .NET 9
IMPORTANT: Starting with .NET 9, you no longer need to edit a NuGet package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older versions.