Repository navigation
Add hostSpec.system.crashDiagnostics: evidence for unexpected crashes - #45
Draft
andrewthomaslee wants to merge 1 commit into
Draft
andrewthomaslee wants to merge 1 commit into
andrewthomaslee wants to merge 1 commit into
Conversation
A desktop (kamrui-h1) reset itself with a journal that just stopped: no shutdown, no panic, nothing in pstore, only the AMD firmware's "software wrote 0x6 to reset control register 0xCF9" at the next boot. This module makes the next one explain itself: the kernel log tail goes to pstore on every reboot and panic, a hung kernel panics and reboots, systemd feeds the hardware watchdog, journald syncs every 10 s, a sampler logs load/PSI/memory/temperature, and crash-report writes how the previous boot ended at every boot. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
New opt-in module
hostSpec.system.crashDiagnostics. It makes a machine that crashes, resets or is killed without a shutdown leave evidence. It was prompted by kamrui-h1 resetting itself today: the journal just stopped, nothing landed in pstore, and the only clue was the AMD firmware'ssoftware wrote 0x6 to reset control register 0xCF9at the next boot.What enabling it does (all kernel/journald values are
mkDefault):dmesgOnRebootprintk.always_kmsg_dump=1: kernel log tail to pstore on every kernel reboot/power-off, archived by systemd-pstorepanicOnHangnmi_watchdog=panic softlockup_panic=1panicRebootSecondskernel.panic(default 0 = frozen forever)panicOnOopskernel.panic_on_oopswatchdogTimeout60ssystemd.watchdog.runtimeTime(hardware watchdog)journalSyncInterval10sSyncIntervalSec(default 5 min)samplerkeepReports/var/log/crash-diagnosticscrash-report [-N]reads any boot on demand. kdump (boot.crashDump) is left out on purpose: it drops into a rescue shell.Evidence
journalctl/lastqueries. pstore was empty, panic=0, the watchdog was off, and the last ~40 s of logs were lost.After: the report script run read-only on kamrui-h1's real journal:
verdict clean: System is powering down./reset … ACPI power state transition occurred.vm-test crash-diagnostics: passed (5 subtests). They cover kernel/journald/watchdog settings (i6300esb), no report on the first boot, sampler lines, a clean shutdown →clean, andmachine.crash()→UNCLEANwith sampler lines in the report, pluscrash-report -1/-2/--list. The first run failed because a oneshot withoutRemainAfterExitgoes inactive andwait_for_unitcan't see it; that's fixed.fmt: no changes.nix flake check: all checks passed (incl.eval-all-enabled,treefmt/shellcheck, docs,vm-tests-eval).Merge Danger
Door: two-way
Off until a machine sets
hostSpec.system.crashDiagnostics.enable. Disabling it reverts every setting. Reports and pstore archives are plain files.Blast Radius: opt-in
Once enabled on a machine: a kernel hang now panics and reboots after 10 s instead of freezing (intended). The hardware watchdog resets the machine if systemd is stuck for 60 s. Each kernel reboot writes a few EFI variables (deleted again by systemd-pstore at boot). The sampler adds about 2,900 short journal lines a day. No consumer changes: home enables it per machine in its own PR after this merges and
nix flake update modules.🤖 Generated with Claude Code