Skip to content

Ubuntu 26.04's uutils timeout -k never sends its KILL to the process group, so a bounded command can wait out a child that survives TERM, and setup-python has no Python 3.9 there; CI runs on ubuntu-24.04 until both are handled #297

Open

Description

@brettheap

Filed by lane openRepoTools-3 on Brett Heap's word of 2026-10-21T12:0xZ: "yes, file the 26.04 issue in v1.2.0". Line numbers are at main acc89ea.

What happens

GitHub is moving ubuntu-latest to Ubuntu 26.04 (actions/runner-images#14748, rolled out from 2026-10-19 to 2026-11-19). This repository's jobs first ran there at 04:33Z on 2026-10-21; a run at 03:59Z still got 24.04.

Main's nightly run 39544671103, at a42946e, failed on 26.04 in three jobs:

  • package: setup-python says "The version '3.9' with architecture 'x64' was not found for Ubuntu 26.04." The release workflow's install check has the same 3.9 leg, so a tag's release run would fail the same way.
  • tests and tests-no-submodule: each fails one test, tests/test_claude_current.py::test_a_command_that_ignores_term_is_killed_after_the_grace[host], with "KILL never came: 30.0s". The [watchdog] case passes.

#296 pins every Ubuntu runner in tests.yml and release.yml to ubuntu-24.04, so CI no longer sees either problem. This issue is for supporting 26.04 itself.

Why the kill test fails: 26.04's timeout is uutils, and its -k KILL never reaches the process group

The binary. On ubuntu:26.04 (26.04.1), timeout --version prints timeout (uutils coreutils) 0.10.0.

  • /usr/bin/timeout belongs to coreutils-from-uutils, and links to rust-coreutils 0.10.0-1ubuntu2~26.04.1.
  • 0.8.0, the version 26.04 shipped with, behaves the same.
  • The runner image lists the same coreutils metapackage, and its failure signature is identical.

What it does. uutils timeout makes itself a process-group leader, and at the bound it sends TERM to its child and to its group, as GNU does. But its -k KILL goes to the direct child only.

  • uucore::process::ChildExt::send_signal_group (src/uucore/src/lib/features/process/unix.rs) first calls signal(sig, SIG_IGN), so that timeout does not signal itself.
  • For SIGKILL that call fails with EINVAL, and the ? returns before kill(0, SIGKILL).
  • platform::send_signal (src/uu/timeout/src/platform/unix.rs) then discards the error with let _ =.
  • The code is the same in 0.10.0, 0.11.0, 0.12.0 and main (read on 2026-10-21). No upstream issue for it was found.

strace of timeout -k 2 1 bash -c 'trap "" TERM; sleep 20; :', with its output captured:

uutils: T+1.045 kill(2951,SIGTERM); kill(0,SIGTERM); kill(2951,SIGCONT); kill(0,SIGCONT)
        T+3.048 kill(2951,SIGKILL)        <- only the child; exit_group(137) at T+3.050
        rt_sigaction(SIGKILL,{SIG_IGN}) = -1 EINVAL      <- no kill(0,SIGKILL) follows
        T+20.157 pid 2952 (the sleep) exit_group(0); the $(...) returned at 20.166
GNU 9.7: T+3.025 kill(2965,SIGKILL); kill(0,SIGKILL)     <- group KILL, so everything dies

In the test. The fake npm does trap '' TERM, so its sleep 30 inherits the ignored TERM and the group TERM does nothing. At 6 s the KILL ends only the bash child. The orphaned sleep still holds the pipe's write end, so view_out="$(…)" reads until EOF, at 30 s.

Measured, in seconds, on Eagle (Ubuntu 24.04, GNU 9.4) and in ubuntu:26.04 (uutils 0.10.0):

shape GNU 9.4 uutils 0.10.0
the test's fake npm, TERM ignored, -k 5, 1 s bound, output captured 6.003 30.010
claude-current's run_bounded, host-timeout branch, TERM ignored 6.003 30.024
run_bounded, plain TERM 1.003 1.008
run_bounded, watchdog branch, TERM ignored 6.020 6.035
real npm view (npm 12.0.2) against a stalled registry, 3 s bound 3.014 3.016
the real test, [host] passes fails, 30.1 s

With timeout pointed at GNU's gnutimeout first on PATH, the real test passes on 26.04 (2 passed in 12.48s).

Who it affects

  • On a 26.04 host, claude-current gives the right answer, late. It still reports unverified with "npm view took longer than 1s". But the launch sits silent for as long as a descendant that survives TERM and holds stdout stays alive.

  • A plain TERM at the bound behaves as before, and a single process that ignores TERM is still ended by the direct KILL.

  • Real npm view is one process, and a stalled registry still ends at the bound. Default setups are unlikely to see this. A CLAUDE_CURRENT_NPM wrapper with a TERM trap would.

  • The same timeout -k pattern is used at three more places:

    • lanes-edit.sh:2022 (git);
    • lanes-edit.sh:2610 (an export);
    • lane-start:4240 (git).

    They have the same gap. Only the claude-current test is known to fail.

What to do

  1. claude-current's run_bounded (:231-233) picks its bound by what it can do. It takes timeout only when the first line of timeout --version says GNU coreutils, then gtimeout, then gnutimeout, then the existing watchdog. It caches the answer once per run.
    • An allow-list is safer than a "not uutils" deny-list.
    • Every uutils host has /usr/bin/gnutimeout: coreutils-from-uutils pre-depends on gnu-coreutils (9.7 on 26.04).
  2. The three other call sites get the same choice, ideally from one shared helper.
  3. A test fakes a timeout whose --version says uutils, and asserts that the GNU or the watchdog path is taken.
  4. Python 3.9 on 26.04. setup-python has none there. Decide whether the 3.9 legs stay on 24.04 or move to a runner that has 3.9. requires-python stays as it is unless Brett Heap decides otherwise.
  5. CI runs on both 24.04 and 26.04, so that a -latest move cannot hide this again. Then decide which pins to keep.
  6. CI and the release workflow run on ubuntu-24.04, because ubuntu-latest is now Ubuntu 26.04, where setup-python has no Python 3.9 and the TERM-ignoring kill test fails #296's review follow-ups (CI and the release workflow run on ubuntu-24.04, because ubuntu-latest is now Ubuntu 26.04, where setup-python has no Python 3.9 and the TERM-ignoring kill test fails #296 6315434254):
    • R1: specs/006-release-pypi/contracts/workflows.md:40 and :360, and the docstring at tests/test_tests_workflow.py:852-853, still say the existing jobs keep their runner.
    • R2: no test pins the runs-on of release.yml's build, testpypi and pypi.
    • R3: the comments say ubuntu-latest "became Ubuntu 26.04 on 2026-10-21". Cite #14748's window, and give 10-21 as this repository's first run there.
    • R4: release.yml's comment should give its own reasons for the pin: the 3.9 install leg, and building on the image its gate and rc1 ran on.
  7. Optional: the watchdog costs 5 s extra on a plain hang, because wait "$dog" waits out the grace. It could end as soon as the group is gone.
  8. Optional, only on Brett Heap's word: report the one-line bug to uutils upstream. The fix is to skip the SIG_IGN step for SIGKILL.

Related

Lane: openRepoTools-3

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions