Skip to content

Choose the Nested timeout Model for #1634's Signal-0 Bound Check #2056

Closed

Description

@ptr727

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:

  1. False allow: time is skipped as a prefix between nested timeouts, but /usr/bin/time forks rather than execs, so timeout 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.
  2. False allow: timeout -s HUP 900 timeout -s 0 800 nohup bash -c '<loop>' counts HUP as passed on, and nohup ignores 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.
  3. 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.
  4. Undeclared false allow: timeout -s "$SIG" 900 bash -c '<loop>' reads an unresolved signal as a bound.
  5. False deny: -s sig15 (SIG plus 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

  1. 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 timeout chain 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 -s value is read as no bound, closing 4, and the README declares nohup with HUP for 2. Then one more strict pass and the pull request. Less code than now, and rare real nestings such as timeout 900 timeout -s 0 800 ... are denied.
  2. Keep the passed-on-signal model and fix all five. Stop skipping time between timeouts, model nohup against HUP, credit an outer kill-after behind a passed-on signal, read SIG plus 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.
  3. 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

Activity

  1. added
    decision
    on Sep 29, 2026
  2. ptr727 commented on Sep 29, 2026

    @ptr727
    OwnerAuthor

    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 -s value as no bound, declare nohup with HUP in the README, then one more strict pass and the pull request.

  3. removed
    decision
    on Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions