Skip to content

[release/10.0] Fix CLR->COM RCW ownership tracking on the slow path#126757

Merged
agocke merged 3 commits intorelease/10.0from
backport/pr-126731-to-release/10.0
Apr 11, 2026
Merged

[release/10.0] Fix CLR->COM RCW ownership tracking on the slow path#126757
agocke merged 3 commits intorelease/10.0from
backport/pr-126731-to-release/10.0

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot commented Apr 10, 2026

Backport of #126731 to release/10.0

/cc @AaronRobinsonMSFT

Customer Impact

  • Customer reported
  • Found internally

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

  • Yes
  • No

This was introduced in #114609. That work was apart of the removal of HELPER_METHOD_FRAME completed 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_FRAME removal.

AaronRobinsonMSFT and others added 2 commits April 10, 2026 17:56
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>
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

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

Co-authored-by: Aaron R Robinson <arobins@microsoft.com>
@JulieLeeMSFT JulieLeeMSFT added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Apr 10, 2026
@AaronRobinsonMSFT
Copy link
Copy Markdown
Member

AaronRobinsonMSFT commented Apr 10, 2026

@JulieLeeMSFT I'm not allowed to merge. CI is green (unrelated failures) and I have two reviews.

@agocke
Copy link
Copy Markdown
Member

agocke commented Apr 11, 2026

/ba-g all failures known

@agocke agocke merged commit 76ca66e into release/10.0 Apr 11, 2026
111 of 114 checks passed
@agocke agocke deleted the backport/pr-126731-to-release/10.0 branch April 11, 2026 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants