Skip to content

fix: make SIGINT attachment atomic and enable macOS setsid tests - #2

Closed
leej3 wants to merge 1 commit into
asmacdo:signal-test-handshakefrom
leej3:codex/signal-test-followups
Closed

leej3 wants to merge 1 commit into
asmacdo:signal-test-handshakefrom
leej3:codex/signal-test-followups

Conversation

@leej3

@leej3 leej3 commented Oct 11, 2026

Copy link
Copy Markdown

AI-generated draft — not reviewed by John

Two small follow-ups to con#456:

  • Block SIGINT during PID attachment and pending-signal forwarding to prevent one interrupt being forwarded twice; add a regression test.
  • Install util-linux on macOS CI and add its bin directory to PATH for setsid coverage.

Validation: the regression fails before the fix; all 24 signal tests pass on this base. All pre-commit checks pass. With con#457's changes, 74 affected tests and all six previously skipped setsid cases pass locally.

The combined con#456 and con#457 changes already pass upstream CI; con#456's standalone Intel Mac sampling failure is addressed by con#457.

Block SIGINT during PID attachment and pending-signal forwarding. Add a
regression test and install util-linux for macOS CI session coverage.

Co-Authored-By: Codex Desktop 26.1007.21159 (runtime codex-cli 0.162.0-alpha.17.2) / gpt-6-astra <codex@openai.com>
Codex-Reasoning-Effort: low
asmacdo pushed a commit that referenced this pull request Oct 12, 2026
A SIGINT that arrived between attach() setting self.pid and checking
sigcount was forwarded twice: once by the handler, which already saw the
pid, and once more by attach() acting on the now nonzero count. The
command got two SIGINTs for one Ctrl-C.

With SIGINT blocked in the main thread (and in every helper thread, via
start_thread), a signal in that window stays pending and is handled
once, after the mask is restored.

Split out of #2, which also enabled setsid on macOS CI.

Co-Authored-By: Claude Code 2.1.296 / Claude Opus 5.5 <noreply@anthropic.com>
asmacdo pushed a commit that referenced this pull request Oct 12, 2026
macOS has no setsid command, so the setsid cases of
test_spawn_children were skipped on the macOS jobs. Homebrew's
util-linux provides it; it is keg-only, so put its bin on PATH.

Split out of #2, which also fixed a double-forwarded SIGINT
in attach().

Co-Authored-By: Claude Code 2.1.296 / Claude Opus 5.5 <noreply@anthropic.com>
asmacdo pushed a commit that referenced this pull request Oct 12, 2026
A SIGINT that arrived between attach() setting self.pid and checking
sigcount was forwarded twice: once by the handler, which already saw the
pid, and once more by attach() acting on the now nonzero count. The
command got two SIGINTs for one Ctrl-C.

With SIGINT blocked in the main thread (and in every helper thread, via
start_thread), a signal in that window stays pending and is handled
once, after the mask is restored.

Split out of #2, which also enabled setsid on macOS CI.

Co-Authored-By: Codex Desktop 26.1007.21159 (runtime codex-cli 0.162.0-alpha.17.2) / gpt-6-astra <codex@openai.com>
Codex-Reasoning-Effort: low
Co-Authored-By: Claude Code 2.1.296 / Claude Opus 5.5 <noreply@anthropic.com>
asmacdo pushed a commit that referenced this pull request Oct 12, 2026
macOS has no setsid command, so the setsid cases of
test_spawn_children were skipped on the macOS jobs. Homebrew's
util-linux provides it; it is keg-only, so put its bin on PATH.

Split out of #2, which also fixed a double-forwarded SIGINT
in attach().

Co-Authored-By: Codex Desktop 26.1007.21159 (runtime codex-cli 0.162.0-alpha.17.2) / gpt-6-astra <codex@openai.com>
Codex-Reasoning-Effort: low
Co-Authored-By: Claude Code 2.1.296 / Claude Opus 5.5 <noreply@anthropic.com>
@asmacdo

asmacdo commented Oct 12, 2026

Copy link
Copy Markdown
Owner

I split this up and included you as coauthor. the signal forwarding went to con#456 and the test util went to con#457

@asmacdo asmacdo closed this Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants