[release/10.0] Fix CLR->COM RCW ownership tracking on the slow path#126757
Merged
agocke merged 3 commits intorelease/10.0from Apr 11, 2026
Merged
[release/10.0] Fix CLR->COM RCW ownership tracking on the slow path#126757agocke merged 3 commits intorelease/10.0from
agocke merged 3 commits intorelease/10.0from
Conversation
Have the slow GetCOMIPFromRCW helper report whether the returned interface pointer actually requires cleanup, so RCW cache hits after OLE TLS initialization are not released as if they were freshly acquired.\n\nFixes #126619\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Extend TrackMyLifetimeTesting with a simple Method() call and add a native-thread callback test that exercises the agile RCW path covered by #126619. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
Tagging subscribers to this area: @dotnet/interop-contrib |
jkoritzinsky
approved these changes
Apr 10, 2026
Co-authored-by: Aaron R Robinson <arobins@microsoft.com>
elinor-fung
approved these changes
Apr 10, 2026
This was referenced Apr 10, 2026
Member
|
@JulieLeeMSFT I'm not allowed to merge. CI is green (unrelated failures) and I have two reviews. |
Member
|
/ba-g all failures known |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #126731 to release/10.0
/cc @AaronRobinsonMSFT
Customer Impact
This causes issues with COM object lifetime management. It is a real issue with COM interop and will impact anyone using COM interop from an unmanaged thread. User reported issue can be found at #126619.
Regression
This was introduced in #114609. That work was apart of the removal of
HELPER_METHOD_FRAMEcompleted in .NET 10 - #95695.Testing
A test has been added to ensure this particular issue won't crop up again and adds more coverage to built-in COM interop support.
Risk
Low. This is addressing a real regression and putting back the logic to what is was prior to work done around
HELPER_METHOD_FRAMEremoval.