panic: vrele: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *164809 94649 0 0 0x4000000 0 syz-executor.0 db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic() at panic+0x15c sys/kern/subr_prf.c:207 vrele(fffffd802f837230) at vrele+0x188 sys/kern/vfs_subr.c:797 diskmapioctl(5a00,c0106477,ffff8000149d8600,1,ffff800014940780) at diskmapioctl+0x2a8 sys/dev/diskmap.c:140 VOP_IOCTL(fffffd80374060d0,c0106477,ffff8000149d8600,1,fffffd803f7c6c00,ffff800014940780) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290 vn_ioctl(fffffd802f7c6d30,c0106477,ffff8000149d8600,ffff800014940780) at vn_ioctl+0xb6 sys/kern/vfs_vnops.c:519 sys_ioctl(ffff800014940780,ffff8000149d8718,ffff8000149d8780) at sys_ioctl+0x5b8 syscall(ffff8000149d87e0) at syscall+0x508 Xsyscall(6,0,ffffffffffffff1f,0,3,afd4301010) at Xsyscall+0x128 end of kernel end trace frame: 0xb27a575a60, 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() at panic+0x15c sys/kern/subr_prf.c:207 vrele(fffffd802f837230) at vrele+0x188 sys/kern/vfs_subr.c:797 diskmapioctl(5a00,c0106477,ffff8000149d8600,1,ffff800014940780) at diskmapioctl+0x2a8 sys/dev/diskmap.c:140 VOP_IOCTL(fffffd80374060d0,c0106477,ffff8000149d8600,1,fffffd803f7c6c00,ffff800014940780) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290 vn_ioctl(fffffd802f7c6d30,c0106477,ffff8000149d8600,ffff800014940780) at vn_ioctl+0xb6 sys/kern/vfs_vnops.c:519 sys_ioctl(ffff800014940780,ffff8000149d8718,ffff8000149d8780) at sys_ioctl+0x5b8 syscall(ffff8000149d87e0) at syscall+0x508 Xsyscall(6,0,ffffffffffffff1f,0,3,afd4301010) at Xsyscall+0x128 end of kernel end trace frame: 0xb27a575a60, count: -9 ddb> show registers rdi 0xffffffff818b9067 db_enter+0x17 rsi 0x7101 __ALIGN_SIZE+0x6101 rbp 0xffff8000149d81c0 rbx 0xffff8000149d8270 rdx 0x7102 __ALIGN_SIZE+0x6102 rcx 0xffff800016be7000 rax 0xffff800016be7000 r8 0xffff8000149d8180 r9 0x1 r10 0xffff800000998e00 r11 0x839e9a202c2a3ee6 r12 0x3000000008 r13 0xffff8000149d81d0 r14 0x100 r15 0x1 rip 0xffffffff818b9068 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000149d81b0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (syz-executor.0) pid=164809 stat=onproc flags process=0 proc=4000000 pri=24, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff800014940c70,0xffff8000149402a0 process=0xffff8000ffff7450 user=0xffff8000149d3000, vmspace=0xfffffd803f00cbb0 estcpu=36, cpticks=2, pctcpu=0.0 user=0, sys=2, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 50858 348064 17541 0 2 0 syz-executor.1 50858 128380 17541 0 3 0x4000080 nanosleep syz-executor.1 50858 396448 17541 0 2 0x4000000 syz-executor.1 94649 154731 43451 0 2 0 syz-executor.0 *94649 164809 43451 0 7 0x4000000 syz-executor.0 94649 500365 43451 0 2 0x4000000 syz-executor.0 52279 402147 0 0 3 0x14200 bored sosplice 43451 434517 31948 0 2 0x482 syz-executor.0 17541 374911 31948 0 2 0x482 syz-executor.1 31948 223454 38474 0 3 0x82 thrsleep syz-fuzzer 31948 341412 38474 0 3 0x4000082 thrsleep syz-fuzzer 31948 4212 38474 0 3 0x4000082 thrsleep syz-fuzzer 31948 453721 38474 0 3 0x4000082 thrsleep syz-fuzzer 31948 127145 38474 0 3 0x4000082 thrsleep syz-fuzzer 31948 200476 38474 0 3 0x4000082 kqread syz-fuzzer 31948 437507 38474 0 3 0x4000082 thrsleep syz-fuzzer 38474 183119 52079 0 3 0x10008a pause ksh 52079 150560 45345 0 3 0x92 select sshd 60856 170772 1 0 3 0x100083 ttyin getty 45345 374581 1 0 3 0x80 select sshd 71512 75050 63912 73 2 0x100090 syslogd 63912 369139 1 0 3 0x100082 netio syslogd 16425 131039 1 77 3 0x100090 poll dhclient 42897 242927 1 0 3 0x80 poll dhclient 21563 459511 0 0 2 0x14200 zerothread 88313 124024 0 0 3 0x14200 aiodoned aiodoned 62356 375057 0 0 3 0x14200 syncer update 86418 184922 0 0 3 0x14200 cleaner cleaner 65205 523377 0 0 3 0x14200 reaper reaper 1726 219495 0 0 3 0x14200 pgdaemon pagedaemon 93074 309151 0 0 3 0x14200 bored crynlk 84300 94170 0 0 3 0x14200 bored crypto 99251 269213 0 0 3 0x40014200 acpi0 acpi0 94463 260681 0 0 3 0x14200 bored softnet 78383 495950 0 0 3 0x14200 bored systqmp 22296 244075 0 0 3 0x14200 bored systq 5410 400806 0 0 3 0x40014200 bored softclock 28960 129502 0 0 3 0x40014200 idle0 44909 271030 0 0 3 0x14200 bored smr 1 479683 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 9523 6352K 6930K 78643K 11943 0 0 pcb 13 8K 8K 78643K 43 0 0 rtable 108 3K 4K 78643K 298 0 0 ifaddr 63 13K 14K 78643K 105 0 0 counters 19 16K 16K 78643K 19 0 0 ioctlops 0 0K 2K 78643K 41 0 0 iov 0 0K 24K 78643K 90 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1214 76K 77K 78643K 1725 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 10 0 0 VM map 2 0K 0K 78643K 2 0 0 sem 12 0K 1K 78643K 58 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1793 195K 288K 78643K 12645 0 0 file desc 6 17K 25K 78643K 566 0 0 sigio 0 0K 0K 78643K 8 0 0 proc 41 30K 54K 78643K 397 0 0 subproc 32 2K 2K 78643K 34 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 63 0 0 in_multi 33 2K 2K 78643K 54 0 0 ether_multi 1 0K 0K 78643K 4 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 66 291K 291K 78643K 66 0 0 exec 0 0K 1K 78643K 230 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 94 21K 25K 78643K 2143 0 0 UVM aobj 26 2K 3K 78643K 31 0 0 memdesc 1 4K 4K 78643K 1 0 0 crypto data 1 1K 1K 78643K 1 0 0 ip6_options 0 0K 0K 78643K 23 0 0 NDP 14 0K 0K 78643K 29 0 0 temp 170 2720K 2785K 78643K 4703 0 0 kqueue 0 0K 0K 78643K 4 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 6 0 0 1 0 1 1 0 8 0 rtpcb 80 51 0 49 1 0 1 1 0 8 0 rtentry 112 45 0 1 2 0 2 2 0 8 0 unpcb 120 159 0 149 1 0 1 1 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 1523 0 1523 1 1 0 1 0 8 0 tcpcb 544 96 0 92 1 0 1 1 0 8 0 inpcb 280 237 0 229 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 ppxss 1128 7 0 7 2 1 1 1 0 8 1 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 189 0 0 12 0 12 12 0 8 0 art_table 32 190 0 0 2 0 2 2 0 8 0 art_node 16 44 0 4 1 0 1 1 0 8 0 sysvmsgpl 40 12 0 7 1 0 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 56 0 46 1 0 1 1 0 8 0 shmpl 112 29 0 5 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 2326 0 909 46 0 46 46 0 8 0 ffsino 240 2326 0 909 84 0 84 84 0 8 0 nchpl 144 3303 0 1659 62 0 62 62 0 8 0 uvmvnodes 72 2670 0 0 49 0 49 49 0 8 0 vnodes 200 2670 0 0 141 0 141 141 0 8 0 namei 1024 9317 0 9317 2 1 1 1 0 8 1 scxspl 192 9159 0 9159 11 9 2 6 0 8 2 plimitpl 152 47 0 40 1 0 1 1 0 8 0 sigapl 432 737 0 723 2 0 2 2 0 8 0 futexpl 56 9029 0 9029 1 0 1 1 0 8 1 knotepl 112 122 0 103 1 0 1 1 0 8 0 kqueuepl 104 98 0 96 1 0 1 1 0 8 0 pipepl 112 426 0 407 2 1 1 1 0 8 0 fdescpl 424 738 0 723 2 0 2 2 0 8 0 filepl 120 4303 0 4204 4 0 4 4 0 8 1 lockfpl 104 223 0 223 2 1 1 1 0 8 1 lockfspl 48 70 0 70 2 1 1 1 0 8 1 sessionpl 112 17 0 7 1 0 1 1 0 8 0 pgrppl 48 17 0 7 1 0 1 1 0 8 0 ucredpl 96 944 0 937 1 0 1 1 0 8 0 zombiepl 144 723 0 723 3 2 1 1 0 8 1 processpl 864 753 0 723 4 0 4 4 0 8 0 procpl 632 1449 0 1409 4 0 4 4 0 8 0 sosppl 128 2 0 2 1 1 0 1 0 8 0 sockpl 384 451 0 431 3 0 3 3 0 8 1 mcl64k 65536 29 0 29 2 1 1 1 0 8 1 mcl16k 16384 3 0 3 3 3 0 1 0 8 0 mcl12k 12288 10 0 10 1 0 1 1 0 8 1 mcl9k 9216 9 0 9 1 0 1 1 0 8 1 mcl8k 8192 7 0 7 1 0 1 1 0 8 1 mcl4k 4096 43 0 43 2 1 1 1 0 8 1 mcl2k2 2112 1 0 1 1 1 0 1 0 8 0 mcl2k 2048 55334 0 55297 15 9 6 12 0 8 1 mtagpl 80 10 0 4 2 1 1 1 0 8 0 mbufpl 256 90659 0 90586 13 5 8 10 0 8 0 bufpl 256 7062 0 2558 282 0 282 282 0 8 0 anonpl 16 72909 0 60971 68 9 59 65 0 62 10 amapchunkpl 152 3147 0 3005 12 6 6 10 0 158 0 amappl16 192 3264 0 2633 41 7 34 40 0 8 2 amappl15 184 252 0 249 1 0 1 1 0 8 0 amappl14 176 54 0 49 1 0 1 1 0 8 0 amappl13 168 289 0 287 2 1 1 1 0 8 0 amappl12 160 4 0 4 1 1 0 1 0 8 0 amappl11 152 50 0 38 1 0 1 1 0 8 0 amappl10 144 62 0 61 2 1 1 1 0 8 0 amappl9 136 269 0 266 1 0 1 1 0 8 0 amappl8 128 118 0 107 1 0 1 1 0 8 0 amappl7 120 37 0 33 1 0 1 1 0 8 0 amappl6 112 55 0 48 1 0 1 1 0 8 0 amappl5 104 717 0 707 1 0 1 1 0 8 0 amappl4 96 958 0 931 1 0 1 1 0 8 0 amappl3 88 181 0 171 1 0 1 1 0 8 0 amappl2 80 5589 0 5513 4 2 2 3 0 8 0 amappl1 72 22283 0 21840 25 15 10 19 0 8 0 amappl 80 1688 0 1642 3 1 2 2 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 30 0 5 1 0 1 1 0 8 0 uaddrrnd 24 738 0 723 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 738 0 723 1 0 1 1 0 8 0 vmmpekpl 168 8481 0 8458 2 0 2 2 0 8 0 vmmpepl 168 91994 0 90202 108 28 80 88 0 357 2 vmsppl 272 737 0 723 2 1 1 2 0 8 0 pdppl 4096 1483 0 1446 6 1 5 6 0 8 0 pvpl 32 223352 0 208354 166 13 153 159 0 265 31 pmappl 200 737 0 723 1 0 1 1 0 8 0 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 431 0 24 12 0 12 12 0 8 0