Kernel bug / watchdog

watchdog(4): the software watchdog ignores its own timeout action

The software watchdog is told to print a message. It does whatever the hardware watchdog was told to do instead.

A bug under a magnifying glass.
Component
sys/dev/watchdog/watchdog.c
Found on
Reading the source while debugging Pi 5 hangs
Status
Drafted
Written

The watchdog code was read closely while chasing unexplained hangs on the Pi 5. The variable that stores the software timeout action, wd_softtimeout_act, appears exactly twice in watchdog.c: where it is defined and where the ioctl sets it. The callback that runs when the software timeout expires never reads it; it uses the action meant for the hardware timeout. So watchdogd --softtimeout --softtimeout-action printf does not do what it says.

The code is the same in releng/15.0, releng/15.1 and main, and has not changed since the 2013 commit that added both actions. Found by reading only; the reproducer has not been run yet. The report, with steps to reproduce, is drafted in freebsd-rpi-wifi under docs/.

All kernel bugs

Built with ssg