Skip to content

SOS VarargPInvoke test expects a stub signature without the explicit secret argument #6165

Closed

Description

@davidwrighton

Description

SOS.Tests.VarargPInvokeTests.VarargPInvoke_ReportsInteropMethodAndDisassemblesStub fails because its exact expected IL stub signature omits the explicit secret-context parameter.

The test expects:

ILStubClass.IL_STUB_PInvoke(System.String, Int32, Double, ...)

Both legacy DAC and cDAC report:

ILStubClass.IL_STUB_PInvoke(System.String, Int32, Double, IntPtr, ...)

The failure occurs at frames.SingleRow(...), before the subsequent ip2md, clru, and clru -il assertions run.

Configuration

Observed in dotnet/runtime#135805, diagnostics build 1651653:

  • Windows x64 and arm64, Release, .NET 12 private runtime.
  • Both SOS and SOS_EnumMemory jobs.
  • Windows/CDB live debugging; x64 console confirms the same mismatch with both legacy DAC and cDAC.

Regression?

The exact-string assertion was introduced by #6155 on October 26, 2026.

The additional IntPtr is expected runtime behavior: dotnet/runtime#132534 made IL stub secret context an explicit native int modreq(SecretStubArgument) parameter. In src/coreclr/vm/dllimport.cpp, StubNeedsSecretArgument selects vararg forward stubs and AppendSecretStubArgument appends ELEMENT_TYPE_I. These helpers are unchanged by dotnet/runtime#135805.

Other information

Suggested fix: update the expected StubName in VarargPInvokeTests.cs for the applicable runtime versions, preserving the existing stack, method-resolution, and disassembly assertions. Rerun the test to validate the later assertions, which the current failure prevents from executing.

x64 Helix console

SOS.TestHarness.SosAssertException : SOS assertion failed.
  host:     cdb
  command:  clrstack
  expected: exactly one row where Function is ILStubClass.IL_STUB_PInvoke(System.String, Int32, Double, ...) (found 0)

This report is based on CI results and source inspection; no local Windows reproduction or proposed fix has been run.

Note

This issue was generated by GitHub Copilot.

Activity

  1. added a commit that references this issue on Oct 28, 2026
    5f8e434
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions