Skip to content

Versioning issue with ComInterop and async variants #129841

Closed

Description

@jakobbotsch

We avoid generating calls to async variants of ComInterop functions. However, there is a versioning issue in the following situation:

  1. A call to an interface function is prejitted
  2. The interface itself gets marked as ComInterop
  3. The interface call is run

In that case we end up with a call to the async variant of a ComInterop function. We currently are not able to generate that. There are a few possible fixes:

  • Bring back the async thunk
  • Generate an async version based on the IL from the IL stub emitted for the non-async variant
  • Move these functions to transient IL plan and have an async version generated that way
  • Detect the situation and throw away the R2R codegen

Context: #129747

Activity

  1. added
    area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
    on Jun 25, 2026
  2. dotnet-policy-service commented on Jun 25, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
    See info in area-owners.md if you want to be subscribed.

  3. removed
    untriagedNew issue has not been triaged by the area owner
    on Jun 25, 2026
  4. added this to the 11.0.0 milestone on Jun 25, 2026
  5. jtschuster commented on Jun 25, 2026

    @jtschuster
    Member

    Wouldn't adding [ComImport] be considered a non-version-safe API change that should require recompilation?
    https://learn.microsoft.com/en-us/dotnet/core/compatibility/library-change-rules#attributes

  6. jakobbotsch commented on Jul 9, 2026

    @jakobbotsch
    MemberAuthor

    Wouldn't adding [ComImport] be considered a non-version-safe API change that should require recompilation? https://learn.microsoft.com/en-us/dotnet/core/compatibility/library-change-rules#attributes

    I think in cases like that we expect that the VM can detect and throw away outdated R2R. I think in this particular case you can end up crashing the runtime.

  7. modified the milestones: 11.0.0, 12.0.0 on Jul 29, 2026
  8. jakobbotsch commented on Aug 27, 2026

    @jakobbotsch
    MemberAuthor

    Fixed by #131494

  9. locked and limited conversation to collaborators on Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Priority:3Work that is nice to havearea-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions