panic: vrele: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *272729 21450 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(fffffd802bf75268) at vrele+0x188 sys/kern/vfs_subr.c:797 diskmapioctl(5a00,c0106477,ffff8000159e2140,1,ffff8000ffff9640) at diskmapioctl+0x2a8 sys/dev/diskmap.c:140 VOP_IOCTL(fffffd80374087d8,c0106477,ffff8000159e2140,1,fffffd803f7c6960,ffff8000ffff9640) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290 vn_ioctl(fffffd802f995c40,c0106477,ffff8000159e2140,ffff8000ffff9640) at vn_ioctl+0xb6 sys/kern/vfs_vnops.c:519 sys_ioctl(ffff8000ffff9640,ffff8000159e2258,ffff8000159e22c0) at sys_ioctl+0x5b8 syscall(ffff8000159e2320) at syscall+0x508 Xsyscall(6,0,ffffffffffffff1f,0,3,ab4ad73e010) at Xsyscall+0x128 end of kernel end trace frame: 0xab731c0bca0, 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(fffffd802bf75268) at vrele+0x188 sys/kern/vfs_subr.c:797 diskmapioctl(5a00,c0106477,ffff8000159e2140,1,ffff8000ffff9640) at diskmapioctl+0x2a8 sys/dev/diskmap.c:140 VOP_IOCTL(fffffd80374087d8,c0106477,ffff8000159e2140,1,fffffd803f7c6960,ffff8000ffff9640) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:290 vn_ioctl(fffffd802f995c40,c0106477,ffff8000159e2140,ffff8000ffff9640) at vn_ioctl+0xb6 sys/kern/vfs_vnops.c:519 sys_ioctl(ffff8000ffff9640,ffff8000159e2258,ffff8000159e22c0) at sys_ioctl+0x5b8 syscall(ffff8000159e2320) at syscall+0x508 Xsyscall(6,0,ffffffffffffff1f,0,3,ab4ad73e010) at Xsyscall+0x128 end of kernel end trace frame: 0xab731c0bca0, count: -9 ddb> show registers rdi 0xffffffff8141a407 db_enter+0x17 rsi 0x6fcd __ALIGN_SIZE+0x5fcd rbp 0xffff8000159e1d00 rbx 0xffff8000159e1db0 rdx 0x6fce __ALIGN_SIZE+0x5fce rcx 0xffff800016bdd000 rax 0xffff800016bdd000 r8 0xffff8000159e1cc0 r9 0x1 r10 0xffff800000997b00 r11 0x194c7a6e693d36e4 r12 0x3000000008 r13 0xffff8000159e1d10 r14 0x100 r15 0x1 rip 0xffffffff8141a408 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000159e1cf0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (syz-executor.0) pid=272729 stat=onproc flags process=0 proc=4000000 pri=24, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff8000ffff89e8,0xffff8000ffff4ef0 process=0xffff8000ffff70f0 user=0xffff8000159dd000, 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 8026 168779 61267 0 2 0 syz-executor.1 8026 209958 61267 0 3 0x4000080 fsleep syz-executor.1 21450 22948 36042 0 2 0 syz-executor.0 *21450 272729 36042 0 7 0x4000000 syz-executor.0 21450 435218 36042 0 2 0x4000000 syz-executor.0 36042 129305 90634 0 2 0x482 syz-executor.0 61267 169483 90634 0 2 0x482 syz-executor.1 90634 203965 97023 0 3 0x82 thrsleep syz-fuzzer 90634 209752 97023 0 3 0x4000082 thrsleep syz-fuzzer 90634 38309 97023 0 3 0x4000082 thrsleep syz-fuzzer 90634 323299 97023 0 3 0x4000082 thrsleep syz-fuzzer 90634 316313 97023 0 3 0x4000082 kqread syz-fuzzer 90634 52252 97023 0 3 0x4000082 thrsleep syz-fuzzer 90634 367504 97023 0 3 0x4000082 thrsleep syz-fuzzer 97023 224431 81634 0 3 0x10008a pause ksh 81634 177514 36957 0 3 0x92 select sshd 87858 458784 1 0 3 0x100083 ttyin getty 36957 396573 1 0 3 0x80 select sshd 69532 45057 81499 73 2 0x100090 syslogd 81499 134411 1 0 3 0x100082 netio syslogd 3558 169747 1 77 3 0x100090 poll dhclient 31397 136653 1 0 3 0x80 poll dhclient 61338 277321 0 0 2 0x14200 zerothread 3823 332432 0 0 3 0x14200 aiodoned aiodoned 13357 294646 0 0 3 0x14200 syncer update 97490 208510 0 0 3 0x14200 cleaner cleaner 30816 305928 0 0 3 0x14200 reaper reaper 8884 347016 0 0 3 0x14200 pgdaemon pagedaemon 75513 298110 0 0 3 0x14200 bored crynlk 95116 318818 0 0 3 0x14200 bored crypto 33573 339543 0 0 3 0x40014200 acpi0 acpi0 247 102096 0 0 3 0x14200 bored softnet 36451 87343 0 0 3 0x14200 bored systqmp 9416 353695 0 0 3 0x14200 bored systq 18141 27218 0 0 3 0x40014200 bored softclock 75502 303251 0 0 3 0x40014200 idle0 61378 476622 0 0 3 0x14200 bored smr 1 165772 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 9459 6380K 6573K 78643K 10777 0 0 pcb 13 8K 8K 78643K 27 0 0 rtable 110 3K 4K 78643K 213 0 0 ifaddr 39 10K 11K 78643K 47 0 0 counters 19 16K 16K 78643K 19 0 0 ioctlops 0 0K 2K 78643K 19 0 0 iov 0 0K 12K 78643K 6 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1215 76K 76K 78643K 1365 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 3 0 0 VM map 2 0K 0K 78643K 2 0 0 sem 12 1K 1K 78643K 14 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1793 195K 288K 78643K 12645 0 0 file desc 6 17K 25K 78643K 197 0 0 sigio 0 0K 0K 78643K 2 0 0 proc 41 30K 54K 78643K 357 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 8 0 0 in_multi 33 2K 2K 78643K 39 0 0 ether_multi 1 0K 0K 78643K 3 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 42 185K 185K 78643K 42 0 0 exec 0 0K 1K 78643K 188 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 83 20K 20K 78643K 1293 0 0 UVM aobj 10 2K 2K 78643K 10 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 9 0 0 NDP 6 0K 0K 78643K 12 0 0 temp 93 2713K 2778K 78643K 3434 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 7 0 0 1 0 1 1 0 8 0 rtpcb 80 21 0 19 1 0 1 1 0 8 0 rtentry 112 46 0 1 2 0 2 2 0 8 0 unpcb 120 157 0 147 1 0 1 1 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 363 0 363 2 2 0 1 0 8 0 tcpcb 544 26 0 21 1 0 1 1 0 8 0 inpcb 280 70 0 60 1 0 1 1 0 8 0 nd6 48 6 0 0 1 0 1 1 0 8 0 ppxss 1128 1 0 1 1 1 0 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 190 0 0 12 0 12 12 0 8 0 art_table 32 191 0 0 2 0 2 2 0 8 0 art_node 16 45 0 4 1 0 1 1 0 8 0 semupl 112 1 0 1 1 0 1 1 0 8 1 semapl 112 10 0 0 1 0 1 1 0 8 0 shmpl 112 8 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 1789 0 370 46 0 46 46 0 8 0 ffsino 240 1789 0 370 84 0 84 84 0 8 0 nchpl 144 2249 0 609 61 0 61 61 0 8 0 uvmvnodes 72 1875 0 0 35 0 35 35 0 8 0 vnodes 200 1875 0 0 99 0 99 99 0 8 0 namei 1024 5782 0 5782 1 0 1 1 0 8 1 scxspl 192 5347 0 5347 7 3 4 6 0 8 4 plimitpl 152 21 0 14 1 0 1 1 0 8 0 sigapl 432 368 0 354 2 0 2 2 0 8 0 futexpl 56 1943 0 1942 1 0 1 1 0 8 0 knotepl 112 55 0 36 1 0 1 1 0 8 0 kqueuepl 104 12 0 10 1 0 1 1 0 8 0 pipepl 112 162 0 143 1 0 1 1 0 8 0 fdescpl 424 369 0 354 2 0 2 2 0 8 0 filepl 120 1847 0 1749 4 0 4 4 0 8 1 lockfpl 104 75 0 75 2 1 1 1 0 8 1 lockfspl 48 17 0 17 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 248 0 241 1 0 1 1 0 8 0 zombiepl 144 354 0 354 1 0 1 1 0 8 1 processpl 864 383 0 354 4 0 4 4 0 8 0 procpl 632 607 0 569 4 0 4 4 0 8 0 sockpl 384 248 0 228 3 0 3 3 0 8 1 mcl64k 65536 2 0 2 1 0 1 1 0 8 1 mcl16k 16384 1 0 1 1 1 0 1 0 8 0 mcl12k 12288 2 0 2 2 1 1 1 0 8 1 mcl9k 9216 1 0 1 1 0 1 1 0 8 1 mcl8k 8192 3 0 3 1 1 0 1 0 8 0 mcl4k 4096 10 0 10 2 1 1 1 0 8 1 mcl2k2 2112 1 0 1 1 0 1 1 0 8 1 mcl2k 2048 54048 0 54015 10 5 5 9 0 8 0 mtagpl 80 4 0 2 2 1 1 1 0 8 0 mbufpl 256 85539 0 85462 10 1 9 9 0 8 0 bufpl 256 5783 0 1345 278 0 278 278 0 8 0 anonpl 16 46043 0 35018 62 1 61 61 0 62 16 amapchunkpl 152 1618 0 1510 7 1 6 7 0 158 1 amappl16 192 1505 0 902 43 4 39 43 0 8 8 amappl15 184 72 0 70 1 0 1 1 0 8 0 amappl14 176 212 0 204 1 0 1 1 0 8 0 amappl13 168 6 0 6 1 1 0 1 0 8 0 amappl12 160 12 0 10 1 0 1 1 0 8 0 amappl11 152 52 0 40 1 0 1 1 0 8 0 amappl10 144 62 0 62 1 1 0 1 0 8 0 amappl9 136 529 0 525 1 0 1 1 0 8 0 amappl8 128 134 0 119 1 0 1 1 0 8 0 amappl7 120 30 0 27 1 0 1 1 0 8 0 amappl6 112 51 0 45 1 0 1 1 0 8 0 amappl5 104 191 0 182 1 0 1 1 0 8 0 amappl4 96 577 0 548 1 0 1 1 0 8 0 amappl3 88 250 0 239 1 0 1 1 0 8 0 amappl2 80 2133 0 2056 3 1 2 3 0 8 0 amappl1 72 15761 0 15348 25 15 10 19 0 8 0 amappl 80 855 0 817 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 9 0 0 1 0 1 1 0 8 0 uaddrrnd 24 369 0 354 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 369 0 354 1 0 1 1 0 8 0 vmmpekpl 168 6551 0 6530 2 0 2 2 0 8 0 vmmpepl 168 49361 0 47639 102 16 86 94 0 357 11 vmsppl 272 368 0 354 2 1 1 2 0 8 0 pdppl 4096 745 0 708 6 1 5 6 0 8 0 pvpl 32 147087 0 133040 151 0 151 151 0 265 37 pmappl 200 368 0 354 1 0 1 1 0 8 0 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 415 0 13 12 0 12 12 0 8 0