A session id collected while the terminal ran is not acted on after its leader is gone (martha#220) #276
Loading…
Reference in a new issue
No description provided.
Delete branch "vesta/220-reap-session-id"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Purpose (real harm): a session id collected while the terminal ran can name a different process group by the time it is acted on.
theCommandsSessionsOfcollected session ids while the terminal ran. The ids are numbers.endTheRunOnAPtythen acts on whateverprocessesInSessionsUnderlists for them, twice with a 10 s grace between. If the session's leader exits and is reaped in that window, the kernel can hand its pid out again, and a process that takes it and callssetsid()leads a new session with the same number. The teardown would then act on a group that never belonged to the run.What changed.
is left for it") and keeps the directory.theCommandsSessionsOfnow collects{ session, leader }(TheRunsSession), with the leader's identity read in the same look while the terminal still runs (identityOf= boot + start ticks), behind a new seamidentityOfTheProcess.endTheRunOnAPtyfilters every look throughstillLedByTheProcessRecorded: a session is the run's while its leader (/proc/<session>, read at teardown time through the newtheLeaderNowseam) isgone, or is held with the recorded identity. Held with another identity,unknown, or never recorded: the session is left alone and not called left. A teardown that finds a recorded session it can no longer place refuses by name ("was taken by another process, so nothing in it was killed:Proof. Both files that import the changed source, through the namespace wrapper on the tip: 20/20 pass. The mutation runs each red by name;
npm run verifypasses..github/workflowsis 0 bytes against the post-268 main, and the private check is clean on both ranges.Refs #220
b478e03f, PR 268) into vesta/220-reap-session-id ae82f1393f