Stop registry writes at exit and the drain at teardown
Draft
XA
2d ago+295+295+012345678901234567890123456789-22-22-01234567890123456789
Intent: Once a process records its exit, it stops writing the lifecycle registry; once its teardown begins, its signal drain stops acting on records.
Failure fixed: After a fork child exited, a late reparent record or a worker still in fork marked it live again in the registry; the adopter's waitpid(-1) hung (#571). A record drained after the guest was unmapped wrote the shim page and crashed the host process (#552, #574). Linux 6.18 reports ECHILD and exits normally.
This PR:
- proc_process_exit marks the exit under the registry flock; later registry writes are refused.
- launch_destroy_guest closes the drain before every unmap.
They replace the earlier exit-time close.
Release builds on 0caec7d:
- O-09: without commit 1, 4/5 reaped children revive (3/3 runs).
late reaped: without commit 1, fails 10/10 runs.test-teardown-signal: without commit 2, SIGSEGV in 5/5 runs.- ASAN, #552's probe: without commit 2, 20 reports per run; 0 with it.
Lanes
Untested: setsid, setpgid, prctl and auto-reap writes, behind the same gate.