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] [mono][interp] Keep delegate alive during invocation #102159

Merged
merged 1 commit into from
May 29, 2024

Conversation

BrzVlad
Copy link
Member

@BrzVlad BrzVlad commented May 13, 2024

When invoking a delegate, we were overwritting the stack slot containing the delegate object reference. In the case of invoking a delegate for a dynamic method, we were running into issues when the delegate object is collected while the method is executed because the method code is also discarded.

Backport of #100832 to release/8.0-staging

Customer Impact

Invoking a delegate for a dynamic method was potentially broken in interpreter because the method could end up being collected during execution. While this bug shouldn't be a regression from .net7, it started showing up relatively recently in various test suites, maybe caused by upgrades to toolchain/system. #101831, likely #101988

Testing

Over one month of testing on our CI without any problems

Risk

Low

When invoking a delegate, we were overwritting the stack slot containing the delegate object reference. In the case of invoking a delegate for a dynamic method, we were running into issues when the delegate object is collected while the method is executed because the method code is also discarded.
Copy link
Contributor

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

@BrzVlad BrzVlad requested a review from vitek-karas May 13, 2024 14:50
@BrzVlad BrzVlad added this to the 8.0.x milestone May 13, 2024
@BrzVlad BrzVlad changed the title [release/8.0-staging] [mono][interp] Keep delegate alive during invocation [release/8.0] [mono][interp] Keep delegate alive during invocation May 13, 2024
@lambdageek lambdageek requested a review from kg May 13, 2024 15:49
@lewing lewing added the Servicing-consider Issue for next servicing release review label May 13, 2024
@lewing lewing added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels May 22, 2024
@BrzVlad BrzVlad merged commit 7b08fa8 into dotnet:release/8.0-staging May 29, 2024
108 of 112 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jun 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants