Repository navigation
[ci-scan] Test failure: InvokeWithRefLikeArgs.MethodTakesRefToRefStructAsArg_ThrowsNSE on iossimulator #129358
Description
Activity
- addedblocking-clean-ciBlocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'Known Build ErrorUse this to report build issues in the .NET Helix tabUse this to report build issues in the .NET Helix tab
on Jun 13, 2026 - addeduntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner
on Jun 13, 2026 dotnet-policy-service commented
on Jun 16, 2026 ContributorMore actionsTagging subscribers to this area: @steveisok, @dotnet/area-system-reflection-emit
See info in area-owners.md if you want to be subscribed.dotnet-policy-service commented
on Jun 16, 2026 ContributorMore actionsTagging subscribers to 'os-ios': @vitek-karas, @kotlarmilos, @steveisok, @akoeplinger
See info in area-owners.md if you want to be subscribed.github-actions commented
on Jun 19, 2026 on Jun 19, 2026 – with GitHub ActionsContributorAuthorMore actionsWorkflow artifact: ci-fix
Artifact kind: handoff
Linked KBE: #129358Note
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 oniossimulator-x64withIndexOutOfRangeExceptioninstead of the expectedNotSupportedException.The test calls
MethodInfo.Invoke()on a method that takes arefto a ref struct, which the runtime should reject withNotSupportedException. Instead, the runtime entersInvokeStub_Binder.BindToMethod()(from aMock<Binder>created by Moq/Castle.DynamicProxy), which throwsIndexOutOfRangeExceptionwith an empty stack trace.This indicates the emit-generated reflection invoke stub on iossimulator CoreCLR has a bug: instead of raising
NotSupportedExceptionat 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 theIndexOutOfRangeException.This is a runtime-internal reflection invoke issue — not a test bug, and not fixable via a test change without disabling it.
Evidence
- Failing build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1461116
- First build it occurred: commit 50d7f0f7 (2026-06-09T17:46:53Z, within scanned window)
- Possible related PR: none identified with sufficient confidence
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-feedbackreads 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.
- #128501
search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved". - [ci-scan] Test failure: CryptoStreamTests.ReadWrite_Success MemberData not found on maccatalyst #128451
issue_read: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
To allow these resources, lower
min-integrityin your GitHub frontmatter:tools: github: min-integrity: approved # merged | approved | unapproved | none
Generated by CI Outer-Loop Failure Fixer · ● 17.2M · ◷
- removeduntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner
on Jun 29, 2026 github-actions commented
on Aug 9, 2026 on Aug 9, 2026 – with GitHub ActionsContributorAuthorMore actionsWorkflow artifact: ci-fix
Artifact kind: handoff
Linked KBE: #129358Note
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_ThrowsNSEfails oniossimulator-arm64 Release AllSubsets_CoreCLRin 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 throwsIndexOutOfRangeException— 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
- Failing build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1458940 (also 1460723)
- First build it occurred: build 1458940 (2026-06-11) — earliest cited; true origin may predate it.
- Possible related PR: none identified with sufficient confidence. Related: [ci-scan] Test failure: AssemblyTests.AssemblyLoadWithPublicKey (iossimulator-arm64) #129149.
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.allowedlist 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 · ◷
- removedblocking-clean-ciBlocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'
on Aug 10, 2026 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
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_ThrowsNSEfails on iossimulator-arm64 (CoreCLR) in both the Emit and Interpreted reflection invoke test assemblies. The test expectsNotSupportedExceptionwhen passing a ref-to-ref-struct argument but receivesIndexOutOfRangeExceptioninstead.Error Message
trueonly 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
System.Runtime.ReflectionInvokeEmit.TestsandSystem.Runtime.ReflectionInvokeInterpreted.TestsFirst build it occurred
Related: #129149 (same platform, different test in same assembly)
Filed by
ci-failure-scan(detection only).ci-failure-fixwalks 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.
search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".To allow these resources, lower
min-integrityin your GitHub frontmatter:Report
Summary