codex - ✅(Solved) Fix Windows: codex-tui app test stack overflows on clean HEAD [1 pull requests, 2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#19596Fetched 2026-04-26 05:14:12
View on GitHub
Comments
2
Participants
2
Timeline
10
Reactions
0
Timeline (top)
labeled ×4cross-referenced ×3commented ×2unlabeled ×1

On Windows, codex-tui can abort with STATUS_STACK_OVERFLOW when running the app::tests::attach_live_thread_for_selection_rejects_unmaterialized_fallback_threads test. This reproduces from a clean detached worktree at upstream HEAD, so it is not caused by unrelated local TUI skill-popup changes.

Error Message

running 1 test test app::tests::attach_live_thread_for_selection_rejects_unmaterialized_fallback_threads ...

thread 'app::tests::attach_live_thread_for_selection_rejects_unmaterialized_fallback_threads' has overflowed its stack error: test failed, to rerun pass -p codex-tui --lib

Caused by: process didn't exit successfully: ... (exit code: 0xc00000fd, STATUS_STACK_OVERFLOW)

Root Cause

On Windows, codex-tui can abort with STATUS_STACK_OVERFLOW when running the app::tests::attach_live_thread_for_selection_rejects_unmaterialized_fallback_threads test. This reproduces from a clean detached worktree at upstream HEAD, so it is not caused by unrelated local TUI skill-popup changes.

Fix Action

Fixed

PR fix notes

PR #19597: Fix TUI attach fallback test stack overflow

Description (problem / solution / changelog)

Why

Fixes #19596.

The codex-tui fallback tests for attach_live_thread_for_selection exercise the embedded app-server path, which can exceed the default test-thread stack in debug builds. When that happens, the process aborts with a stack overflow before the tests can report a normal assertion result. The issue was reported on Windows, and the same failure reproduced locally without increasing RUST_MIN_STACK.

What changed

The two affected fallback tests now run through a small test helper that creates an explicit 4 MiB thread stack and drives the async test body with a current-thread Tokio runtime. The test behavior is unchanged: both cases still assert that empty or unmaterialized fallback threads are rejected without creating a local thread event channel.

Verification

  • cargo test -p codex-tui attach_live_thread_for_selection_rejects_ -- --test-threads=1
  • cargo test -p codex-tui no longer aborts with the reported stack overflow; it progressed past these tests and later failed on unrelated sandbox-sensitive status snapshot/config expectations.

Changed files

  • codex-rs/tui/src/app/tests.rs (modified, +88/-53)

Code Example

cd C:\Users\stefa\codex-clean-head-proof-8868\codex-rs
cargo test -p codex-tui app::tests::attach_live_thread_for_selection_rejects_unmaterialized_fallback_threads -- --test-threads=1

---

running 1 test
test app::tests::attach_live_thread_for_selection_rejects_unmaterialized_fallback_threads ...

thread 'app::tests::attach_live_thread_for_selection_rejects_unmaterialized_fallback_threads' has overflowed its stack
error: test failed, to rerun pass `-p codex-tui --lib`

Caused by:
  process didn't exit successfully: ... (exit code: 0xc00000fd, STATUS_STACK_OVERFLOW)
RAW_BUFFERClick to expand / collapse

Summary

On Windows, codex-tui can abort with STATUS_STACK_OVERFLOW when running the app::tests::attach_live_thread_for_selection_rejects_unmaterialized_fallback_threads test. This reproduces from a clean detached worktree at upstream HEAD, so it is not caused by unrelated local TUI skill-popup changes.

Environment

  • OS: Windows
  • Repo: openai/codex
  • Clean HEAD tested: 6de6eaa0c ([4/4] Honor Streamable HTTP MCP placement (#18584))
  • Test path used: short path under C:\Users\stefa\codex-clean-head-proof-* to avoid Windows path-length failures from deeper worktree paths

Reproduction

From a clean detached worktree at HEAD:

cd C:\Users\stefa\codex-clean-head-proof-8868\codex-rs
cargo test -p codex-tui app::tests::attach_live_thread_for_selection_rejects_unmaterialized_fallback_threads -- --test-threads=1

Actual Result

running 1 test
test app::tests::attach_live_thread_for_selection_rejects_unmaterialized_fallback_threads ...

thread 'app::tests::attach_live_thread_for_selection_rejects_unmaterialized_fallback_threads' has overflowed its stack
error: test failed, to rerun pass `-p codex-tui --lib`

Caused by:
  process didn't exit successfully: ... (exit code: 0xc00000fd, STATUS_STACK_OVERFLOW)

A full local run of cargo test -p codex-tui also aborts with the same class of stack overflow before the suite can complete.

Expected Result

The test should pass or fail with a normal assertion. It should not abort the process with a stack overflow.

Notes

This was separated from a focused TUI skill mention popup change because the failure reproduces on clean HEAD. Keeping this as its own issue should make the root cause easier to triage without mixing it into unrelated UI behavior changes.

extent analysis

TL;DR

The codex-tui test attach_live_thread_for_selection_rejects_unmaterialized_fallback_threads may be causing a stack overflow due to excessive recursion or infinite looping.

Guidance

  • Verify that the test is not causing an infinite recursion by reviewing the code and checking for any recursive function calls without a proper base case.
  • Check the test configuration and ensure that the --test-threads=1 flag is not contributing to the stack overflow.
  • Investigate the codex-tui code for any potential issues with thread management or synchronization that could lead to a stack overflow.
  • Consider running the test with a higher stack size limit to see if it resolves the issue.

Example

No code snippet is provided as the issue does not include specific code details.

Notes

The root cause of the issue is unclear and may require further investigation into the codex-tui code and test configuration.

Recommendation

Apply workaround: Increase the stack size limit for the test to see if it resolves the issue, as the root cause is not immediately apparent and may require further debugging.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING