R31 — kill -9 "${EMU_PID:-0}" signals the whole process group if EMU_PID is ever empty #40

Closed
opened 2026-08-23 03:44:54 +00:00 by JMR-dev · 1 comment
JMR-dev commented 2026-08-23 03:44:54 +00:00 (Migrated from github.com)

Finding R31 from the overnight max-effort review (Fable lead, Opus sub-agents). Full report: scratchpad/overnight/REVIEW.md.

R31 — kill -9 "${EMU_PID:-0}" signals the whole process group if EMU_PID is ever empty

severity: low
verdict: PLAUSIBLE
where: tools/local-emulator/run-e2e.sh:199-200 (main) / :346-347 (branch)
scenario: POSIX: pid 0 = sender's whole process group. EMU_PID=$! is empty (not unset) if the background launch failed to create a job; :-0 converts empty to the group-kill form. The kill -0 wait loop has the same shape and would burn its full 30s against the group.
evidence: Code read; the empty-EMU_PID precondition not demonstrable without running the script.
fix: [ -n "${EMU_PID:-}" ] || return 0 at the top of stop_emulator; drop the :-0 defaults.
risk: None; strictly narrowing.


Cut: above — worked autonomously overnight.

🤖 Generated with Claude Code

_Finding **R31** from the overnight max-effort review (Fable lead, Opus sub-agents). Full report: `scratchpad/overnight/REVIEW.md`._ ### R31 — kill -9 "${EMU_PID:-0}" signals the whole process group if EMU_PID is ever empty severity: low verdict: PLAUSIBLE where: tools/local-emulator/run-e2e.sh:199-200 (main) / :346-347 (branch) scenario: POSIX: pid 0 = sender's whole process group. EMU_PID=$! is empty (not unset) if the background launch failed to create a job; :-0 converts empty to the group-kill form. The kill -0 wait loop has the same shape and would burn its full 30s against the group. evidence: Code read; the empty-EMU_PID precondition not demonstrable without running the script. fix: [ -n "${EMU_PID:-}" ] || return 0 at the top of stop_emulator; drop the :-0 defaults. risk: None; strictly narrowing. --- **Cut:** `above` — worked autonomously overnight. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
JMR-dev commented 2026-08-23 05:21:39 +00:00 (Migrated from github.com)

Fixed in #47 (merged). Validated with two stub harnesses rather than a sweep — shellcheck is not installed on this host, and no emulator was booted.

Fixed in #47 (merged). Validated with two stub harnesses rather than a sweep — shellcheck is not installed on this host, and no emulator was booted.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: JMR-dev/LibreMediaConverter#40