Expand description
Out-of-process crash dump monitor for Windows.
§Architecture
Two-process pattern:
- Main process: installs a VEH handler via
crash-handler. On crash, the handler sends the crash context to the monitor over a Unix Domain Socket (IPC viaminidumper). - Monitor process: same binary, launched with
--crash-monitor. Runs a blockingminidumper::Serverthat receives crash contexts and writes .dmp files.
Why out-of-process?
A crash may corrupt the heap or stack. Writing a minidump from inside the crashing
process is unreliable. The monitor runs in a healthy isolated process and can safely
call MiniDumpWriteDump even if the main process is badly corrupted.
§What this catches
- Access violations (
0xC0000005) - Heap corruption detected by heap manager
- Rust panics that abort
- Any exception that reaches the Vectored Exception Handler
§What this does NOT catch
__fastfail(int 0x29, exit code0xC0000409) — the CPU traps directly to the kernel which terminates the process before returning to user mode. VEH is bypassed. Use WERLocalDumpsfor that (already configured viaenable-wer-dumps.reg).
Dump location: C:\CrashDumps\agentmuxsrv\agentmuxsrv-<unix_ts>-<pid>.dmp
Socket path: C:\CrashDumps\agentmuxsrv\monitor.sock
Structs§
- Crash
Dump 🔒Handler - Crash
Handler Guard - Guard that keeps the crash handler installed for the lifetime of the process. Dropping this guard uninstalls the VEH handler.
Constants§
- DUMP_
DIR 🔒 - MSG_
KIND_ 🔒CRASH_ PID - Message kind for sending the crashing process’s PID before a dump request. The monitor stores this PID and uses it in the dump filename.
- SOCKET_
PATH 🔒 - Unix Domain Socket path used for crash-handler IPC.
Functions§
- connect_
with_ 🔒retry - Try to connect to the server socket up to
attemptstimes, sleepingdelaybetween tries. - run_
monitor - Entry point for the monitor process.
- spawn_
and_ attach - Spawn a crash monitor child process and attach the VEH crash handler in this process.