You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Linux: contain descendants that detach faster than the process-tree poll #3
On macOS, a descendant that double-forks and calls setsid before the ~250 ms process-table poll is not tracked and survives remove, exit, shutdown and drop. The documented limit is in docs/adr/native-core.md.
Linux can close the gap with PR_SET_CHILD_SUBREAPER through a per-pane supervisor that reports the program's exit status over a pipe.
Needs a Linux build and tests (the current build host is macOS).
Acceptance: a test that detaches immediately leaves no survivors on Linux.
Facts from the Linux verification of PR #11 (#11) at 3590923, run on p1 (Ubuntu x86_64, Rust 1.99.1):
PR WIP: environment-marker sweep for detached descendants (not for merge yet) #11's test target does not compile on Linux: src/native/tests.rs:1285 uses Command without use std::process::Command; (E0433). cargo test exits 101 with 0 tests run, so the 4 detach tests did not run and this issue's acceptance test is not demonstrated on Linux.
The marker-sweep design (OPENAB_SHEPHERD_PANE found via /proc/<pid>/environ) escapes: env-scrubbing execs (env -i, sudo, su -, login, systemd-run, ssh, and container launchers such as docker run); a process that overwrites its env region; non-dumpable or other-uid (setuid) processes, where the environ read fails silently.
A subreaper would close these cases; the sweep does not.
docs/adr/native-core.md (L357-361) should say the sweep is a mitigation, not a fix. This issue should stay open unless that is accepted.
Status after PR #11 was closed: the marker-sweep approach is not going ahead (see the closing comment there). This stays open at low priority. The smallest candidate is Linux-only: make the pane's leader a child subreaper in pre_exec so detached descendants are reparented to it and the existing parent walk finds them (about 20 lines, to be checked on a Linux host first). Not planned until a field report shows a pane leaving a process behind that matters; under the one-user, one-account model it is not a security issue.
Refs #3. PR #134 scans the process table once per tick instead of once per pane. Idle holder with 8 panes on a Linux x86_64 host: 14.92 to 1.86 percent CPU (300 s). The target of well under 1 percent is not met; the remainder is the floor of one scan per 250 ms tick. The quiet back-off (recommendation 3) and /proc children (recommendation 4) stay as follow-ups. Front restart time is unchanged.
Activity
chaodu-agent commentedon Nov 13, 2026
Facts from the Linux verification of PR #11 (#11) at 3590923, run on p1 (Ubuntu x86_64, Rust 1.99.1):
src/native/tests.rs:1285usesCommandwithoutuse std::process::Command;(E0433).cargo testexits 101 with 0 tests run, so the 4 detach tests did not run and this issue's acceptance test is not demonstrated on Linux.OPENAB_SHEPHERD_PANEfound via/proc/<pid>/environ) escapes: env-scrubbing execs (env -i,sudo,su -,login,systemd-run,ssh, and container launchers such asdocker run); a process that overwrites its env region; non-dumpable or other-uid (setuid) processes, where the environ read fails silently.docs/adr/native-core.md(L357-361) should say the sweep is a mitigation, not a fix. This issue should stay open unless that is accepted.docs: state the marker sweep is a mitigation, list verified escapes
test(native): give the macOS sweep test a child whose env is readable
chaodu-agent commentedon Nov 17, 2026
Status after PR #11 was closed: the marker-sweep approach is not going ahead (see the closing comment there). This stays open at low priority. The smallest candidate is Linux-only: make the pane's leader a child subreaper in
pre_execso detached descendants are reparented to it and the existing parent walk finds them (about 20 lines, to be checked on a Linux host first). Not planned until a field report shows a pane leaving a process behind that matters; under the one-user, one-account model it is not a security issue.chaodu-agent commentedon Nov 17, 2026
Refs #3. PR #134 scans the process table once per tick instead of once per pane. Idle holder with 8 panes on a Linux x86_64 host: 14.92 to 1.86 percent CPU (300 s). The target of well under 1 percent is not met; the remainder is the floor of one scan per 250 ms tick. The quiet back-off (recommendation 3) and /proc children (recommendation 4) stay as follow-ups. Front restart time is unchanged.
fix: keep degraded process-table scans out of the cache and tree pruning
fix: treat unparseable stat lines as failed reads and align docs with…
fix: scan failures prune nothing, exact scan count, precise Linux bound
fix: read the snapshot age after the shared lock, document the degrad…
native: scan the process table once per tick, not once per pane (#134)
chaodu-agent commentedon Nov 19, 2026
Result of the scan-once-per-tick change, merged in #134 (merge commit 1f1f902, head 84ffce4).
Further reduction needs the quiet back-off, which was out of scope for #134. Not started.