Skip to content

fix(pty): resume child on any WUNTRACED stop signal to prevent hang#53

Merged
kipz merged 1 commit into
developfrom
kipz/fix-pty-generic-stop-sigcont
Jun 17, 2026
Merged

fix(pty): resume child on any WUNTRACED stop signal to prevent hang#53
kipz merged 1 commit into
developfrom
kipz/fix-pty-generic-stop-sigcont

Conversation

@kipz

@kipz kipz commented Jun 17, 2026

Copy link
Copy Markdown
Owner

Problem

`WUNTRACED` makes `waitpid` visible to stops from any signal — not just the explicitly handled `SIGTSTP`. The generic fallback arm in all three supervisor loops was logging and continuing without sending `SIGCONT`, leaving the child stopped forever.

For interactive TUI processes the startup-timeout safety net is explicitly disabled, so the hang is unbounded. Symptom: the process prints its banner line and then hangs with no further output; `--no-sandbox` works fine.

Fix

Send `SIGCONT` in the generic `WaitStatus::Stopped` fallback arm across all three supervisor loops so any unexpectedly stopped child is immediately resumed.

Testing

  • Built and tested locally — all checks pass.
  • Confirmed the installed binary uses the updated log message ("resuming" not "keeping supervisor alive") in the fallback path.

WUNTRACED makes waitpid visible to stops from any signal (SIGTTOU,
SIGTTIN, SIGSTOP, etc.), not just the explicitly handled SIGTSTP. The
generic fallback arm was logging and continuing without sending SIGCONT,
leaving the child stopped indefinitely and the supervisor spinning.

For interactive TUI processes (e.g. Claude Code) the startup-timeout
safety net is disabled, so the hang is unbounded.

Send SIGCONT in the fallback arm across all three supervisor loops so
any unexpectedly stopped child is immediately resumed.
@github-actions github-actions Bot added the bug Something isn't working label Jun 17, 2026
@kipz kipz marked this pull request as ready for review June 17, 2026 16:53
@kipz kipz merged commit e3e0f45 into develop Jun 17, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant