From f89326c709b43063c413caecf7b2e2c9bb993708 Mon Sep 17 00:00:00 2001 From: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com> Date: Sat, 28 Nov 2026 15:46:35 -0500 Subject: [PATCH] docs(phantom): job-control jobs stay counted; listed programs report no stops --- docs/phantom-processes.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/docs/phantom-processes.md b/docs/phantom-processes.md index a4272dc7d9..acbc311596 100644 --- a/docs/phantom-processes.md +++ b/docs/phantom-processes.md @@ -251,9 +251,12 @@ vfork-safe (Python's subprocess execs under `vfork`). Details that mattered: other parents that watch a child by pidfd or `/proc` would see the forked child end at once, so their children stay. A job in the foreground of its controlling terminal (`TIOCGPGRP` on `/dev/tty`, whatever its standard fds are: `cmd | less`, `less < file`) stays too: a handed-off - program has no controlling terminal, so `/dev/tty`, ^C and job control would miss it. A job - started with `&` runs in a background group, or, from a shell without job control, in the - foreground group reading `/dev/null`, and goes. Steam's client and launch chain (`steam`, its + program has no controlling terminal, so `/dev/tty`, ^C and job control would miss it. A job a + shell with job control runs (any process group other than the shell's, `cmd &` in an interactive + terminal, each member of its pipeline) stays as well: the shell waits for its stops and continues, + which happen to a handed-off program's worker and never reach that wait. A job started with `&` + from a shell without job control (a script, `bash -c`) runs in the shell's group reading + `/dev/null`, and goes. Steam's client and launch chain (`steam`, its web helper, `droiddeck-steam-x64`, `reaper`, `steam-launch-wrapper`, `pw-audio-namespace`, gamescope, anything under `Steam/`) never go this way. In the desktop session (KDE Plasma, 17–19 counted at rest), a Konsole running 40 `sleep 600 &` jobs peaked at @@ -473,6 +476,11 @@ the old behavior and the old requirement. binder) would end it; the session would then fall back to counted processes, which is today's behavior. - OEM ROMs with their own process managers (MIUI/HyperOS, ColorOS) are outside this. +- A listed program's stops and continues (`kill -STOP`, `SIGCONT`) reach its worker, not a wait in + its parent: `waitpid(…, WUNTRACED)` and `WCONTINUED` report none for it. Listed programs are the + session's own (Steam, Wine, game helpers), whose parents start them without job control. Reading + the worker's state from `/proc` instead was tried and dropped: a stop and a continue can both + fall between two reads. ## phantomlab