panic: vput: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic() at panic+0x15c sys/kern/subr_prf.c:207 vput(fffffd802b898d00) at vput+0x187 sys/kern/vfs_subr.c:759 vn_closefile(fffffd803af34878,ffff8000149413d8) at vn_closefile+0x15b sys/kern/vfs_vnops.c:584 fdrop(fffffd803af34878,ffff8000149413d8) at fdrop+0xc9 sys/kern/kern_descrip.c:1269 closef(fffffd803af34878,ffff8000149413d8) at closef+0x118 sys/kern/kern_descrip.c:1253 fdfree(ffff8000149413d8) at fdfree+0xf7 sys/kern/kern_descrip.c:1185 exit1(ffff8000149413d8,0,1) at exit1+0x32f sys/kern/kern_exit.c:196 sys_exit(ffff8000149413d8,ffff8000159b2d80,ffff8000159b2df0) at sys_exit+0x17 sys/kern/kern_exit.c:94 syscall(ffff8000159b2e50) at syscall+0x508 Xsyscall(6,1,0,1,0,7f7ffffdee04) at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffdedd0, count: 4 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 vput: v_writecount != 0 ddb> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic() at panic+0x15c sys/kern/subr_prf.c:207 vput(fffffd802b898d00) at vput+0x187 sys/kern/vfs_subr.c:759 vn_closefile(fffffd803af34878,ffff8000149413d8) at vn_closefile+0x15b sys/kern/vfs_vnops.c:584 fdrop(fffffd803af34878,ffff8000149413d8) at fdrop+0xc9 sys/kern/kern_descrip.c:1269 closef(fffffd803af34878,ffff8000149413d8) at closef+0x118 sys/kern/kern_descrip.c:1253 fdfree(ffff8000149413d8) at fdfree+0xf7 sys/kern/kern_descrip.c:1185 exit1(ffff8000149413d8,0,1) at exit1+0x32f sys/kern/kern_exit.c:196 sys_exit(ffff8000149413d8,ffff8000159b2d80,ffff8000159b2df0) at sys_exit+0x17 sys/kern/kern_exit.c:94 syscall(ffff8000159b2e50) at syscall+0x508 Xsyscall(6,1,0,1,0,7f7ffffdee04) at Xsyscall+0x128 end of kernel end trace frame: 0x7f7ffffdedd0, count: -11 ddb> show registers rdi 0 rsi 0x1 rbp 0xffff8000159b2a70 rbx 0xffff8000159b2b20 rdx 0x2 rcx 0 rax 0 r8 0xffff8000159b2a30 r9 0x1 r10 0 r11 0x5761ae7453623673 r12 0x3000000008 r13 0xffff8000159b2a80 r14 0x100 r15 0x1 rip 0xffffffff81bc2978 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000159b2a60 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (syz-executor.0) pid=504079 stat=onproc flags process=1008 proc=2000 pri=32, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff8000149409f8,0xffffffff822be988 process=0xffff8000ffff7b10 user=0xffff8000159ad000, vmspace=0xfffffd803f00cdd0 estcpu=36, cpticks=7, pctcpu=0.0 user=0, sys=1, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 53767 75161 1 0 3 0x100083 ttyin getty 37068 15953 71497 0 3 0x82 nanosleep syz-executor.0 95033 203790 71497 0 2 0x2 syz-executor.1 50267 134730 0 0 3 0x14200 bored sosplice 71497 73773 99690 0 3 0x82 thrsleep syz-fuzzer 71497 109599 99690 0 3 0x4000082 nanosleep syz-fuzzer 71497 496833 99690 0 3 0x4000082 kqread syz-fuzzer 71497 442711 99690 0 3 0x4000082 thrsleep syz-fuzzer 71497 466553 99690 0 3 0x4000082 thrsleep syz-fuzzer 71497 344186 99690 0 3 0x4000082 thrsleep syz-fuzzer 71497 122908 99690 0 3 0x4000082 thrsleep syz-fuzzer 99690 209413 33039 0 3 0x10008a pause ksh 33039 246658 43591 0 3 0x92 select sshd 43591 483310 1 0 3 0x80 select sshd 50362 123339 81335 73 2 0x100090 syslogd 81335 176473 1 0 3 0x100082 netio syslogd 29052 425819 1 77 3 0x100090 poll dhclient 18948 337441 1 0 3 0x80 poll dhclient 52258 393546 0 0 2 0x14200 zerothread 50535 197864 0 0 3 0x14200 aiodoned aiodoned 3856 267035 0 0 3 0x14200 syncer update 94184 181927 0 0 3 0x14200 cleaner cleaner 65001 349231 0 0 3 0x14200 reaper reaper 51606 453376 0 0 3 0x14200 pgdaemon pagedaemon 87750 228681 0 0 3 0x14200 bored crynlk 16985 470385 0 0 3 0x14200 bored crypto 23783 35538 0 0 3 0x40014200 acpi0 acpi0 25048 470529 0 0 3 0x14200 bored softnet 86281 15230 0 0 3 0x14200 bored systqmp 43918 120944 0 0 3 0x14200 bored systq 93625 240202 0 0 3 0x40014200 bored softclock 96369 288018 0 0 3 0x40014200 idle0 66270 399220 0 0 3 0x14200 bored smr 1 186274 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 Kern Lim devbuf 9558 6373K 14665K 78643K 24728 0 0 pcb 13 8K 8K 78643K 371 0 0 rtable 120 12K 13K 78643K 1306 0 0 ifaddr 73 18K 20K 78643K 550 0 0 counters 19 16K 16K 78643K 19 0 0 ioctlops 0 0K 2K 78643K 223 0 0 iov 0 0K 28K 78643K 647 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1202 75K 77K 78643K 6102 0 0 UFS quota 1 32K 32K 78643K 1 0 0 UFS mount 5 36K 36K 78643K 5 0 0 shm 2 1K 5K 78643K 66 0 0 VM map 2 0K 0K 78643K 2 0 0 sem 12 1K 1K 78643K 526 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1793 195K 288K 78643K 12645 0 0 file desc 5 13K 25K 78643K 5177 0 0 sigio 2 0K 0K 78643K 74 0 0 proc 42 30K 54K 78643K 1071 0 0 subproc 32 2K 2K 78643K 119 0 0 NFS srvsock 1 0K 0K 78643K 1 0 0 NFS daemon 1 16K 16K 78643K 1 0 0 ip_moptions 0 0K 0K 78643K 457 0 0 in_multi 33 2K 2K 78643K 196 0 0 ether_multi 1 0K 0K 78643K 15 0 0 mrt 0 0K 0K 78643K 7 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 102 450K 450K 78643K 102 0 0 exec 0 0K 1K 78643K 728 0 0 pfkey data 0 0K 4K 78643K 6 0 0 pagedep 1 8K 8K 78643K 1 0 0 inodedep 1 32K 32K 78643K 1 0 0 newblk 1 0K 0K 78643K 1 0 0 VM swap 7 26K 26K 78643K 7 0 0 UVM amap 92 21K 31K 78643K 13058 0 0 UVM aobj 130 7K 7K 78643K 140 0 0 memdesc 1 4K 4K 78643K 1 0 0 crypto data 1 1K 1K 78643K 1 0 0 ip6_options 0 0K 1K 78643K 227 0 0 NDP 17 0K 1K 78643K 156 0 0 temp 205 2728K 2804K 78643K 19726 0 0 kqueue 0 0K 0K 78643K 34 0 0 SYN cache 2 16K 16K 78643K 2 0 0 ddb> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle arp 64 18 0 12 1 0 1 1 0 8 0 rtpcb 80 216 0 214 1 0 1 1 0 8 0 rtentry 112 114 0 69 2 0 2 2 0 8 0 unpcb 120 1741 0 1731 1 0 1 1 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 sackhl 24 1 0 1 1 1 0 1 0 8 0 tcpqe 32 1168 0 1168 1 1 0 1 0 8 0 tcpcb 544 751 0 747 1 0 1 1 0 8 0 inpcb 280 2137 0 2130 6 5 1 2 0 8 0 nd6 48 21 0 15 1 0 1 1 0 8 0 pkpcb 40 30 0 30 10 10 0 1 0 8 0 swfcl 56 2 0 0 1 0 1 1 0 8 0 ppxss 1128 92 0 92 18 18 0 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 428 0 236 13 0 13 13 0 8 1 art_table 32 429 0 236 2 0 2 2 0 8 0 art_node 16 102 0 62 1 0 1 1 0 8 0 sysvmsgpl 40 38 0 25 1 0 1 1 0 8 0 semupl 112 2 0 2 1 1 0 1 0 8 0 semapl 112 524 0 514 1 0 1 1 0 8 0 shmpl 112 138 0 10 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 9616 0 8215 46 0 46 46 0 8 0 ffsino 240 9616 0 8215 84 0 84 84 0 8 0 nchpl 144 16879 0 15254 62 0 62 62 0 8 0 uvmvnodes 72 6824 0 0 125 0 125 125 0 8 0 vnodes 200 6824 0 0 360 0 360 360 0 8 0 namei 1024 54017 0 54017 6 5 1 1 0 8 1 scsiplug 64 6 0 6 6 6 0 1 0 8 0 scxspl 192 58440 0 58440 28 27 1 6 0 8 1 plimitpl 152 488 0 481 1 0 1 1 0 8 0 sigapl 432 5338 0 5325 2 0 2 2 0 8 0 futexpl 56 85314 0 85314 6 5 1 1 0 8 1 knotepl 112 1095 0 1076 1 0 1 1 0 8 0 kqueuepl 104 1304 0 1302 1 0 1 1 0 8 0 pipepl 112 2978 0 2959 8 7 1 2 0 8 0 fdescpl 424 5339 0 5325 2 0 2 2 0 8 0 filepl 120 31885 0 31790 7 3 4 5 0 8 0 lockfpl 104 1919 0 1919 9 8 1 1 0 8 1 lockfspl 48 658 0 658 9 8 1 1 0 8 1 sessionpl 112 27 0 17 1 0 1 1 0 8 0 pgrppl 48 77 0 67 1 0 1 1 0 8 0 ucredpl 96 6457 0 6450 1 0 1 1 0 8 0 zombiepl 144 5326 0 5325 2 1 1 1 0 8 0 processpl 864 5354 0 5325 4 0 4 4 0 8 0 procpl 632 11922 0 11887 4 0 4 4 0 8 0 sosppl 128 59 0 59 15 14 1 1 0 8 1 sockpl 384 4158 0 4139 11 8 3 4 0 8 1 mcl64k 65536 688 0 688 45 45 0 33 0 8 0 mcl16k 16384 10 0 10 10 10 0 1 0 8 0 mcl12k 12288 84 0 84 19 19 0 1 0 8 0 mcl9k 9216 70 0 70 17 16 1 1 0 8 1 mcl8k 8192 70 0 70 21 20 1 1 0 8 1 mcl4k 4096 267 0 267 13 13 0 1 0 8 0 mcl2k2 2112 31 0 31 11 10 1 1 0 8 1 mcl2k 2048 62804 0 62759 27 20 7 17 0 8 0 mtagpl 80 157 0 98 4 2 2 2 0 8 0 mbufpl 256 124895 0 124708 37 23 14 27 0 8 0 bufpl 256 20326 0 13440 431 0 431 431 0 8 0 anonpl 16 504667 0 492850 217 159 58 66 0 62 7 amapchunkpl 152 23350 0 23247 70 65 5 15 0 158 0 amappl16 192 29832 0 29175 210 174 36 46 0 8 2 amappl15 184 1007 0 1007 2 2 0 1 0 8 0 amappl14 176 92 0 85 1 0 1 1 0 8 0 amappl13 168 408 0 408 2 2 0 1 0 8 0 amappl12 160 698 0 697 1 0 1 1 0 8 0 amappl11 152 2331 0 2315 1 0 1 1 0 8 0 amappl10 144 467 0 467 9 9 0 1 0 8 0 amappl9 136 948 0 945 1 0 1 1 0 8 0 amappl8 128 526 0 507 1 0 1 1 0 8 0 amappl7 120 454 0 447 1 0 1 1 0 8 0 amappl6 112 2296 0 2288 1 0 1 1 0 8 0 amappl5 104 934 0 924 1 0 1 1 0 8 0 amappl4 96 4920 0 4891 1 0 1 1 0 8 0 amappl3 88 1015 0 1004 1 0 1 1 0 8 0 amappl2 80 42991 0 42926 4 2 2 3 0 8 0 amappl1 72 101510 0 101109 26 17 9 19 0 8 0 amappl 80 12286 0 12251 1 0 1 1 0 84 0 dma4096 4096 1 0 1 1 1 0 1 0 8 0 dma256 256 6 0 6 1 1 0 1 0 8 0 dma64 64 259 0 259 1 1 0 1 0 8 0 dma32 32 7 0 7 1 1 0 1 0 8 0 dma16 16 17 0 17 1 1 0 1 0 8 0 aobjpl 64 139 0 10 3 0 3 3 0 8 0 uaddrrnd 24 5339 0 5325 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 5339 0 5325 1 0 1 1 0 8 0 vmmpekpl 168 33892 0 33870 2 0 2 2 0 8 0 vmmpepl 168 623883 0 622197 242 162 80 100 0 357 3 vmsppl 272 5338 0 5325 4 3 1 2 0 8 0 pdppl 4096 10685 0 10650 6 1 5 6 0 8 0 pvpl 32 1459215 0 1444292 496 344 152 265 0 265 25 pmappl 200 5338 0 5325 1 0 1 1 0 8 0 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 704 0 142 18 0 18 18 0 8 0