Repository navigation
fix: restore timeout watchdog compatibility with macOS Bash 3.2 - #6028
kunchenguid merged 2 commits into
Conversation
|
…rtup-owner failure paths now kill the bounded command group before killing the watchdog. Fault injection reproduced both leaks before the fix and confirmed cleanup afterward. Bash 3.2 suite, syntax check, ShellCheck, and diff checks passed; GNU timeout coverage skipped because the binary is unavailable. Production code unchanged
|
+1, another affected home here. On macOS with the stock We are carrying a local one-line stopgap ( This PR is green and mergeable; merging it would unblock us. Related: #6074 (shared lock on bash 3.2, also from the missing |
|
Verified on stock macOS
This is the smallest fix among the open PRs on this line: it answers "is the owner the process being replaced" inside the watchdog, where |
|
Kun's firstmate triage (firstmate-oss) — merge stamp
Why this one: it drops the bash-4-only VISION check:
Merge intent: squash-merge now at |
Intent
ok
Approval is for preparing the small macOS fix as a separate upstream Firstmate PR, preserving the other changes.
The approved fix is limited to stock-macOS Bash 3.2 timeout/watchdog compatibility in bin/fm-timeout-lib.sh and accompanying tests/fm-timeout-lib.test.sh: the watchdog ownership code reads the Bash-4-only BASHPID variable under nounset, breaking bounded-command execution on the stock shell.
Correct that ownership handling without losing current upstream timeout/signal-status improvements or process-ownership safeguards, with regression tests.
Full validation and a separate PR to https://github.com/kunchenguid/firstmate are authorized; merge, live installation and reversal of existing local changes are not.
Existing monitoring work, admission-recovery code and other local changes must remain separate and preserved.
What Changed
BASHPIDto Perl’s process ID, preserving the pre-exec parent for startup races.BASHPID, top-level and subshell exit/signal statuses, and parent death during watchdog startup.BASHPIDusage in existing ownership tests with portable PID discovery.Risk Assessment
✅ Low: The narrowly scoped fix removes the Bash-4-only dependency while preserving ownership checks and timeout/status handling, with behavioral regression coverage and no unrelated changes.
Testing
Path normalization: Local validation directories in the excerpts below are represented by
${REPO_ROOT},${TEST_SCRATCH}, and${VALIDATION_EVIDENCE}.These are portable placeholders, not literal original command paths; outputs and results are otherwise unchanged.
Local directory paths appeared in an earlier revision of this description; linked evidence artifacts remain unchanged.
Targeted tests and live Bash 3.2 library calls passed after correcting two driver-only assumptions; the original BASHPID failure was reproduced, command/status and process-cleanup evidence was captured, and temporary inputs were removed. GNU fallback remains untested because timeout/gtimeout are unavailable; no UI surface was changed.
Evidence: Live product transcript, including baseline reproduction
Source: Live product transcript, including baseline reproduction
Evidence: Targeted regression tests
Source: Targeted regression tests
Evidence: Reproducible live driver
Source: Reproducible live driver
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
/bin/bash --versionconfirmed Bash 3.2.57 on Darwin arm64./bin/bash tests/fm-timeout-lib.test.shpassed; GNU timeout coverage skipped because the binary is unavailable.python3 ${VALIDATION_EVIDENCE}/drive-timeout.pyreproduced the base commit failure and exercised the actual library with real processes.Corrected two manual-driver assumptions—reaping a killed parent before draining pipes and accepting TERM or KILL after owner death—then reran successfully.git status --shortand the transient-directory check confirmed cleanup and an unchanged worktree.✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.