Skip to content

[mono] Handle Assert failure when GetDelegateForFunctionPointer is invoked with VoidDelegate type - #79530

Closed
giritrivedi wants to merge 2 commits into
dotnet:mainfrom
giritrivedi:S390x_GetDelegate_Invoke_Assert_Fix
Closed

giritrivedi wants to merge 2 commits into
dotnet:mainfrom
giritrivedi:S390x_GetDelegate_Invoke_Assert_Fix

Conversation

@giritrivedi

@giritrivedi giritrivedi commented Dec 12, 2022 •

Copy link
Copy Markdown
Contributor

RunGetDelForFcnPtrTest is checking if "Invoke" Method is invoked when "GetDelegateForFunctionPointer" is passed
"VoidDelegate". In mono runtime instead of "Invoke" method, "wrapper_native_**" is invoked. The suffix of
"Wrapper_native" keeps changing with every run. With this fix "Invoke" method is returned instead of "wrapper_native_
"

is invoked with VoidDelegate type

RunGetDelForFcnPtrTest is checking if "Invoke" Method is invoked when
"GetDelegateForFunctionPointer" is passed "VoidDelegate".In mono runtime
instead of "Invoke" method, "wrapper_native_0x3ff9fe806a0" in invoked.
The suffix of "Wrapper_native" keeps changing with every run.Hence an
assert.startswith () is invoked to ensure the method name starts with
"wrapper_native".
@giritrivedi

Copy link
Copy Markdown
Contributor Author

Hi @vargaz , @thaystg , @lambdageek
Can someone review this?

@vargaz

vargaz commented Jan 11, 2023

Copy link
Copy Markdown
Contributor

This might be a mono bug, these wrapper_native_ methods should not bubble up to app code.

@giritrivedi

Copy link
Copy Markdown
Contributor Author

Yes, this is. The issue is seen on s390X architecture.
Do I need to add any specific tag to the issue or to the description in order to mark it as mono bug ?

@vargaz

vargaz commented Jan 12, 2023

Copy link
Copy Markdown
Contributor

There are mono specific labels.

…oked with VoidDelegate type.

RunGetDelForFcnPtrTest is checking if "Invoke" Method is invoked when "GetDelegateForFunctionPointer" is passed
"VoidDelegate". In mono runtime instead of "Invoke" method, "wrapper_native_***" is invoked. The suffix of
"Wrapper_native" keeps changing with every run. With this fix "Invoke" method is returned instead of "wrapper_native_*"
@giritrivedi giritrivedi changed the title Handle Assert failure when GetDelegateForFunctionPointer is invoked with VoidDelegate type [mono] Handle Assert failure when GetDelegateForFunctionPointer is invoked with VoidDelegate type Jan 27, 2023
@giritrivedi

Copy link
Copy Markdown
Contributor Author

@vargaz , I have submitted a new fix . Plz reviews.

@vargaz

vargaz commented Feb 7, 2023

Copy link
Copy Markdown
Contributor

Still don't think this is the right fix, these wrapper methods created in marshal.c should not be visible to managed code and should not appear in managed stack traces.

@marek-safar marek-safar added the needs-author-action An issue or pull request that requires more info or actions from the author. label Apr 24, 2023
@giritrivedi

Copy link
Copy Markdown
Contributor Author

@dotnet-policy-service agree company="IBM"

@ghost ghost removed the needs-author-action An issue or pull request that requires more info or actions from the author. label Apr 24, 2023
@akoeplinger akoeplinger added the needs-author-action An issue or pull request that requires more info or actions from the author. label Nov 27, 2023
@ghost ghost added the no-recent-activity label Dec 11, 2023
@ghost

ghost commented Dec 11, 2023

Copy link
Copy Markdown

This pull request has been automatically marked no-recent-activity because it has not had any activity for 14 days. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will remove no-recent-activity.

@ghost

ghost commented Dec 25, 2023

Copy link
Copy Markdown

This pull request will now be closed since it had been marked no-recent-activity but received no further activity in the past 14 days. It is still possible to reopen or comment on the pull request, but please note that it will be locked if it remains inactive for another 30 days.

@ghost ghost closed this Dec 25, 2023
@github-actions github-actions Bot locked and limited conversation to collaborators Jan 25, 2024
@giritrivedi
giritrivedi deleted the S390x_GetDelegate_Invoke_Assert_Fix branch June 24, 2024 12:44
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-Codegen-JIT-mono community-contribution Indicates that the PR has been added by a community member needs-author-action An issue or pull request that requires more info or actions from the author. no-recent-activity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants