panic: vrele: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 36116 95436 32767 0x10 0x4000000 1 syz-executor.0 *131604 44465 32767 0x10 0x4000000 0K syz-executor.1 db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff82460f22) at panic+0x15e sys/kern/subr_prf.c:218 vrele(fffffd806e599328) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000256d6020,3,ffff8000ffff4000) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e77e130,40287401,ffff8000256d6020,3,fffffd807f7b7ae0,ffff8000ffff4000) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd8066858608,40287401,ffff8000256d6020,ffff8000ffff4000) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000ffff4000,ffff8000256d6130,ffff8000256d6180) at sys_ioctl+0x4b0 syscall(ffff8000256d6200) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256d6200) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x462ab90a70, count: 6 https://www.openbsd.org/ddb.html describes the minimum info required in bug reports. Insufficient info makes it difficult to find and fix bugs. ddb{0}> ddb{0}> set $lines = 0 ddb{0}> set $maxwidth = 0 ddb{0}> show panic vrele: v_writecount != 0 ddb{0}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff82460f22) at panic+0x15e sys/kern/subr_prf.c:218 vrele(fffffd806e599328) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000256d6020,3,ffff8000ffff4000) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e77e130,40287401,ffff8000256d6020,3,fffffd807f7b7ae0,ffff8000ffff4000) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd8066858608,40287401,ffff8000256d6020,ffff8000ffff4000) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000ffff4000,ffff8000256d6130,ffff8000256d6180) at sys_ioctl+0x4b0 syscall(ffff8000256d6200) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256d6200) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x462ab90a70, count: -9 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff8000256d5a60 rbx 0xffff8000256d5a70 rdx 0x8b rcx 0x2 rax 0x1 r8 0xffffffff81ea78f5 kprintf+0x145 r9 0x1 r10 0xf8d079e25073add6 r11 0x85cc66fc86e7de97 r12 0x3000000008 r13 0xffff8000256d5b10 r14 0x100 r15 0x1 rip 0xffffffff8184d248 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000256d5a50 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.1) pid=131604 stat=onproc flags process=10 proc=4000000 pri=32, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff8000ffff5260,0xffff8000ffff4fd0 process=0xffff8000ffff2a50 user=0xffff8000256d1000, vmspace=0xfffffd807effa170 estcpu=36, cpticks=2, pctcpu=0.0 user=0, sys=2, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 95436 126337 97939 32767 2 0x10 syz-executor.0 95436 36116 97939 32767 7 0x4000010 syz-executor.0 44465 226414 89745 32767 2 0x10 syz-executor.1 *44465 131604 89745 32767 7 0x4000010 syz-executor.1 52872 250945 0 0 3 0x14200 bored sosplice 89745 127278 52788 32767 2 0x490 syz-executor.1 52788 22440 382 0 3 0x82 wait syz-executor.1 97939 411144 82917 32767 2 0x490 syz-executor.0 82917 244446 382 0 3 0x82 wait syz-executor.0 382 342060 26401 0 3 0x82 thrsleep syz-fuzzer 382 448537 26401 0 3 0x4000082 thrsleep syz-fuzzer 382 264773 26401 0 3 0x4000082 thrsleep syz-fuzzer 382 456009 26401 0 3 0x4000082 thrsleep syz-fuzzer 382 88405 26401 0 3 0x4000082 thrsleep syz-fuzzer 382 396443 26401 0 3 0x4000082 thrsleep syz-fuzzer 382 213612 26401 0 3 0x4000082 kqread syz-fuzzer 382 493877 26401 0 3 0x4000082 thrsleep syz-fuzzer 26401 516050 66824 0 3 0x10008a sigsusp ksh 66824 99693 49376 0 3 0x92 select sshd 84469 337881 1 0 3 0x100083 ttyin getty 49376 131198 1 0 3 0x80 select sshd 70442 312875 81570 73 2 0x100090 syslogd 81570 499078 1 0 3 0x100082 netio syslogd 84182 323662 1 77 3 0x100090 poll dhclient 56087 399493 1 0 3 0x80 poll dhclient 42183 459791 0 0 3 0x14200 bored smr 17110 79522 0 0 2 0x14200 zerothread 86292 440284 0 0 3 0x14200 aiodoned aiodoned 43775 206947 0 0 3 0x14200 syncer update 62065 309760 0 0 3 0x14200 cleaner cleaner 13505 323007 0 0 3 0x14200 reaper reaper 97598 514278 0 0 3 0x14200 pgdaemon pagedaemon 2231 379639 0 0 3 0x14200 bored crynlk 68563 420534 0 0 3 0x14200 bored crypto 14584 301730 0 0 3 0x14200 bored viomb 87237 207786 0 0 3 0x40014200 acpi0 acpi0 52512 74886 0 0 3 0x40014200 idle1 89107 480458 0 0 3 0x14200 bored softnet 3390 472967 0 0 3 0x14200 bored systqmp 28578 320700 0 0 3 0x14200 bored systq 6295 349215 0 0 3 0x40014200 bored softclock 89796 300442 0 0 3 0x40014200 idle0 1 38551 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 44465 (syz-executor.1) thread 0xffff8000ffff4000 (131604) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff828cdd98) #0 witness_lock+0x4b0 stacktrace_save sys/sys/stacktrace.h:36 [inline] #0 witness_lock+0x4b0 sys/kern/subr_witness.c:1182 #1 vn_ioctl+0x40 sys/kern/vfs_vnops.c:514 #2 sys_ioctl+0x4b0 #3 syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] #3 syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 #4 Xsyscall+0x128 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 9479 6350K 6350K 78643K 10572 0 pcb 13 8K 8K 78643K 13 0 rtable 105 3K 3K 78643K 234 0 ifaddr 39 10K 10K 78643K 46 0 counters 44 34K 34K 78643K 46 0 ioctlops 0 0K 2K 78643K 16 0 mount 1 1K 1K 78643K 1 0 vnodes 1216 76K 76K 78643K 1239 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 1K 78643K 2 0 VM map 2 1K 1K 78643K 2 0 sem 12 1K 1K 78643K 21 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 8 25K 33K 78643K 133 0 proc 48 50K 83K 78643K 415 0 subproc 34 2K 2K 78643K 51 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 18 0 in_multi 33 2K 2K 78643K 44 0 ether_multi 1 0K 0K 78643K 1 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 37 175K 175K 78643K 37 0 exec 0 0K 2K 78643K 341 0 pagedep 1 8K 8K 78643K 1 0 inodedep 1 32K 32K 78643K 1 0 newblk 1 0K 0K 78643K 1 0 VM swap 7 26K 26K 78643K 7 0 UVM amap 164 28K 29K 78643K 1025 0 UVM aobj 8 2K 2K 78643K 8 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 4 0 NDP 5 0K 0K 78643K 12 0 temp 76 3975K 4039K 78643K 2112 0 kqueue 3 4K 8K 78643K 9 0 SYN cache 2 16K 16K 78643K 2 0 ddb{0}> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle arp 64 8 0 2 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 120 26 0 24 1 0 1 1 0 8 0 rtentry 112 56 0 12 2 0 2 2 0 8 0 unpcb 120 54 0 46 1 0 1 1 0 8 0 syncache 296 4 0 4 1 1 0 1 0 8 0 tcpqe 32 490 0 490 1 1 0 1 0 8 0 tcpcb 736 18 0 12 1 0 1 1 0 8 0 inpcb 304 82 0 75 1 0 1 1 0 8 0 nd6 48 9 0 3 1 0 1 1 0 8 0 kcovpl 48 3 0 1 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 233 0 44 12 0 12 12 0 8 0 art_table 32 234 0 44 2 0 2 2 0 8 0 art_node 16 55 0 15 1 0 1 1 0 8 0 semupl 112 7 0 7 1 1 0 1 0 8 0 semapl 112 11 0 1 1 0 1 1 0 8 0 shmpl 112 5 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1512 0 115 88 0 88 88 0 8 0 ffsino 272 1512 0 115 94 0 94 94 0 8 0 nchpl 144 1839 0 254 60 0 60 60 0 8 0 uvmvnodes 72 1572 0 0 29 0 29 29 0 8 0 vnodes 224 1572 0 0 93 0 93 93 0 8 0 namei 1024 4577 0 4577 2 1 1 1 0 8 1 percpumem 16 34 0 1 1 0 1 1 0 8 0 scxspl 216 5330 0 5330 9 1 8 8 0 8 8 plimitpl 152 22 0 12 1 0 1 1 0 8 0 sigapl 424 319 0 285 4 0 4 4 0 8 0 futexpl 56 917 0 917 1 0 1 1 0 8 1 knotepl 112 81 0 61 1 0 1 1 0 8 0 kqueuepl 168 93 0 90 1 0 1 1 0 8 0 pipepl 336 78 0 67 2 0 2 2 0 8 0 fdescpl 496 302 0 285 3 0 3 3 0 8 0 filepl 152 1337 0 1233 6 1 5 5 0 8 1 lockfpl 104 7 0 6 1 0 1 1 0 8 0 lockfspl 48 4 0 3 1 0 1 1 0 8 0 sessionpl 144 18 0 8 1 0 1 1 0 8 0 pgrppl 48 18 0 8 1 0 1 1 0 8 0 ucredpl 96 72 0 63 1 0 1 1 0 8 0 zombiepl 144 285 0 285 2 1 1 1 0 8 1 processpl 1080 319 0 285 5 2 3 3 0 8 0 procpl 672 448 0 405 4 0 4 4 0 8 0 sosppl 168 4 0 4 1 0 1 1 0 8 1 sockpl 432 162 0 145 4 1 3 3 0 8 1 mcl16k 16384 2 0 0 1 0 1 1 0 8 0 mcl9k 9216 1 0 0 1 0 1 1 0 8 0 mcl8k 8192 1 0 0 1 0 1 1 0 8 0 mcl4k 4096 2 0 0 1 0 1 1 0 8 0 mcl2k 2048 177 0 0 22 0 22 22 0 8 0 mtagpl 96 1 0 0 1 0 1 1 0 8 0 mbufpl 256 214 0 0 14 1 13 14 0 8 0 bufpl 280 3342 0 173 227 0 227 227 0 8 0 anonpl 24 50341 0 31357 146 2 144 144 0 186 5 amapchunkpl 152 2036 0 1496 26 1 25 26 0 158 1 amappl16 200 1198 0 289 48 0 48 48 0 8 0 amappl15 192 3 0 1 1 0 1 1 0 8 0 amappl14 184 24 0 20 1 0 1 1 0 8 0 amappl13 176 32 0 29 1 0 1 1 0 8 0 amappl12 168 30 0 27 3 2 1 1 0 8 0 amappl11 160 57 0 45 1 0 1 1 0 8 0 amappl10 152 75 0 66 1 0 1 1 0 8 0 amappl9 144 309 0 308 1 0 1 1 0 8 0 amappl8 136 140 0 103 2 0 2 2 0 8 0 amappl7 128 247 0 239 1 0 1 1 0 8 0 amappl6 120 110 0 100 1 0 1 1 0 8 0 amappl5 112 433 0 416 1 0 1 1 0 8 0 amappl4 104 276 0 247 1 0 1 1 0 8 0 amappl3 96 122 0 115 1 0 1 1 0 8 0 amappl2 88 1572 0 1496 3 1 2 3 0 8 0 amappl1 80 17236 0 16728 25 14 11 20 0 8 0 amappl 88 755 0 641 3 0 3 3 0 92 0 dma4096 4096 1 0 1 1 1 0 1 0 8 0 dma1024 1024 1 0 0 1 0 1 1 0 8 0 dma256 256 6 0 6 1 1 0 1 0 8 0 dma128 128 253 0 253 1 1 0 1 0 8 0 dma64 64 6 0 6 1 1 0 1 0 8 0 dma32 32 7 0 7 1 1 0 1 0 8 0 dma16 16 18 0 17 1 0 1 1 0 8 0 aobjpl 64 7 0 0 1 0 1 1 0 8 0 uaddrrnd 24 302 0 285 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 302 0 285 1 0 1 1 0 8 0 vmmpekpl 168 6280 0 6258 2 0 2 2 0 8 0 vmmpepl 168 47225 0 44842 135 2 133 133 0 357 29 vmsppl 368 301 0 285 2 0 2 2 0 8 0 rwobjpl 56 12300 0 10652 28 4 24 25 0 8 0 pdppl 4096 611 0 570 57 16 41 45 0 8 0 pvpl 32 164028 0 141501 220 1 219 220 0 265 8 pmappl 232 301 0 285 2 1 1 2 0 8 0 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 304 0 20 9 0 9 9 0 8 0 ddb{0}> machine ddbcpu 0 Invalid cpu 0 ddb{0}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff82460f22) at panic+0x15e sys/kern/subr_prf.c:218 vrele(fffffd806e599328) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000256d6020,3,ffff8000ffff4000) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e77e130,40287401,ffff8000256d6020,3,fffffd807f7b7ae0,ffff8000ffff4000) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd8066858608,40287401,ffff8000256d6020,ffff8000ffff4000) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff8000ffff4000,ffff8000256d6130,ffff8000256d6180) at sys_ioctl+0x4b0 syscall(ffff8000256d6200) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256d6200) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x462ab90a70, count: -9 ddb{0}> machine ddbcpu 1 Stopped at x86_ipi_db+0x1a: addq $0x8,%rsp x86_ipi_db(ffff800020d68ff0) at x86_ipi_db+0x1a sys/arch/amd64/amd64/db_interface.c:352 x86_ipi_handler() at x86_ipi_handler+0xb7 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x23 __mp_lock(ffffffff828cdb90) at __mp_lock+0x122 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff828cdb90) at __mp_lock+0x122 sys/kern/kern_lock.c:147 sys_futex(ffff8000ffff4fc0,ffff8000256dc020,ffff8000256dc070) at sys_futex+0xf6 sys/kern/sys_futex.c:109 syscall(ffff8000256dc0f0) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256dc0f0) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa521067a360, count: 8 ddb{1}> trace x86_ipi_db(ffff800020d68ff0) at x86_ipi_db+0x1a sys/arch/amd64/amd64/db_interface.c:352 x86_ipi_handler() at x86_ipi_handler+0xb7 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x23 __mp_lock(ffffffff828cdb90) at __mp_lock+0x122 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff828cdb90) at __mp_lock+0x122 sys/kern/kern_lock.c:147 sys_futex(ffff8000ffff4fc0,ffff8000256dc020,ffff8000256dc070) at sys_futex+0xf6 sys/kern/sys_futex.c:109 syscall(ffff8000256dc0f0) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000256dc0f0) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa521067a360, count: -7