Skip to content

[release/6.0] [mono][interp] Add unbox when calling valuetype method through delegate - #79819

Merged
carlossanlop merged 3 commits into
dotnet:release/6.0from
BrzVlad:backport-interp-virt-delegate-6.0
Jan 5, 2023
Merged

[release/6.0] [mono][interp] Add unbox when calling valuetype method through delegate#79819
carlossanlop merged 3 commits into
dotnet:release/6.0from
BrzVlad:backport-interp-virt-delegate-6.0

Conversation

@BrzVlad

Copy link
Copy Markdown
Member

If we are calling an open instance delegate, where the target method is on a valuetype, we will need to unbox this pointer.

Backport of #79445

Fixes#79354

Customer Impact

MAUI iOS applications making use of the popular AutoMapper NuGet library can crash in debug builds. Workaround is to disable mono interpreter and implicitly hot reload. Other platforms using interpreter, like blazor wasm, can potentially hit this issue even in Release.

Testing

Verified fix on sample app provided in the bug report and created a simple test case that is included in our suite.

Risk

Low. The fix only touches the code path for a very specific type of delegate invocation pattern which was previously handled incorrectly before.

If we are calling an open instance delegate, where the target method is on a valuetype, we will need to unbox this pointer.
@BrzVladBrzVlad added Servicing-consider Issue for next servicing release review area-Codegen-Interpreter-mono labels Dec 19, 2022
@BrzVlad
BrzVlad requested a review from vargaz as a code ownerDecember 19, 2022 14:47
@ghost

Copy link
Copy Markdown

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

Issue Details

If we are calling an open instance delegate, where the target method is on a valuetype, we will need to unbox this pointer.

Backport of #79445

Fixes #79354

Customer Impact

MAUI iOS applications making use of the popular AutoMapper NuGet library can crash in debug builds. Workaround is to disable mono interpreter and implicitly hot reload. Other platforms using interpreter, like blazor wasm, can potentially hit this issue even in Release.

Testing

Verified fix on sample app provided in the bug report and created a simple test case that is included in our suite.

Risk

Low. The fix only touches the code path for a very specific type of delegate invocation pattern which was previously handled incorrectly before.

Author:BrzVlad
Assignees:-
Labels:

Servicing-consider, area-Codegen-Interpreter-mono

Milestone:-

@ghostghost assigned BrzVladDec 19, 2022
@SamMonoRTSamMonoRT added this to the 6.0.x milestone Dec 19, 2022
@SamMonoRTSamMonoRT added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Dec 19, 2022
@SamMonoRT

Copy link
Copy Markdown
Member

/cc @carlossanlop - approved via Tactics email. @BrzVlad - please confirm CI failures are not related. Thanks.

@BrzVlad

Copy link
Copy Markdown
MemberAuthor

The failures don't look related and I see them also on other PRs so this is good

@carlossanlopcarlossanlop modified the milestones: 6.0.x, 6.0.14Jan 5, 2023
@carlossanlop

Copy link
Copy Markdown
Contributor

Approved by Tactics (6.0.14).
Signed off by area owners.
No OOB changes needed.
CI failures investigated as unrelated.
Ready to merge. :shipit:

@carlossanlop
carlossanlop merged commit 81cb2af into dotnet:release/6.0Jan 5, 2023
@ghostghost locked as resolved and limited conversation to collaborators Feb 5, 2023
Sign up for freeto 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.

4 participants

@BrzVlad@SamMonoRT@carlossanlop@vargaz