Skip to content

[ci-scan] Test failure: InvokeWithRefLikeArgs.MethodTakesRefToRefStructAsArg_ThrowsNSE on iossimulator #129358

Description

@github-actions

Build Information

Build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1458940
Build error leg or test failing: iossimulator-arm64 Release AllSubsets_CoreCLR - System.Runtime.ReflectionInvokeEmit.Tests / System.Runtime.ReflectionInvokeInterpreted.Tests

Error Details

System.Reflection.Tests.InvokeWithRefLikeArgs.MethodTakesRefToRefStructAsArg_ThrowsNSE fails on iossimulator-arm64 (CoreCLR) in both the Emit and Interpreted reflection invoke test assemblies. The test expects NotSupportedException when passing a ref-to-ref-struct argument but receives IndexOutOfRangeException instead.

[FAIL] System.Reflection.Tests.InvokeWithRefLikeArgs.MethodTakesRefToRefStructAsArg_ThrowsNSE
Assert.Throws() Failure: Exception type was not an exact match
Expected: typeof(System.NotSupportedException)
Actual:   typeof(System.IndexOutOfRangeException)
---- System.IndexOutOfRangeException : Index was outside the bounds of the array.
   at System.Reflection.Tests.InvokeWithRefLikeArgs.MethodTakesRefToRefStructAsArg_ThrowsNSE()
   at InvokeStub_InvokeWithRefLikeArgs.MethodTakesRefToRefStructAsArg_ThrowsNSE(Object, Object, IntPtr*)

Error Message

true only for clear infra flakes. ExcludeConsoleLog skips helix log scanning. -->

{
  "ErrorMessage": [
    "[FAIL] System.Reflection.Tests.InvokeWithRefLikeArgs.MethodTakesRefToRefStructAsArg_ThrowsNSE",
    "Assert.Throws() Failure: Exception type was not an exact match"
  ],
  "ErrorPattern": "",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

Impact on platforms

  • runtime-extra-platforms (def 154) / iossimulator-arm64 Release AllSubsets_CoreCLR / exit code: non-zero (test failure)
  • Affects both System.Runtime.ReflectionInvokeEmit.Tests and System.Runtime.ReflectionInvokeInterpreted.Tests

First build it occurred

Related: #129149 (same platform, different test in same assembly)


Filed by ci-failure-scan (detection only). ci-failure-fix walks open [ci-scan] KBEs and either opens a small fix PR or comments here to loop in owners — it never disables the test.

Note

🔒 Integrity filter blocked 2 items

The following items were blocked because they don't meet the GitHub integrity level.

  • #98964 search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • #104825 search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".

To allow these resources, lower min-integrity in your GitHub frontmatter:

tools:
  github:
    min-integrity: approved  # merged | approved | unapproved | none

Generated by CI Outer-Loop Failure Scanner · ● 38.2M · ◷

Report

Build Repository Test Pull Request
1603534 dotnet/runtime System.Reflection.Tests.InvokeWithRefLikeArgs.MethodTakesRefToRefStructAsArg_ThrowsNSE #133656
1603190 dotnet/runtime System.Reflection.Tests.CustomAttributeTests.TestMarshalAsPseudoCustomAttribute #133656

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
0 0 2

Activity

  1. dotnet-policy-service commented on Jun 16, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @steveisok, @dotnet/area-system-reflection-emit
    See info in area-owners.md if you want to be subscribed.

  2. dotnet-policy-service commented on Jun 16, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to 'os-ios': @vitek-karas, @kotlarmilos, @steveisok, @akoeplinger
    See info in area-owners.md if you want to be subscribed.

  3. github-actions commented on Jun 19, 2026

    @github-actions
    ContributorAuthor

    Workflow artifact: ci-fix
    Artifact kind: handoff
    Linked KBE: #129358

    Note

    AI/Copilot-generated triage note.

    This Known Build Error has no producible automated code change (reason: runtime reflection invoke stub codegen bug on iossimulator — the test is correct and the fix requires changes to invoke-stub generation internals, which exceeds automated bounds), so I could not open even a best-effort PR. Looping in owners so it can be fixed forward rather than muted.

    Root cause (best analysis)

    MethodTakesRefToRefStructAsArg_ThrowsNSE (InvokeWithRefLikeArgs.cs:41-52) fails on iossimulator-x64 with IndexOutOfRangeException instead of the expected NotSupportedException.

    The test calls MethodInfo.Invoke() on a method that takes a ref to a ref struct, which the runtime should reject with NotSupportedException. Instead, the runtime enters InvokeStub_Binder.BindToMethod() (from a Mock<Binder> created by Moq/Castle.DynamicProxy), which throws IndexOutOfRangeException with an empty stack trace.

    This indicates the emit-generated reflection invoke stub on iossimulator CoreCLR has a bug: instead of raising NotSupportedException at the right check (ref-like arguments aren't supported for reflection invoke), it falls through to the Binder dispatch where the parameter array is empty/mismatched, causing the IndexOutOfRangeException.

    This is a runtime-internal reflection invoke issue — not a test bug, and not fixable via a test change without disabling it.

    Evidence

    Suggested reviewers / area contacts

    • Area owners (area-System.Reflection.Emit): @dotnet/area-system-reflection-emit
    • Lead: @steveisok
    • For iOS platform-specific aspects: @AaronRobinsonMSFT, @vitek-karas

    The fix likely involves investigating the reflection invoke code path on iossimulator to ensure the ref-struct-as-ref parameter check fires before the Binder dispatch.


    Filed by ci-failure-fix, which attempts validated fixes for [ci-scan] Known Build Errors and otherwise loops in owners. Comment here or on the workflow file to suggest changes; ci-failure-scan-feedback reads in-scope feedback daily and opens (or updates) a PR with prompt edits.

    Note

    🔒 Integrity filter blocked 2 items

    The following items were blocked because they don't meet the GitHub integrity level.

    To allow these resources, lower min-integrity in your GitHub frontmatter:

    tools:
      github:
        min-integrity: approved  # merged | approved | unapproved | none

    Generated by CI Outer-Loop Failure Fixer · ● 17.2M · ◷

  4. added this to the 11.0.0 milestone on Jun 29, 2026
  5. removed
    untriagedNew issue has not been triaged by the area owner
    on Jun 29, 2026
  6. modified the milestones: 11.0.0, 12.0.0 on Jun 29, 2026
  7. github-actions commented on Aug 9, 2026

    @github-actions
    ContributorAuthor

    Workflow artifact: ci-fix
    Artifact kind: handoff
    Linked KBE: #129358

    Note

    AI/Copilot-generated triage note.

    This Known Build Error has no producible automated code change (reason: reflection-invoke stub / VM codegen behavior on iOS-simulator CoreCLR — must not be auto-fixed, and no non-disabling test change addresses the wrong exception), so I could not open even a best-effort PR. Looping in owners so it can be fixed forward rather than muted.

    Root cause (best analysis)

    System.Reflection.Tests.InvokeWithRefLikeArgs.MethodTakesRefToRefStructAsArg_ThrowsNSE fails on iossimulator-arm64 Release AllSubsets_CoreCLR in both the Emit and Interpreted reflection-invoke assemblies:

    Expected: typeof(System.NotSupportedException)
    Actual:   typeof(System.IndexOutOfRangeException)
       at InvokeStub_InvokeWithRefLikeArgs.MethodTakesRefToRefStructAsArg_ThrowsNSE(Object, Object, IntPtr*)
    

    Invoking a method that takes a ref-to-ref-struct argument should throw NotSupportedException, but on iOS-simulator CoreCLR the generated invoke stub instead throws IndexOutOfRangeException — the ref-like argument validation that normally produces the NSE is not being hit on this platform, and the stub proceeds into an out-of-bounds access. This is a VM reflection-invoke stub / codegen behavior specific to the iOS-simulator CoreCLR configuration, out of bounds for an automated fix. The KBE notes a sibling failure (#129149, same platform/assembly, different test), suggesting a shared root cause in invoke-stub generation on this target. No non-disabling test change would produce the correct exception.

    Evidence

    Suggested reviewers / area contacts

    • Area owners (area-System.Reflection.Emit): @steveisok, @dotnet/area-system-reflection-emit
    • VM (area-VM-coreclr): @agocke, @vsadov

    A fix likely involves ensuring the reflection-invoke stub performs the ref-like-type argument check (yielding NotSupportedException) before the array access on iOS-simulator CoreCLR, matching desktop behavior.

    Warning

    Firewall blocked 1 domain

    The following domain was blocked by the firewall during workflow execution:

    • awmgmcpg

    To allow these domains, add them to the network.allowed list in your workflow frontmatter:

    network:
      allowed:
        - defaults
        - "awmgmcpg"

    See Network Configuration for more information.

    Generated by CI Outer-Loop Failure Fixer · 339.4 AIC · ⌖ 21 AIC · ⊞ 17.1K · ◷

  8. removed
    blocking-clean-ciBlocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'
    on Aug 10, 2026
  9. jeffschwMSFT commented on Aug 10, 2026

    @jeffschwMSFT
    Member

    removing blocking-clean-ci as it has not failed in 30 days

    Summary
    24-Hour Hit Count 7-Day Hit Count 1-Month Count
    0 0 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions