Repository navigation
Description
Question
The fix for #1634 (handoff #2044, branch feature/auto-1634 at 52d4c95, no pull request yet) applied #2029's answer, and the edit budget for this push is now spent with introduced findings still open. Each round's model of nested timeouts drew new findings against the round before it, so editing stopped here. Which model should the lane ship?
What the branch holds now
Where one timeout runs another, each outer one is judged by what reaches the loop. The inner one runs its child in a process group of its own and passes on only HUP, INT, QUIT, and TERM. So an outer one sending any other signal, or carrying a kill-after, is no bound. One sending signal 0 with no kill-after is inert, and the run is bounded when the innermost one is a bound or an outer one sends a passed-on signal.
Open findings from the last strict pass
introduced, 5:
- False allow:
timeis skipped as a prefix between nested timeouts, but/usr/bin/timeforks rather than execs, sotimeout 900 time timeout -s 0 800 bash -c '<loop>'leaves the loop running. With-f,timeout -f -s 0 -k 30 900 time bash -c '<loop>'escapes the same way. - False allow:
timeout -s HUP 900 timeout -s 0 800 nohup bash -c '<loop>'counts HUP as passed on, andnohupignores it. The single-timeout form was already allowed on develop, but the README limitations paragraph this branch wrote calls a payload-ignored signal undecidable from the text, and this one is decidable. - Undeclared false deny:
timeout -k 30 900 timeout 800 bash -c '<loop>'is denied, though the outer TERM is passed on first. The README states two rules that disagree on this shape. - Undeclared false allow:
timeout -s "$SIG" 900 bash -c '<loop>'reads an unresolved signal as a bound. - False deny:
-s sig15(SIGplus digits) is not read as a passed-on TERM.
pre-existing, 1: an inherited bound reaching a loop under a nested timeout inside a payload, filed as #2055.
Options
- Recommended: narrow nesting to the one shape Decide How to Close the Nested-Timeout False Deny in the Signal-0 Check (#1634) #2029 asked for. A nested
timeoutchain is bounded only when every outer one sends signal 0 with no kill-after and the innermost one is a bound. Every other nesting is denied, declared once in requirement 7 as a false deny. That removes findings 1, 3 and 5 with the model that caused them. A variable-svalue is read as no bound, closing 4, and the README declaresnohupwithHUPfor 2. Then one more strict pass and the pull request. Less code than now, and rare real nestings such astimeout 900 timeout -s 0 800 ...are denied. - Keep the passed-on-signal model and fix all five. Stop skipping
timebetween timeouts, modelnohupagainstHUP, credit an outer kill-after behind a passed-on signal, readSIGplus digits, and deny an unresolved signal. Then one more strict pass. This allows the most real shapes, but each round of this model has so far drawn new findings. - Open the pull request as it stands and file the five findings as follow-up issues. No further edit on this branch, and the false allows in 1, 2 and 4 ship until the follow-ups land.
Blocks
- Handoff Session Handoff [auto-1634]: Deny a Signal-0 timeout as a Wait Bound in the Guard (#1634) #2044 (track
auto-1634), branchfeature/auto-1634at 52d4c95. No pull request is open, so none is blocked.
Activity
ptr727 commentedon Sep 29, 2026
Answered by the maintainer on 2026-09-29: option 1, narrow nesting to the one shape #2029 asked for, declare every other nesting as a false deny in requirement 7, read a variable
-svalue as no bound, declarenohupwithHUPin the README, then one more strict pass and the pull request.Bound a Nested timeout Only Behind Signal-0 Outer Ones
Deny a Signal-0 timeout as a Wait Bound in the Guard (#2117)