Skip to content

Conversation

@jakobbotsch
Copy link
Member

GC stress is red after 78ccdae due to a delegate not being kept alive.

cc @giritrivedi

GC stress is red after 78ccdae due to a
delegate not being kept alive.
Copy link
Member

@AaronRobinsonMSFT AaronRobinsonMSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is correct, but I don't really get what this is testing. I think it might make more sense to use function pointers and avoid the extra delegate entirely.

IntPtr ptr = (IntPtr)(delegate*<IntPtr*, void>)&FillOutPtr;
DelegateToFillOutPtr OutPtrDelegate = Marshal.GetDelegateForFunctionPointer<DelegateToFillOutPtr>(ptr);

@AaronRobinsonMSFT AaronRobinsonMSFT added area-System.Runtime.InteropServices test-bug Problem in test source code (most likely) and removed area-Interop-coreclr labels Jan 13, 2023
@AaronRobinsonMSFT AaronRobinsonMSFT added this to the 8.0.0 milestone Jan 13, 2023
@ghost
Copy link

ghost commented Jan 13, 2023

Tagging subscribers to this area: @dotnet/interop-contrib
See info in area-owners.md if you want to be subscribed.

Issue Details

GC stress is red after 78ccdae due to a delegate not being kept alive.

cc @giritrivedi

Author: jakobbotsch
Assignees: jakobbotsch
Labels:

area-System.Runtime.InteropServices, test-bug

Milestone: -

@jakobbotsch
Copy link
Member Author

I will merge this to unblock the pipelines, @giritrivedi can you follow up with @AaronRobinsonMSFT's feedback above next week?

@jakobbotsch jakobbotsch merged commit b23d261 into dotnet:main Jan 14, 2023
@jakobbotsch jakobbotsch deleted the fix-test-gchole branch January 14, 2023 18:51
@giritrivedi
Copy link
Contributor

@jakobbotsch Thanks for taking care of the issue.
@AaronRobinsonMSFT This is a supporting UT added to fix a crash when out parameter of type Intptr* is passed to delegate.
For more details plz check
#79763

@ghost ghost locked as resolved and limited conversation to collaborators Feb 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Runtime.InteropServices test-bug Problem in test source code (most likely)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants