panic: vrele: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *185590 60287 0 0 0x4000000 0 syz-executor.1 db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff8243627a) at panic+0x15e sys/kern/subr_prf.c:218 vrele(fffffd806ec4a948) at vrele+0x187 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff800022737250,3,ffff800021697a50) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e6ce2f0,40287401,ffff800022737250,3,fffffd807f7b7ba0,ffff800021697a50) at VOP_IOCTL+0x91 sys/kern/vfs_vops.c:297 vn_ioctl(fffffd807ab7ad38,40287401,ffff800022737250,ffff800021697a50) at vn_ioctl+0xb5 sys/kern/vfs_vnops.c:531 sys_ioctl(ffff800021697a50,ffff800022737360,ffff8000227373b0) at sys_ioctl+0x4ac syscall(ffff800022737430) at syscall+0x507 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x78618ba4460, 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> ddb> set $lines = 0 ddb> set $maxwidth = 0 ddb> show panic vrele: v_writecount != 0 ddb> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff8243627a) at panic+0x15e sys/kern/subr_prf.c:218 vrele(fffffd806ec4a948) at vrele+0x187 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff800022737250,3,ffff800021697a50) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e6ce2f0,40287401,ffff800022737250,3,fffffd807f7b7ba0,ffff800021697a50) at VOP_IOCTL+0x91 sys/kern/vfs_vops.c:297 vn_ioctl(fffffd807ab7ad38,40287401,ffff800022737250,ffff800021697a50) at vn_ioctl+0xb5 sys/kern/vfs_vnops.c:531 sys_ioctl(ffff800021697a50,ffff800022737360,ffff8000227373b0) at sys_ioctl+0x4ac syscall(ffff800022737430) at syscall+0x507 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x78618ba4460, count: -9 ddb> show registers rdi 0 rsi 0x1 rbp 0xffff800022736c90 rbx 0xffff800022736ca0 rdx 0x8b rcx 0x2 rax 0x1 r8 0xffffffff820e50f5 kprintf+0x155 r9 0x1 r10 0x6dbf627b17fe9887 r11 0xd0add8e8d3cfe0ff r12 0x3000000008 r13 0xffff800022736d40 r14 0x100 r15 0x1 rip 0xffffffff81ab85c8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800022736c80 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (syz-executor.1) pid=185590 stat=onproc flags process=0 proc=4000000 pri=32, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800021696fd0,0xffffffff827ebf10 process=0xffff80002165d800 user=0xffff800022732000, vmspace=0xfffffd807effc330 estcpu=36, cpticks=2, pctcpu=0.0 user=0, sys=2, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 60287 440712 59591 0 2 0 syz-executor.1 *60287 185590 59591 0 7 0x4000000 syz-executor.1 59591 443041 1298 0 2 0x482 syz-executor.1 80551 223885 1298 0 2 0x2 syz-executor.0 1298 242352 51870 0 3 0x82 thrsleep syz-fuzzer 1298 211055 51870 0 2 0x4000482 syz-fuzzer 1298 73710 51870 0 3 0x4000082 thrsleep syz-fuzzer 1298 166152 51870 0 3 0x4000082 thrsleep syz-fuzzer 1298 326006 51870 0 3 0x4000082 thrsleep syz-fuzzer 1298 278194 51870 0 3 0x4000082 thrsleep syz-fuzzer 1298 422340 51870 0 3 0x4000082 kqread syz-fuzzer 51870 340843 20126 0 3 0x10008a sigsusp ksh 20126 337388 92599 0 3 0x92 select sshd 88678 60047 1 0 3 0x100083 ttyin getty 92599 453967 1 0 3 0x80 select sshd 17702 115332 36248 73 3 0x100090 kqread syslogd 36248 5346 1 0 3 0x100082 netio syslogd 89542 156683 1 77 3 0x100090 poll dhclient 14177 129914 1 0 3 0x80 poll dhclient 69256 378529 0 0 3 0x14200 bored smr 10099 140118 0 0 3 0x14200 pgzero zerothread 93341 130437 0 0 3 0x14200 aiodoned aiodoned 43492 351069 0 0 3 0x14200 syncer update 3792 460581 0 0 3 0x14200 cleaner cleaner 85834 24673 0 0 3 0x14200 reaper reaper 73258 195988 0 0 3 0x14200 pgdaemon pagedaemon 45319 361889 0 0 3 0x14200 bored crynlk 41464 503683 0 0 3 0x14200 bored crypto 2401 218178 0 0 3 0x14200 bored viomb 79136 206744 0 0 3 0x40014200 acpi0 acpi0 68086 418640 0 0 3 0x14200 bored softnet 19317 54442 0 0 3 0x14200 bored systqmp 31751 461668 0 0 3 0x14200 bored systq 40442 325952 0 0 3 0x40014200 bored softclock 96534 108888 0 0 3 0x40014200 idle0 1 366375 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb> show all locks No such command ddb> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 9473 6345K 6798K 78643K 10707 0 pcb 13 8K 8K 78643K 20 0 rtable 105 3K 3K 78643K 191 0 ifaddr 44 10K 10K 78643K 44 0 counters 21 16K 16K 78643K 21 0 ioctlops 0 0K 2K 78643K 15 0 iov 0 0K 2K 78643K 2 0 mount 1 1K 1K 78643K 1 0 vnodes 1221 77K 77K 78643K 1265 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 0K 0K 78643K 2 0 sem 9 0K 0K 78643K 9 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 5 13K 25K 78643K 118 0 sigio 0 0K 0K 78643K 2 0 proc 47 38K 54K 78643K 364 0 subproc 32 2K 2K 78643K 34 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 in_multi 33 2K 2K 78643K 33 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 317 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 125 25K 26K 78643K 875 0 UVM aobj 3 2K 2K 78643K 3 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 NDP 6 0K 0K 78643K 10 0 temp 65 3963K 4027K 78643K 2008 0 kqueue 3 4K 8K 78643K 5 0 SYN cache 2 16K 16K 78643K 2 0 ddb> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle arp 64 6 0 0 1 0 1 1 0 8 0 rtpcb 120 21 0 19 1 0 1 1 0 8 0 rtentry 112 45 0 1 2 0 2 2 0 8 0 unpcb 120 33 0 25 1 0 1 1 0 8 0 syncache 296 4 0 4 1 1 0 1 0 8 0 tcpqe 32 847 0 847 1 0 1 1 0 8 1 tcpcb 736 17 0 13 1 0 1 1 0 8 0 inpcb 304 46 0 39 1 0 1 1 0 8 0 nd6 48 6 0 0 1 0 1 1 0 8 0 pkpcb 40 2 0 2 1 0 1 1 0 8 1 kcovpl 48 2 0 0 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 188 0 0 12 0 12 12 0 8 0 art_table 32 189 0 0 2 0 2 2 0 8 0 art_node 16 44 0 4 1 0 1 1 0 8 0 semupl 112 5 0 5 1 0 1 1 0 8 1 semapl 112 7 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1517 0 121 88 0 88 88 0 8 0 ffsino 240 1517 0 121 83 0 83 83 0 8 0 nchpl 144 1822 0 225 60 0 60 60 0 8 0 uvmvnodes 72 1593 0 0 29 0 29 29 0 8 0 vnodes 224 1593 0 0 94 0 94 94 0 8 0 namei 1024 4439 0 4439 2 1 1 1 0 8 1 scxspl 216 5208 0 5208 9 1 8 8 0 8 8 plimitpl 152 16 0 8 1 0 1 1 0 8 0 sigapl 424 305 0 276 4 0 4 4 0 8 0 futexpl 56 671 0 671 1 0 1 1 0 8 1 knotepl 112 64 0 44 1 0 1 1 0 8 0 kqueuepl 168 59 0 57 1 0 1 1 0 8 0 pipepl 304 71 0 60 1 0 1 1 0 8 0 fdescpl 432 290 0 276 2 0 2 2 0 8 0 filepl 120 1234 0 1133 4 0 4 4 0 8 0 lockfpl 104 23 0 22 1 0 1 1 0 8 0 lockfspl 48 8 0 7 1 0 1 1 0 8 0 sessionpl 144 17 0 7 1 0 1 1 0 8 0 pgrppl 48 17 0 7 1 0 1 1 0 8 0 ucredpl 96 93 0 86 1 0 1 1 0 8 0 zombiepl 144 276 0 276 2 1 1 1 0 8 1 processpl 1016 305 0 276 5 0 5 5 0 8 1 procpl 672 397 0 361 4 0 4 4 0 8 1 sockpl 432 102 0 85 4 1 3 3 0 8 1 mcl64k 65536 3 0 3 1 0 1 1 0 8 1 mcl9k 9216 4 0 4 1 0 1 1 0 8 1 mcl4k 4096 8 0 8 1 1 0 1 0 8 0 mcl2k2 2112 1 0 1 1 0 1 1 0 8 1 mcl2k 2048 171045 0 170971 44 26 18 26 0 8 8 mtagpl 96 8 0 2 2 1 1 1 0 8 0 mbufpl 256 186749 0 186627 16 2 14 14 0 8 2 bufpl 280 3330 0 169 226 0 226 226 0 8 0 anonpl 24 43648 0 25209 114 2 112 112 0 188 0 amapchunkpl 152 1557 0 1164 19 1 18 18 0 158 2 amappl16 200 1070 0 302 41 0 41 41 0 8 0 amappl15 192 2 0 1 1 0 1 1 0 8 0 amappl14 184 74 0 68 1 0 1 1 0 8 0 amappl13 176 67 0 63 1 0 1 1 0 8 0 amappl12 168 9 0 6 2 1 1 1 0 8 0 amappl11 160 44 0 33 1 0 1 1 0 8 0 amappl10 152 5 0 1 1 0 1 1 0 8 0 amappl9 144 242 0 238 1 0 1 1 0 8 0 amappl8 136 124 0 89 2 0 2 2 0 8 0 amappl7 128 215 0 209 1 0 1 1 0 8 0 amappl6 120 59 0 51 1 0 1 1 0 8 0 amappl5 112 470 0 456 1 0 1 1 0 8 0 amappl4 104 284 0 262 1 0 1 1 0 8 0 amappl3 96 164 0 153 1 0 1 1 0 8 0 amappl2 88 1595 0 1532 3 1 2 3 0 8 0 amappl1 80 15625 0 15181 27 15 12 21 0 8 1 amappl 88 645 0 571 2 0 2 2 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 2 0 0 1 0 1 1 0 8 0 uaddrrnd 24 290 0 276 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 290 0 276 1 0 1 1 0 8 0 vmmpekpl 168 6054 0 6033 2 0 2 2 0 8 1 vmmpepl 168 43404 0 41505 128 10 118 118 0 357 35 vmsppl 272 289 0 276 2 0 2 2 0 8 1 rwobjpl 24 11171 0 9746 14 4 10 10 0 8 1 pdppl 4096 586 0 552 58 18 40 40 0 8 6 pvpl 32 154387 0 132974 178 2 176 176 0 265 2 pmappl 200 289 0 276 1 0 1 1 0 8 0 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 320 0 50 8 0 8 8 0 8 0 ddb> machine ddbcpu 0 No such command ddb> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff8243627a) at panic+0x15e sys/kern/subr_prf.c:218 vrele(fffffd806ec4a948) at vrele+0x187 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff800022737250,3,ffff800021697a50) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e6ce2f0,40287401,ffff800022737250,3,fffffd807f7b7ba0,ffff800021697a50) at VOP_IOCTL+0x91 sys/kern/vfs_vops.c:297 vn_ioctl(fffffd807ab7ad38,40287401,ffff800022737250,ffff800021697a50) at vn_ioctl+0xb5 sys/kern/vfs_vnops.c:531 sys_ioctl(ffff800021697a50,ffff800022737360,ffff8000227373b0) at sys_ioctl+0x4ac syscall(ffff800022737430) at syscall+0x507 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x78618ba4460, count: -9 ddb> machine ddbcpu 1 No such command ddb> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff8243627a) at panic+0x15e sys/kern/subr_prf.c:218 vrele(fffffd806ec4a948) at vrele+0x187 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff800022737250,3,ffff800021697a50) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e6ce2f0,40287401,ffff800022737250,3,fffffd807f7b7ba0,ffff800021697a50) at VOP_IOCTL+0x91 sys/kern/vfs_vops.c:297 vn_ioctl(fffffd807ab7ad38,40287401,ffff800022737250,ffff800021697a50) at vn_ioctl+0xb5 sys/kern/vfs_vnops.c:531 sys_ioctl(ffff800021697a50,ffff800022737360,ffff8000227373b0) at sys_ioctl+0x4ac syscall(ffff800022737430) at syscall+0x507 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x78618ba4460, count: -9