Bug 291269 - kqueue(2): Panic on cleanup
Summary: kqueue(2): Panic on cleanup
Status: Closed Unable to Reproduce
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 15.0-RELEASE
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords: crash
Depends on:
Blocks:
 
Reported: 2025-11-28 16:45 UTC by Jake Freeland
Modified: 2026-02-24 16:41 UTC (History)
1 user (show)

See Also:


Attachments
New core txt (122.42 KB, text/plain)
2026-02-23 22:45 UTC, Jake Freeland
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jake Freeland freebsd_committer freebsd_triage 2025-11-28 16:45:31 UTC
I am running into an issue when using syncthing (a p2p file sync program) where the system panics when sync starts up. I have run into the bug consistently on 15-RC2 and 16 CURRENT as of a week ago.

The bug seems to be caused by the underlying kqueue memory being freed before the knotes are cleaned up.

Panic dumps are here: https://people.freebsd.org/~jfree/kqueue_panic/
Comment 1 Mark Johnston freebsd_committer freebsd_triage 2025-12-12 18:35:08 UTC
Can you provide any details on your configuration, and how it differs from what comes out of the box?  If I start syncthing in a VM running main I don't get see any problems.
Comment 2 Jake Freeland freebsd_committer freebsd_triage 2025-12-12 19:06:23 UTC
It is running GENERIC with no modifications. Here is some basic system info:

jfreeland@s8047:~ $ uname -a
FreeBSD s8047 16.0-CURRENT FreeBSD 16.0-CURRENT #5 main-n282226-b381d0980221: Fri Nov 28 10:51:38 CST 2025     root@s8047:/usr/obj/home/jfreeland/Repositories/FreeBSD/freebsd-src/amd64.amd64/sys/GENERIC amd64

jfreeland@s8047:~ $ sysctl hw | grep mem
hw.physmem: 205827080192
hw.usermem: 198320107520
hw.realmem: 206152138752
hw.pci.host_mem_start: 2147483648
hw.cbb.start_memory: 2281701376

jfreeland@s8047:~ $ sysctl hw.model
hw.model: AMD EPYC 8324P 32-Core Processor

jfreeland@s8047:~ $ cat /etc/rc.conf
clear_tmp_enable="YES"
hostname="s8047"
ifconfig_igb0="DHCP"
ifconfig_igb0_ipv6="inet6 accept_rtadv"
sshd_enable="YES"
ntpd_enable="YES"
ntpd_sync_on_start="YES"
moused_nondefault_enable="NO"
zfs_enable="YES"
dumpdev="AUTO"
dumpon_flags="-Z"

nginx_enable="YES"

#syncthing_enable="YES"
syncthing_user="jfreeland"
syncthing_group="jfreeland"

jfreeland@s8047:~ $ cat /boot/loader.conf
kern.geom.label.disk_ident.enable="0"
kern.geom.label.gptid.enable="0"
zfs_load="YES"

net.fibs=2
filemon_load="YES"
amdtemp_load="YES"
pwmc_load="YES"
tpm_load="YES"

debug.debugger_on_panic="0"
debug.debugger_on_recursive_panic="1"

jfreeland@s8047:~ $ kldstat
Id Refs Address                Size Name
 1   51 0xffffffff80200000  2185760 kernel
 2    1 0xffffffff82386000     6320 filemon.ko
 3    1 0xffffffff8238d000     7b30 amdtemp.ko
 4    2 0xffffffff82395000     3850 amdsmn.ko
 5    1 0xffffffff82399000     e128 tpm.ko
 6    1 0xffffffff823a8000   789570 zfs.ko
 7    1 0xffffffff82b34000     3540 pwmc.ko
 8    2 0xffffffff82b38000     4008 pwmbus.ko
 9    1 0xffffffff835e6000    2e980 if_bnxt.ko
10    1 0xffffffff83615000     3220 intpm.ko
11    1 0xffffffff83619000     2178 smbus.ko
12    1 0xffffffff8361c000     46a0 if_cdce.ko
13    2 0xffffffff83621000     31d0 uether.ko
14    1 0xffffffff83625000     33c0 if_urndis.ko
15    1 0xffffffff83629000     2a80 mac_ntpd.ko

jfreeland@s8047:~ $ pkg prime-list
aspeed-tool
bash
ccache
claude-code
curl
dmidecode
gdb
gh
git
go
htop
llvm
nflxaccess
nginx
openvpn
pkg
pkg-provides
poudriere-devel
ripgrep
rsync
rust
rust-analyzer
sudo
syncthing
tmux
tpm2-tools
xzaes
Comment 3 Jake Freeland freebsd_committer freebsd_triage 2026-02-23 22:45:35 UTC
Created attachment 268312 [details]
New core txt
Comment 4 Jake Freeland freebsd_committer freebsd_triage 2026-02-23 22:45:41 UTC
After recursively deleting the directory synced by syncthing, this issue no longer occurs. I was able to capture a panic trace with a different stack, so I'll post the top of the core.txt here. Otherwise, I'm going to close this because I can't reproduce it anymore.
Comment 5 Mark Johnston freebsd_committer freebsd_triage 2026-02-24 16:41:01 UTC
(In reply to Jake Freeland from comment #3)
Here we're crashing in vnode_create_vobject_any(), specifically when trying to lock a newly created object.  That's very weird.  It looks like there is some general memory corruption happening.

Is this a VM or hardware?  You might try running a zpool scrub.