panic: vrele: v_writecount != 0 Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *378116 64358 0 0 0x4000000 0K syz-executor.1 465998 16152 0 0x2 0x4000000 1 syz-fuzzer db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic(ffffffff8245fb0e) at panic+0x15e sys/kern/subr_prf.c:218 vrele(fffffd806e274250) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000222c1d60,3,ffff80002123c000) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e460c98,40287401,ffff8000222c1d60,3,fffffd807f7b77e0,ffff80002123c000) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd8065c56390,40287401,ffff8000222c1d60,ffff80002123c000) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff80002123c000,ffff8000222c1e70,ffff8000222c1ec0) at sys_ioctl+0x4b0 syscall(ffff8000222c1f40) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000222c1f40) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x76052d41310, 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(ffffffff8245fb0e) at panic+0x15e sys/kern/subr_prf.c:218 vrele(fffffd806e274250) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000222c1d60,3,ffff80002123c000) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e460c98,40287401,ffff8000222c1d60,3,fffffd807f7b77e0,ffff80002123c000) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd8065c56390,40287401,ffff8000222c1d60,ffff80002123c000) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff80002123c000,ffff8000222c1e70,ffff8000222c1ec0) at sys_ioctl+0x4b0 syscall(ffff8000222c1f40) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000222c1f40) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x76052d41310, count: -9 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff8000222c17a0 rbx 0xffff8000222c17b0 rdx 0x8b rcx 0x2 rax 0x1 r8 0xffffffff81b81665 kprintf+0x145 r9 0x1 r10 0x60ec381be797b56b r11 0x35d123331b8b074e r12 0x3000000008 r13 0xffff8000222c1850 r14 0x100 r15 0x1 rip 0xffffffff81e4d228 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000222c1790 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor.1) pid=378116 stat=onproc flags process=0 proc=4000000 pri=32, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff80002123c2a0,0xffffffff828c76b0 process=0xffff800021235960 user=0xffff8000222bc000, vmspace=0xfffffd807eff9730 estcpu=36, cpticks=2, pctcpu=0.0 user=0, sys=2, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 64358 124470 33747 0 2 0 syz-executor.1 *64358 378116 33747 0 7 0x4000000 syz-executor.1 33747 95349 16152 0 2 0x482 syz-executor.1 85825 258926 16152 0 3 0x82 piperd syz-executor.0 16152 110436 80234 0 3 0x82 thrsleep syz-fuzzer 16152 292806 80234 0 2 0x4000482 syz-fuzzer 16152 336372 80234 0 3 0x4000082 thrsleep syz-fuzzer 16152 215221 80234 0 3 0x4000082 thrsleep syz-fuzzer 16152 465998 80234 0 7 0x4000002 syz-fuzzer 16152 43023 80234 0 3 0x4000082 thrsleep syz-fuzzer 16152 351851 80234 0 3 0x4000082 thrsleep syz-fuzzer 16152 63978 80234 0 2 0x4000482 syz-fuzzer 80234 456027 4930 0 3 0x10008a sigsusp ksh 4930 257167 4855 0 3 0x92 select sshd 73718 200840 1 0 3 0x100083 ttyin getty 4855 445129 1 0 3 0x80 select sshd 39771 129555 20732 74 3 0x100092 bpf pflogd 20732 362221 1 0 3 0x80 netio pflogd 98959 245311 27924 73 3 0x100090 kqread syslogd 27924 457111 1 0 3 0x100082 netio syslogd 59653 435949 1 77 3 0x100090 poll dhclient 53272 145919 1 0 3 0x80 poll dhclient 46972 332250 0 0 3 0x14200 bored smr 44147 378621 0 0 3 0x14200 pgzero zerothread 8486 272803 0 0 3 0x14200 aiodoned aiodoned 89484 9001 0 0 3 0x14200 syncer update 44272 514043 0 0 3 0x14200 cleaner cleaner 90066 452266 0 0 3 0x14200 reaper reaper 41979 102646 0 0 3 0x14200 pgdaemon pagedaemon 88247 330612 0 0 3 0x14200 bored crynlk 98942 301505 0 0 3 0x14200 bored crypto 78771 344468 0 0 3 0x14200 bored viomb 40930 14856 0 0 3 0x40014200 acpi0 acpi0 74220 496807 0 0 3 0x40014200 idle1 4498 297373 0 0 3 0x14200 bored softnet 80834 265333 0 0 2 0x14200 systqmp 4815 326151 0 0 3 0x14200 bored systq 65998 256738 0 0 3 0x40014200 bored softclock 59527 437498 0 0 3 0x40014200 idle0 1 209328 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 64358 (syz-executor.1) thread 0xffff80002123c000 (378116) exclusive kernel_lock &kernel_lock r = 0 (0xffffffff828d4128) #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 Process 16152 (syz-fuzzer) thread 0xffff8000211c2548 (465998) exclusive rwlock pipelk r = 0 (0xfffffd806f865670) #0 witness_lock+0x4b0 stacktrace_save sys/sys/stacktrace.h:36 [inline] #0 witness_lock+0x4b0 sys/kern/subr_witness.c:1182 #1 pipe_write+0x36f sys/kern/sys_pipe.c:560 #2 dofilewritev+0x1ab sys/kern/sys_generic.c:365 #3 sys_write+0x83 sys/kern/sys_generic.c:285 #4 syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] #4 syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 #5 Xsyscall+0x128 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 9498 6431K 7010K 78643K 10831 0 pcb 13 8K 8K 78643K 17 0 rtable 86 3K 3K 78643K 232 0 ifaddr 50 11K 11K 78643K 60 0 counters 44 34K 34K 78643K 46 0 ioctlops 0 0K 4K 78643K 1483 0 iov 0 0K 12K 78643K 12 0 mount 1 1K 1K 78643K 1 0 vnodes 1224 77K 77K 78643K 1288 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 0K 1K 78643K 36 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12598 0 file desc 5 13K 25K 78643K 234 0 proc 61 63K 95K 78643K 449 0 subproc 32 2K 2K 78643K 34 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 2 0 in_multi 22 1K 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 43 201K 201K 78643K 43 0 exec 0 0K 2K 78643K 367 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 138 42K 42K 78643K 1287 0 UVM aobj 3 2K 2K 78643K 3 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 10 0 NDP 8 0K 0K 78643K 13 0 temp 75 3972K 4036K 78643K 3180 0 kqueue 3 4K 8K 78643K 5 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 6 0 2 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtpcb 120 35 0 33 1 0 1 1 0 8 0 rtentry 112 45 0 12 2 0 2 2 0 8 0 unpcb 120 43 0 33 1 0 1 1 0 8 0 syncache 296 8 0 8 2 1 1 1 0 8 1 tcpqe 32 776 0 776 1 0 1 1 0 8 1 tcpcb 736 33 0 15 2 0 2 2 0 8 0 inpcb 304 81 0 74 1 0 1 1 0 8 0 nd6 48 6 0 3 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 pfosfp 40 1428 0 1005 5 0 5 5 0 8 0 pfosfpen 112 1428 0 714 21 0 21 21 0 8 0 pfstitem 24 14 0 2 1 0 1 1 0 8 0 pfstkey 112 14 0 2 1 0 1 1 0 8 0 pfstate 320 14 0 2 1 0 1 1 0 8 0 pfrule 1360 21 0 16 2 1 1 2 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 189 0 44 12 0 12 12 0 8 2 art_table 32 190 0 44 2 0 2 2 0 8 0 art_node 16 44 0 14 1 0 1 1 0 8 0 semupl 112 2 0 2 1 0 1 1 0 8 1 semapl 112 28 0 18 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1657 0 253 88 0 88 88 0 8 0 ffsino 272 1657 0 253 95 1 94 94 0 8 0 nchpl 144 2102 0 498 60 0 60 60 0 8 0 uvmvnodes 72 1765 0 0 33 0 33 33 0 8 0 vnodes 224 1765 0 0 104 0 104 104 0 8 0 namei 1024 5350 0 5350 2 1 1 1 0 8 1 percpumem 16 34 0 1 1 0 1 1 0 8 0 vcpupl 1984 1 0 0 1 0 1 1 0 8 0 vmpool 560 1 0 0 1 0 1 1 0 8 0 scxspl 216 6263 0 6263 10 2 8 8 0 8 8 plimitpl 152 16 0 7 1 0 1 1 0 8 0 sigapl 424 450 0 418 4 0 4 4 0 8 0 futexpl 56 1395 0 1395 1 0 1 1 0 8 1 knotepl 112 64 0 44 1 0 1 1 0 8 0 kqueuepl 168 111 0 109 1 0 1 1 0 8 0 pipepl 336 86 0 75 2 0 2 2 0 8 1 fdescpl 496 434 0 418 3 0 3 3 0 8 0 filepl 152 1656 0 1549 6 1 5 5 0 8 0 lockfpl 104 33 0 32 1 0 1 1 0 8 0 lockfspl 48 16 0 15 1 0 1 1 0 8 0 sessionpl 144 18 0 7 1 0 1 1 0 8 0 pgrppl 48 22 0 11 1 0 1 1 0 8 0 ucredpl 96 86 0 77 1 0 1 1 0 8 0 zombiepl 144 418 0 418 2 1 1 1 0 8 1 processpl 1080 450 0 418 3 0 3 3 0 8 0 procpl 672 723 0 683 4 0 4 4 0 8 0 srpgc 96 2 0 2 1 0 1 1 0 8 1 sockpl 432 161 0 142 3 0 3 3 0 8 0 mcl64k 65536 4 0 0 1 0 1 1 0 8 0 mcl8k 8192 4 0 0 1 0 1 1 0 8 0 mcl4k 4096 4 0 0 1 0 1 1 0 8 0 mcl2k 2048 252 0 0 31 0 31 31 0 8 0 mtagpl 96 18 0 0 1 0 1 1 0 8 0 mbufpl 256 431 0 0 26 0 26 26 0 8 0 bufpl 280 3566 0 181 242 0 242 242 0 8 0 anonpl 24 51092 0 34980 100 2 98 98 0 186 0 amapchunkpl 152 2014 0 1640 16 0 16 16 0 158 1 amappl16 200 1335 0 686 35 0 35 35 0 8 0 amappl15 192 2 0 0 1 0 1 1 0 8 0 amappl14 184 25 0 21 1 0 1 1 0 8 0 amappl13 176 31 0 29 1 0 1 1 0 8 0 amappl12 168 107 0 105 2 1 1 1 0 8 0 amappl11 160 172 0 153 1 0 1 1 0 8 0 amappl10 152 19 0 13 1 0 1 1 0 8 0 amappl9 144 254 0 253 1 0 1 1 0 8 0 amappl8 136 140 0 104 2 0 2 2 0 8 0 amappl7 128 243 0 235 1 0 1 1 0 8 0 amappl6 120 68 0 59 1 0 1 1 0 8 0 amappl5 112 650 0 630 1 0 1 1 0 8 0 amappl4 104 481 0 457 1 0 1 1 0 8 0 amappl3 96 125 0 116 1 0 1 1 0 8 0 amappl2 88 2593 0 2524 3 1 2 3 0 8 0 amappl1 80 21573 0 21092 27 15 12 21 0 8 0 amappl 88 1018 0 930 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 2 0 0 1 0 1 1 0 8 0 uaddrrnd 24 435 0 418 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 435 0 418 1 0 1 1 0 8 0 vmmpekpl 168 6987 0 6960 2 0 2 2 0 8 0 vmmpepl 168 61853 0 59964 113 13 100 100 0 357 16 vmsppl 368 434 0 418 2 0 2 2 0 8 0 rwobjpl 56 15154 0 13782 29 8 21 21 0 8 1 pdppl 4096 877 0 837 63 18 45 45 0 8 5 pvpl 32 214662 0 195405 158 0 158 158 0 265 1 pmappl 232 434 0 418 2 0 2 2 0 8 1 extentpl 40 58 0 40 1 0 1 1 0 8 0 phpool 112 335 0 23 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(ffffffff8245fb0e) at panic+0x15e sys/kern/subr_prf.c:218 vrele(fffffd806e274250) at vrele+0x197 sys/kern/vfs_subr.c:803 ptmioctl(5100,40287401,ffff8000222c1d60,3,ffff80002123c000) at ptmioctl+0x5b9 sys/kern/tty_pty.c:1225 VOP_IOCTL(fffffd806e460c98,40287401,ffff8000222c1d60,3,fffffd807f7b77e0,ffff80002123c000) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:297 vn_ioctl(fffffd8065c56390,40287401,ffff8000222c1d60,ffff80002123c000) at vn_ioctl+0xba sys/kern/vfs_vnops.c:531 sys_ioctl(ffff80002123c000,ffff8000222c1e70,ffff8000222c1ec0) at sys_ioctl+0x4b0 syscall(ffff8000222c1f40) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff8000222c1f40) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x76052d41310, 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(ffffffff828d3f20) at __mp_lock+0x129 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff828d3f20) at __mp_lock+0x129 sys/kern/kern_lock.c:147 selwakeup(fffffd806f8655f0) at selwakeup+0x16 sys/kern/sys_generic.c:776 pipeselwakeup(fffffd806f8655d0) at pipeselwakeup+0x7c sys/kern/sys_pipe.c:370 pipe_write(fffffd806eb1dbe8,ffff800021272e38,0) at pipe_write+0x785 dofilewritev(ffff8000211c2548,1,ffff800021272e38,0,ffff800021272f20) at dofilewritev+0x1ab sys/kern/sys_generic.c:365 sys_write(ffff8000211c2548,ffff800021272ed0,ffff800021272f20) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff800021272fa0) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800021272fa0) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc0002f98f8, count: 4 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(ffffffff828d3f20) at __mp_lock+0x129 __mp_lock_spin sys/kern/kern_lock.c:116 [inline] __mp_lock(ffffffff828d3f20) at __mp_lock+0x129 sys/kern/kern_lock.c:147 selwakeup(fffffd806f8655f0) at selwakeup+0x16 sys/kern/sys_generic.c:776 pipeselwakeup(fffffd806f8655d0) at pipeselwakeup+0x7c sys/kern/sys_pipe.c:370 pipe_write(fffffd806eb1dbe8,ffff800021272e38,0) at pipe_write+0x785 dofilewritev(ffff8000211c2548,1,ffff800021272e38,0,ffff800021272f20) at dofilewritev+0x1ab sys/kern/sys_generic.c:365 sys_write(ffff8000211c2548,ffff800021272ed0,ffff800021272f20) at sys_write+0x83 sys/kern/sys_generic.c:285 syscall(ffff800021272fa0) at syscall+0x4a1 mi_syscall sys/sys/syscall_mi.h:102 [inline] syscall(ffff800021272fa0) at syscall+0x4a1 sys/arch/amd64/amd64/trap.c:590 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc0002f98f8, count: -11