Skip to content

Partially revert PR #125326: revert ComActivator/LicenseInteropProxy changes#125706

Merged
jkotas merged 3 commits intomainfrom
copilot/fix-netclientlicense-test-failures
Mar 19, 2026
Merged

Partially revert PR #125326: revert ComActivator/LicenseInteropProxy changes#125706
jkotas merged 3 commits intomainfrom
copilot/fix-netclientlicense-test-failures

Conversation

Copy link
Contributor

Copilot AI commented Mar 18, 2026

PR #125326 converted LicenseInteropProxy call sites to use [UnmanagedCallersOnly] with raw managed object pointers (object*, Type*, LicenseInteropProxy*). Under GC stress, it is causing heap corruption (exit code -1073740940 / STATUS_HEAP_CORRUPTION).

Fixes #125598

…changes

The [UnmanagedCallersOnly] approach for LicenseInteropProxy was causing heap corruption (STATUS_HEAP_CORRUPTION) under GC stress scenarios. Revert to the original MethodDescCallSite-based approach.

Changes:
- ComActivator.cs: Restore public static object Create() and remove the unsafe [UnmanagedCallersOnly] static methods for GetCurrentContextInfo and SaveKeyInCurrentContext
- corelib.h: Restore original LICENSE_INTEROP_PROXY method signatures (SM_RetObj, IM_RuntimeTypeHandle_RefBool_RefIntPtr_RetVoid, IM_IntPtr_RetVoid)
- runtimecallablewrapper.cpp: Restore MethodDescCallSite calls for license interop
- metasig.h: Remove added PtrLicenseInteropProxy_* metasig definitions

Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
Copilot AI changed the title [WIP] [runtime-coreclr] Fix test failure in NETClientLicense Partially revert PR #125326: revert ComActivator/LicenseInteropProxy changes Mar 18, 2026
Copilot AI requested a review from jkotas March 18, 2026 03:24
@dotnet-policy-service
Copy link
Contributor

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

@jkotas
Copy link
Member

jkotas commented Mar 18, 2026

/azp run runtime-coreclr gcstress-extra

@jkotas jkotas marked this pull request as ready for review March 18, 2026 03:43
Copilot AI review requested due to automatic review settings March 18, 2026 03:43
@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Partially reverts PR #125326 for COM licensing activation by restoring GC-safe managed-call patterns for LicenseInteropProxy, addressing heap corruption under GC stress.

Changes:

  • Restore LicenseInteropProxy method bindings/signatures and remove pointer-based metasigs.
  • Switch native license interop call sites from UnmanagedCallersOnlyCaller to MethodDescCallSite + ARG_SLOT.
  • Revert CoreLib LicenseInteropProxy back to a managed Create() factory and remove unsafe [UnmanagedCallersOnly] wrappers.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/coreclr/vm/runtimecallablewrapper.cpp Replaces UCO pointer calls with MethodDescCallSite invocations for license interop.
src/coreclr/vm/metasig.h Removes metasig entries for pointer-based LicenseInteropProxy UCO signatures.
src/coreclr/vm/corelib.h Restores original method binding signatures for LicenseInteropProxy.
src/coreclr/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComActivator.cs Restores managed Create() and removes unsafe UCO wrappers for licensing methods.

@jkotas
Copy link
Member

jkotas commented Mar 18, 2026

/azp run runtime-coreclr gcstress-extra

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@AaronRobinsonMSFT
Copy link
Member

FYI @am11

@jkotas jkotas merged commit 3e79783 into main Mar 19, 2026
118 of 124 checks passed
@jkotas jkotas deleted the copilot/fix-netclientlicense-test-failures branch March 19, 2026 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test failure: Interop/COM/NETClients/Licensing/NETClientLicense/NETClientLicense.cmd

4 participants