⬢ DragonFlyBSD Kernel Audit
DF-5563 / run_f3.sh
← back to finding ↓ download raw
#!/bin/sh
# DF-5565 baseline reproduction: IIC_DONTWAIT requester with a busy
# bridge callback spins forever in the first do-while of
# iicbus_request_bus (iiconf.c:92-97): no sleep, no yield, no signal
# checkpoint.  kill -9 is ignored; CPU time accrues in kernel mode.
# Non-destructive: clearing hw.df5563.busy ends the loop.
set -e
cd /root/df5563

echo "=== load chain ==="
kldload /usr/src/sys/bus/iicbus/iicbus/iicbus.ko
kldload /boot/kernel/iicbb.ko
kldload /usr/obj/root/df5563/build_reg/iicbb_reg.ko
kldload /usr/obj/root/df5563/build_rig/df5563_rig.ko
sleep 1

echo "=== launch a DONTWAIT requester while the bridge is busy ==="
sysctl hw.df5563.busy=1
./park nowait &
PARK=$!
sleep 3
ps -o pid,stat,time,command -p $PARK || true
sleep 3
echo "--- 3s later (watch TIME grow; STAT stays RUN; never sleeps) ---"
ps -o pid,stat,time,command -p $PARK || true

echo "=== kill -9 it (expect: IGNORED -- no signal checkpoint in the loop) ==="
kill -9 $PARK
sleep 3
ps -o pid,stat,time,command -p $PARK && echo "SIGKILL IGNORED (stuck in kernel loop)" || echo "process died"

echo "=== unbusy the bridge: loop exits on the next callback ==="
sysctl hw.df5563.busy=0
sleep 3
ps -o pid,stat,command -p $PARK || echo "park process gone (loop exited)"