code wiki / (root) / nx_vsz_watchdog_gate.nx

nx_vsz_watchdog_gate.nx

buildroot/runtime/nx_vsz_watchdog_gate.nx

5328 B95 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind gate/prooftopic vsz
docsdependenciesstructsconstsfunctions

about

nx_vsz_watchdog_gate.nx -- gate for the VSZ-watchdog CORE (outage MODE 2 permanent fix). Teeth: conf-row parsing (comment/blank/malformed/zero-gb all DROPPED fail-safe), VmSize parse from a real-format status fixture, the kill decision (below-threshold / unknown-vsz / cooldown-active all -> NO KILL; only sane+over+ cooled -> kill), needle containment, and LIVE /proc/self reads (selfpid>0, own VmSize>0). The CLI's walk+kill is deliberately NOT exercised here (killing real pids in a gate = reckless); the live kill path is proven on the NAS against a synthetic mmap-pig. license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_vsz_watchdog_core.nx nx_vsz_watchdog_gate.nx

imports: nx_syscalls.nxnx_vsz_watchdog_core.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap g_puts sys_write g_scpy vw_parse_row sys_mmap ↻ vw_num_at sys_munmap vw_slen g_chk g_puts ↻ vw_vmsize_parse vw_status_kb vw_slen ↻ sys_mmap ↻ vw_num_at ↻ sys_munmap ↻ vw_should_kill vw_contains vw_selfpid sys_mmap ↻ vw_read sys_openat_rd sys_read sys_close sys_munmap ↻ vw_num_at ↻ vw_vmsize_kb_of vw_status_kb_of sys_mmap ↻ vw_read ↻ sys_munmap ↻ vw_status_kb ↻ g_putn sys_write ↻ sys_mmap ↻

structs

none

consts

none

functions

10func g_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 2: g_chkmain calls 1: sys_write
11func g_putn(v: i64) -> i64
called by 1: main calls 2: sys_writesys_mmap
21func g_chk(st: *i64, ok: i64, label: *u8) -> i64
called by 1: main calls 1: g_puts
26func g_scpy(dst: *u8, src: *u8) -> i64 { var i: i64 = 0; while src[i] != (0 as u8) { dst[i] = src[i]; i = i + 1 } dst[i] = 0 as u8; return i }
called by 1: main
28func main() -> i64