DF-2845 / build.log
# DF-2845 โ build.log (reconstructed from the orchestrating session's captured output)
The guest wedged in ddb after the INVARIANTS panic run before /tmp/kbuild*.log
could be re-fetched over ssh; the lines below are the verbatim command outputs
captured by the audit session that drove the builds.
## Trigger code โ KLD variant (first attempt; NOT loadable on this snapshot)
$ cd /root/baddrain && sh build.sh
cc -O2 -pipe -D_KERNEL -Wall -Wredundant-decls -Wnested-externs
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual
-Wold-style-definition -Wmissing-include-dirs -Wno-pointer-sign -Winit-self
-Wundef -Wno-unused-but-set-variable -std=gnu11 -Werror -DKLD_MODULE
-nostdinc [...] -c baddrain.c
cc -Wl,--build-id=sha1 -nostdlib -Wl,--hash-style=sysv -r -Wl,-d -o baddrain.ko baddrain.o
-rw-r--r-- 1 root wheel 5104 Sep 2 07:28 baddrain.ko
NOTE: kldload of ANY module freshly built by this snapshot's toolchain
(cc 8.3 [DragonFly] 2019) crashes the prebuilt Jul-2026 kernel's module
loader (Fatal trap 9 GPF at strcmp+0x10 during linker metadata parse,
before MOD_LOAD runs; a minimal hello-world KLD does the same). Stock
/boot/kernel/*.ko modules load fine. The PoC was therefore compiled
INTO custom kernels instead โ see df2845_test.c.
## Kernel builds (in-guest, native toolchain)
$ cd /usr/src && make nativekernel KERNCONF=DF2845_NOINV -j6 [unpatched, no INVARIANTS]
BUILD_RC=0
--------------------------------------------------------------
>>> Kernel build for DF2845_NOINV completed on Wed Sep 2 07:47:26 UTC 2026
--------------------------------------------------------------
$ cp /usr/obj/usr/src/sys/DF2845_NOINV/kernel.stripped /boot/kernel/kernel
INSTALLED-NOINV
(booted: DragonFly 6.5-DEVELOPMENT #0: Wed Sep 2 07:44:03 UTC 2026
root@dfbsd:/usr/obj/usr/src/sys/DF2845_NOINV x86_64)
$ cd /usr/src && patch -p0 < /root/fix.diff [fix applied to sys/kern/subr_sbuf.c]
Hunk #1 succeeded at 333. done
$ make nativekernel KERNCONF=DF2845_NOINV -j6 [patched, no INVARIANTS]
BUILD_RC=0
INSTALLED-FIXED
(booted: DragonFly 6.5-DEVELOPMENT #1: Wed Sep 2 07:54:44 UTC 2026)
$ cd /usr/src && patch -R -p0 < /root/fix.diff [reverted]
$ make nativekernel KERNCONF=DF2845_INV -j6 [unpatched, WITH INVARIANTS]
BUILD_RC=0
INSTALLED-INV
(booted and panicked on trigger at ~08:09 UTC 2026)