Skip to content

Fix stackoverflowtester to skip ARM32 in TestStackOverflowLargeFrameMainThread#126525

Open
Copilot wants to merge 5 commits intomainfrom
copilot/fix-stackoverflow-exit-code
Open

Fix stackoverflowtester to skip ARM32 in TestStackOverflowLargeFrameMainThread#126525
Copilot wants to merge 5 commits intomainfrom
copilot/fix-stackoverflow-exit-code

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 3, 2026

main PR

Description

TestStackOverflowLargeFrameMainThread was missing Architecture.Arm in its Unix skip guard, causing it to run on ARM32 where it reliably fails. On ARM32, large-frame methods (65KB/frame) cause the JIT to probe stack pages without moving SP, so the guard page fault lands >8KB from SP — outside the runtime's 2-page detection window in signal.cpp. This produces SIGSEGV (exit 0x8B/139) instead of the expected SIGABRT (exit 0x86/134).

TestStackOverflowLargeFrameSecondaryThread already correctly included Architecture.Arm in its skip. This change makes the main-thread version consistent:

// Before
if (((RuntimeInformation.ProcessArchitecture == Architecture.Arm64) || ... ||
    (RuntimeInformation.ProcessArchitecture == Architecture.LoongArch64)) && ...)

// After
if (((RuntimeInformation.ProcessArchitecture == Architecture.Arm64) || ... ||
    (RuntimeInformation.ProcessArchitecture == Architecture.LoongArch64) ||
    (RuntimeInformation.ProcessArchitecture == Architecture.Arm)) && ...)

Customer Impact

No customer impact — this is a test-only fix. The underlying ARM32 stack overflow detection limitation (tracked in #110173) remains; this just prevents a spurious CI failure.

Regression

Not a regression in product behavior. The test skip was simply omitted from TestStackOverflowLargeFrameMainThread while it was correctly applied to the secondary-thread variant.

Testing

The fix aligns the skip condition with the already-correct TestStackOverflowLargeFrameSecondaryThread. No behavior change on non-ARM32 platforms.

Risk

Minimal. Test-only change that adds an early-return on ARM32 Unix, matching existing patterns in the same file.

Package authoring no longer needed in .NET 9

IMPORTANT: Starting with .NET 9, you no longer need to edit a NuGet package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older versions.

@dotnet-policy-service
Copy link
Copy Markdown
Contributor

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

Copilot AI changed the title [WIP] Fix stackoverflowtester exit code mismatch Fix stackoverflowtester to skip ARM32 in TestStackOverflowLargeFrameMainThread Apr 3, 2026
Copilot AI requested a review from mangod9 April 3, 2026 23:48
@mangod9 mangod9 marked this pull request as ready for review April 4, 2026 02:02
@mangod9 mangod9 requested review from Copilot and janvorli April 4, 2026 02:02
Copy link
Copy Markdown
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

Note

Copilot was unable to run its full agentic suite in this review.

Updates the stack overflow test skip logic so TestStackOverflowLargeFrameMainThread is skipped on ARM32 Unix (matching the already-correct secondary-thread variant) to avoid reliable CI failures due to runtime stack overflow detection limitations.

Changes:

  • Add Architecture.Arm to the Unix/macOS skip guard for TestStackOverflowLargeFrameMainThread.
  • Update the explanatory comments for the skip block.

@mangod9
Copy link
Copy Markdown
Member

mangod9 commented Apr 7, 2026

/ba-g Build-analysis hung, this is only disabling a test.

@github-actions

This comment has been minimized.

@mangod9 mangod9 enabled auto-merge (squash) April 7, 2026 20:58
Copilot AI review requested due to automatic review settings April 8, 2026 05:12
Copy link
Copy Markdown
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

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

@github-actions

This comment has been minimized.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

Note

This review was generated by Copilot.

🤖 Copilot Code Review — PR #126525

Holistic Assessment

Motivation: Justified. TestStackOverflowLargeFrameMainThread was missing Architecture.Arm in its Unix skip guard, while the sibling method TestStackOverflowLargeFrameSecondaryThread already had it. This inconsistency caused the main-thread test to run on ARM32 Unix where it reliably fails — large-frame stack probing doesn't move SP, so the guard page fault lands outside the runtime's detection window, producing SIGSEGV instead of the expected SIGABRT.

Approach: Correct. The fix follows the existing pattern in the file: an inline architecture + OS check with an early return for platforms where the test is known to fail. This is the right approach since the skip condition involves multiple architectures for multiple different reasons that can't be cleanly expressed via [ActiveIssue] attributes alone. Adding Architecture.Arm and updating comments to match the secondary-thread method is the minimal, consistent fix.

Summary: ✅ LGTM. Small, focused consistency fix. The code change is correct (parenthesization verified), the comments are improved, and the approach matches the existing pattern already present in TestStackOverflowLargeFrameSecondaryThread. No concerns about correctness, safety, or approach.


Detailed Findings

✅ Correctness — Skip condition matches sibling method

The TestStackOverflowLargeFrameSecondaryThread method (lines 202-203, unchanged in this PR) already includes Architecture.Arm in its skip condition on Unix. Before this PR, TestStackOverflowLargeFrameMainThread was the only large-frame test method that did not skip ARM32 on Unix. The PR brings it into alignment. The || chain for architectures is properly grouped inside the outer parentheses, and the && with the OS check is correct — no precedence issues:

((arch == Arm64 || arch == X64 || arch == RiscV64 || arch == LoongArch64 || arch == Arm) &&
 (os == Unix || os == MacOSX))

✅ Scope — Only large-frame tests need the ARM32 skip

The small-frame tests (TestStackOverflowSmallFrameMainThread, TestStackOverflowSmallFrameSecondaryThread) do not have this inline ARM skip, and that's correct. The ARM32 detection failure is specific to large stack frames (65KB/frame) where stack probing overshoots the SP detection window. Small-frame recursion doesn't trigger this condition. TestStackOverflow3 separately disables ARM (all platforms) via #107184 for a different issue.

✅ Comment clarity — Improved attribution of skip reasons

The old comments lumped all architectures under "Disabled on Unix ARM64, X64, RISCV64, and LoongArch64" with a single issue reference. The new comments correctly separate by root cause:

This matches the comments in the secondary-thread method exactly.

💡 Observation — Large-frame tests now skip on all mainstream Unix architectures (pre-existing)

With ARM, ARM64, X64, RiscV64, and LoongArch64 all skipped, the large-frame stack overflow tests only run on Windows (minus x86, skipped by [ActiveIssue] for #84911). This is a pre-existing situation — the secondary-thread method already had this scope — not something this PR introduces. Resolving #13519 and #110173 would restore Unix coverage.

Generated by Code Review for issue #126525 ·

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.

stackoverflowtester Exit code: 0x0000008B, expected 0x00000086

4 participants