#17

Attribute crashes of reaped process trees in all cases

Opensahiljagtap08opened 15d ago

Where it stands

The crash watch (crates/drumsd-linux/src/crashwatch.rs) attributes every crash-signal exit on the host to the slot cgroup it ran in, so the no_app_crash gate can fail exactly the episode whose app crashed. The chain is: the dead task's own cgroup from /proc, else its parent's, else the census of slot cgroups (every 200 ms, kept 10 s), else the census entry of its parent, else the cgroup remembered for a plain exit of the parent seen moments before, else nothing.

When a whole tree is torn down at once (a Chrome browser with its zygote and renderers, or an env being closed), the kernel reports the exits in any order and /proc, the census and the remembered exits can all miss the crashing task. Such a crash is unattributed.

The rule today (fail closed)

An unattributed crash counts against every episode whose tree ran Chrome in the last fresh census pass; it is recorded as crash_not_counted for the others. With no fresh census (older than CENSUS_FRESH_S), or no Chrome anywhere, it counts against every episode running at that moment, and so does a stretch of events the kernel dropped (ENOBUFS). A crash is never silently treated as nobody's.

This is correct for training (no reward from a crashed desktop is handed out as valid) but costs throughput: one crash in one env can invalidate unrelated episodes on the host. Measured history: T6 checker validation (before the census, 279 child episodes invalidated by one crash); T2b W1p (one unattributed SIGTRAP of a Chrome process in an env being closed marked every running episode incomplete; fixed for that case by the remembered-exit step in fe3291c). /v1/health crash_watch.attributed counts how each crash was placed.

What is wanted

Attribution that cannot miss: for example, the slot id carried by the kernel event itself (a BPF program on sched_process_exit reading the task's cgroup id before the task is gone, instead of the process events connector plus a race against reaping), or a per-slot exit recorder inside the slot's pid namespace. Then no_app_crash fails only the episode that crashed, and the host-wide fallback is reached only when the watch itself is down.

Until then the fail-closed rule stays, and SECURITY.md lists it as a known limitation.

Activity

0

No activity yet.