Skip to content

Conversation

@AaronRobinsonMSFT
Copy link
Member

@AaronRobinsonMSFT AaronRobinsonMSFT commented Aug 31, 2021

Fixes microsoft/CsWinRT#840

Customer Impact

Based on misunderstanding of SyncBlock clean-up modes the indication of when an Native Object Wrapper was being collected was being done after the wrapper's Finalizer was run. However, this information must be conveyed prior to wrapper finalization and synchronously during the GC. See IReferenceTracker::DisconnectFromTrackerSource.

Workaround

There are no workarounds for this issue.

Testing

Added a tests. Have provided private binaries to C#/WinRT team for validation.

Risk

Minimal. .NET 5 is the first release of ComWrappers and this issue only impacts WinRT scenarios.


/cc @davidwrighton @jkoritzinsky @elinor-fung

Based on misunderstanding of SyncBlock clean-up modes the indication of
when an Native Object Wrapper was being collected was being done after
the wrapper's Finalizer was run. However, this information must be conveyed
prior to wrapper finalization and synchronously during the GC.
@AaronRobinsonMSFT AaronRobinsonMSFT added Servicing-consider Issue for next servicing release review area-Interop-coreclr labels Aug 31, 2021
Copy link
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

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

Approved. Please get a code review and we can take for consideration for 5.0.x.

@jeffschwMSFT jeffschwMSFT added this to the 5.0.x milestone Aug 31, 2021
Copy link
Member

@elinor-fung elinor-fung left a comment

Choose a reason for hiding this comment

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

My comments are minor things for when this goes to 7.0 - not so much for 5.0

@AaronRobinsonMSFT
Copy link
Member Author

My comments are minor things for when this goes to 7.0 - not so much for 5.0

There is no .NET 7 PR yet, but I will fold this feedback into that when it is opened.

@AaronRobinsonMSFT AaronRobinsonMSFT changed the title Notify Reference Tracker runtime of disconnect at the right time [.NET 5.0] Notify Reference Tracker runtime of disconnect at the right time Aug 31, 2021
Copy link
Member

@davidwrighton davidwrighton left a comment

Choose a reason for hiding this comment

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

:shipit:

@leecow leecow added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Sep 2, 2021
@leecow leecow modified the milestones: 5.0.x, 5.0.11 Sep 2, 2021
@AaronRobinsonMSFT AaronRobinsonMSFT changed the title [.NET 5.0] Notify Reference Tracker runtime of disconnect at the right time [release/5.0] Notify Reference Tracker runtime of disconnect at the right time Sep 3, 2021
@Anipik Anipik merged commit 7535d15 into dotnet:release/5.0 Sep 13, 2021
@Marv51
Copy link
Contributor

Marv51 commented Sep 13, 2021

Is there a reason this was scheduled for 5.0.11 and not the next update? I guess 5.0.11 could be roughly expected in the middle of October, right?

@leecow

@AaronRobinsonMSFT AaronRobinsonMSFT deleted the reftracker_disconnect_semantic branch September 13, 2021 20:58
@AaronRobinsonMSFT
Copy link
Member Author

@Marv51 Yes, this is for the October update. Unfortunately we missed the 5.0.10 release snap so this was pushed to the next service release.

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

Labels

area-Interop-coreclr Servicing-approved Approved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants