8000 BOX exec follow-ups from T31's review (#2874): group-kill test, pidfd session kill, non-tty descendants, attached exec ids · Issue #2978 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

BOX exec follow-ups from T31's review (#2874): group-kill test, pidfd session kill, non-tty descendants, attached exec ids #2978

Open

Description

@mitodrummer

Follow-ups from the maintainer's pre-merge review of T31 (#2874, BOX-150..153). None of them blocks T31.

  • stop_exec_ends_process_group proves less than its name (crates/minimald/src/exec/tests.rs ~3790). The script's own trap runs kill -TERM 0, and the daemon side only SIGTERMs the leader through TokioProcess::shim's start_kill. So the "group member gone" assertion passes even with no group signal. Make the test rely on the daemon's group kill.
  • PID reuse in signal_session (crates/minimald/src/nsenter.rs ~1237–1253). It reads /proc/<pid>/stat and then calls kill(pid). A member that exits and whose pid is recycled between the scan and the kill gets someone else's signal. Use pidfd_open, re-check the session, then pidfd_send_signal.
  • Non-tty execs only get the group kill. A child of an attached or detached exec that calls setpgid without setsid survives a stop. That is looser than architecture.md line 497 ("children it did not detach into their own session"). Enumerating by session isn't safe here, because these execs share the shim's session. Track the exec's descendants (a cgroup or a pid list) instead.
  • The gate fails open on a wrongly typed value. stored_spec_disables_exec (exec/process.rs ~1151) treats exec_enabled: "false", 0, or a non-object io as enabled. BOX: add [io] exec_enabled to mfile's IoSpec so a box can turn exec off (BOX-153 residual of T31) #2973 makes the field a bool, so this closes with it, but the gate can fail closed now.
  • Attached exec ids:
    • attaching says "Read its output with min://exec/output", but no transcript exists for an attached exec;
    • every attached exec keeps an EXECS entry and an execs/ dir until the box is reaped, which grows on a long-lived box.
  • Test gaps: exec_disabled_refuses_exit5 leaves out tty mode, and the detached half of pty_or_detached_exec_survives_client_loss never drops a client.
  • Pre-existing: Shell/Argv execs get an exec id but write no exec_started/exec_exited events and can't be stopped.
  • Detached exec descendants get SIGPIPE after the 1 s drain and pump.abort() (exec/process.rs ~1346). This trade-off is accepted, but architecture.md says "a setsid'd process survives the exec", so note it there.

Activity

  1. mitodrummer commented on Nov 4, 2026

    @mitodrummer
    MemberAuthor
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

      0