panic: mutex 0xfffffd806c0084b8 not held in mtx_leave Stopped at db_enter+0x25: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 403954 57533 32767 0x10 0 0 syz-executor db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff83078e14) at panic+0x1e5 sys/kern/subr_prf.c:198 mtx_leave(fffffd806c0084b8) at mtx_leave+0x17c sys/kern/kern_lock.c:335 msleep(fffffd806c0083d0,fffffd806c0084b8,4,ffffffff832a21d0,0) at msleep+0x125 sys/kern/kern_synch.c:249 vm_map_lock_ln(fffffd806c0083a0,ffffffff830e8868,208) at vm_map_lock_ln+0xd4 sys/uvm/uvm_map.c:5250 sys_munmap(ffff8000327942b0,ffff800037221220,ffff800037221170) at sys_munmap+0x1cc sys/uvm/uvm_mmap.c:526 syscall(ffff800037221220) at syscall+0xbb6 mi_syscall sys/sys/syscall_mi.h:179 [inline] syscall(ffff800037221220) at syscall+0xbb6 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x14e1ee5790, count: 7 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{1}> ddb{1}> set $lines = 0 ddb{1}> set $maxwidth = 0 ddb{1}> show panic *cpu1: mutex 0xfffffd806c0084b8 not held in mtx_leave ddb{1}> trace db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff83078e14) at panic+0x1e5 sys/kern/subr_prf.c:198 mtx_leave(fffffd806c0084b8) at mtx_leave+0x17c sys/kern/kern_lock.c:335 msleep(fffffd806c0083d0,fffffd806c0084b8,4,ffffffff832a21d0,0) at msleep+0x125 sys/kern/kern_synch.c:249 vm_map_lock_ln(fffffd806c0083a0,ffffffff830e8868,208) at vm_map_lock_ln+0xd4 sys/uvm/uvm_map.c:5250 sys_munmap(ffff8000327942b0,ffff800037221220,ffff800037221170) at sys_munmap+0x1cc sys/uvm/uvm_mmap.c:526 syscall(ffff800037221220) at syscall+0xbb6 mi_syscall sys/sys/syscall_mi.h:179 [inline] syscall(ffff800037221220) at syscall+0xbb6 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x14e1ee5790, count: -8 ddb{1}> show registers rdi 0 rsi 0x1 rbp 0xffff800037220ee0 rbx 0xffff800029b7cdbf rdx 0 rcx 0xffff8000327942b0 rax 0xffff800029b7bff0 r8 0x101010101010101 r9 0x8080808080808080 r10 0xf9c1a500dfff8f6e r11 0x4df4313164960a93 r12 0xffff800029b7cbc0 r13 0 r14 0 r15 0x1 rip 0xffffffff816a99e5 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff800037220ed0 ss 0x10 db_enter+0x25: addq $0x8,%rsp ddb{1}> show proc PROC (syz-executor) tid=161903 pid=50276 tcnt=3 stat=sleep flags process=10 proc=4000020 runpri=32, usrpri=63, slppri=4, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=0 forw=0xffffffffffffffff, list=0xffff8000ffff6cc0,0xffffffff8359f3c8 process=0xffff800032790930 user=0xffff80003721c000, vmspace=0xfffffd806c0083a0 estcpu=13, cpticks=0, pctcpu=0.0, user=0, sys=0, intr=0 ddb{1}> ps PID TID PPID UID S FLAGS WAIT COMMAND 98699 184153 66628 32767 2 0x10 syz-executor 98699 377752 66628 32767 2 0x4000010 syz-executor 57533 403954 68309 32767 7 0x10 syz-executor 57533 349926 68309 32767 3 0x4000090 fsleep syz-executor 57533 482705 68309 32767 3 0x4000090 fsleep syz-executor 30045 299313 14234 32767 2 0x10 syz-executor 30045 216167 14234 32767 3 0x4000090 fsleep syz-executor 33469 345648 63921 32767 3 0x90 nanoslp syz-executor 33469 50147 63921 32767 3 0x4000090 kqread syz-executor 33469 490514 63921 32767 3 0x4000090 fsleep syz-executor 50276 490187 6392 32767 2 0x10 syz-executor 50276 80409 6392 32767 3 0x4000090 fsleep syz-executor *50276 161903 6392 32767 3 0x4000030 syz-executor 23179 75165 393 32767 3 0x90 nanoslp syz-executor 23179 101252 393 32767 3 0x4000090 kqread syz-executor 23179 74623 393 32767 3 0x4000090 fsleep syz-executor 95894 403808 15999 32767 2 0x10 syz-executor 95894 470060 15999 32767 3 0x4000090 sbwait syz-executor 95894 344168 15999 32767 3 0x4000090 fsleep syz-executor 90718 277760 87089 32767 3 0x400090 nanoslp syz-executor 90718 453459 87089 32767 3 0x4400090 netacc syz-executor 90718 196347 87089 32767 3 0x4400090 fsleep syz-executor 68309 176770 16255 32767 3 0x90 nanoslp syz-executor 63921 104834 84347 32767 3 0x90 nanoslp syz-executor 14234 234694 86221 32767 3 0x90 nanoslp syz-executor 66628 141751 24847 32767 3 0x90 nanoslp syz-executor 87089 349417 89897 32767 3 0x90 nanoslp syz-executor 393 119418 26235 32767 3 0x90 nanoslp syz-executor 15999 210145 34518 32767 3 0x90 nanoslp syz-executor 6392 287102 19326 32767 3 0x90 nanoslp syz-executor 86221 220218 67369 0 3 0x82 wait syz-executor 84347 467298 67369 0 3 0x82 wait syz-executor 16255 150546 67369 0 3 0x82 wait syz-executor 24847 448143 67369 0 3 0x82 wait syz-executor 26235 509030 67369 0 3 0x82 wait syz-executor 89897 176084 67369 0 3 0x82 wait syz-executor 34518 323355 67369 0 3 0x82 wait syz-executor 19326 390582 67369 0 3 0x82 wait syz-executor 67369 301886 4711 0 3 0x82 kqread syz-executor 4711 478098 76989 0 3 0x10008a sigsusp ksh 76989 306878 42501 0 3 0x98 kqread sshd-session 42501 170573 89477 0 3 0x92 kqread sshd-session 98988 327016 1 0 3 0x100083 ttyin getty 89477 427895 1 0 3 0x88 kqread sshd 53785 361408 94947 73 3 0x1100090 kqread syslogd 94947 77429 1 0 3 0x100082 sbwait syslogd 39144 47821 1 0 3 0x100080 kqread resolvd 33569 375574 62106 77 3 0x100092 kqread dhcpleased 83325 489660 62106 77 3 0x100092 kqread dhcpleased 62106 16535 1 0 3 0x80 kqread dhcpleased 77913 101740 0 0 3 0x14200 bored smr 58734 523695 0 0 2 0x14200 zerothread 96212 8910 0 0 3 0x14200 aiodoned aiodoned 71599 411958 0 0 3 0x14200 syncer update 18413 242964 0 0 3 0x14200 cleaner cleaner 51925 1674 0 0 3 0x14200 reaper reaper 5109 479693 0 0 3 0x14200 pgdaemon pagedaemon 53207 395630 0 0 3 0x14200 bored viomb 61178 380301 0 0 3 0x40014200 acpi0 acpi0 32140 297044 0 0 3 0x40014200 idle1 481 10536 0 0 3 0x14200 bored softnet3 45057 342190 0 0 3 0x14200 bored softnet2 49557 232454 0 0 3 0x14200 bored softnet1 81912 46936 0 0 3 0x14200 bored softnet0 68286 123090 0 0 3 0x14200 bored systqmp 77558 279005 0 0 3 0x14200 bored systq 50267 362414 0 0 3 0x14200 tmoslp softclockmp 41756 83186 0 0 3 0x40014200 tmoslp softclock 51107 77957 0 0 3 0x40014200 idle0 1 257867 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{1}> show all locks CPU 1: exclusive mutex &map->flags_lock r = 0 (0xfffffd806c0084f8) #0 witness_lock+0x5bb stacktrace_save sys/sys/stacktrace.h:37 [inline] #0 witness_lock+0x5bb sys/kern/subr_witness.c:1155 #1 mtx_enter_try+0x178 #2 mtx_enter+0x60 sys/kern/kern_lock.c:239 #3 vm_map_lock_ln+0x153 sys/uvm/uvm_map.c:5258 #4 sys_munmap+0x1cc sys/uvm/uvm_mmap.c:526 #5 syscall+0xbb6 mi_syscall sys/sys/syscall_mi.h:179 [inline] #5 syscall+0xbb6 sys/arch/amd64/amd64/trap.c:577 #6 Xsyscall+0x128 Process 50276 (syz-executor) thread 0xffff8000ffff7968 (80409) exclusive rwlock amaplk r = 0 (0xfffffd806b433780) #0 witness_lock+0x5bb stacktrace_save sys/sys/stacktrace.h:37 [inline] #0 witness_lock+0x5bb sys/kern/subr_witness.c:1155 #1 uvm_map_clean+0x411 sys/uvm/uvm_map.c:4498 #2 syscall+0xaf8 mi_syscall sys/sys/syscall_mi.h:179 [inline] #2 syscall+0xaf8 sys/arch/amd64/amd64/trap.c:577 #3 Xsyscall+0x128 exclusive kernel_lock &kernel_lock r = 0 (0xffffffff835a2200) #0 witness_lock+0x5bb stacktrace_save sys/sys/stacktrace.h:37 [inline] #0 witness_lock+0x5bb sys/kern/subr_witness.c:1155 #1 syscall+0xad6 mi_syscall sys/sys/syscall_mi.h:179 [inline] #1 syscall+0xad6 sys/arch/amd64/amd64/trap.c:577 #2 Xsyscall+0x128 ddb{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10178 11046K 11059K 166960K 11256 0 pcb 17 12K 12K 166960K 17 0 rtable 234 6K 6K 166960K 346 0 pf 31 16K 16K 166960K 31 0 ifaddr 42 7K 7K 166960K 44 0 ifgroup 50 2K 2K 166960K 50 0 counters 64 36K 36K 166960K 64 0 ioctlops 0 0K 2K 166960K 29 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1364 86K 86K 166960K 1380 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 2 1K 1K 166960K 2 0 VM map 2 1K 1K 166960K 2 0 sem 3 0K 0K 166960K 3 0 dirhash 12 2K 2K 166960K 12 0 ACPI 1690 195K 286K 166960K 12468 0 file desc 26 97K 125K 166960K 160 0 proc 58 79K 103K 166960K 474 0 subproc 104 6K 6K 166960K 104 0 NFS srvsock 1 0K 0K 166960K 1 0 NFS daemon 1 16K 16K 166960K 1 0 ip_moptions 0 0K 0K 166960K 5 0 in_multi 99 7K 7K 166960K 101 0 ether_multi 1 0K 0K 166960K 2 0 ISOFS mount 1 32K 32K 166960K 1 0 MSDOSFS mount 1 16K 16K 166960K 1 0 ttys 43 201K 201K 166960K 43 0 exec 0 0K 1K 166960K 332 0 tdb 3 0K 0K 166960K 3 0 VM swap 8 62K 64K 166960K 10 0 UVM amap 271 74K 74K 166960K 2824 0 UVM aobj 36 2K 2K 166960K 36 0 pinsyscall 47 94K 113K 166960K 1143 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 ip6_options 2 0K 0K 166960K 2 0 NDP 27 2K 2K 166960K 27 0 temp 37 6814K 6880K 166960K 3679 0 kqueue 17 26K 26K 166960K 28 0 SYN cache 2 16K 16K 166960K 2 0 ddb{1}> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle plcache 128 24 0 0 1 0 1 1 0 8 0 rtpcb 120 35 0 32 1 0 1 1 0 8 0 rtentry 112 111 0 1 4 0 4 4 0 8 0 unpcb 144 68 0 32 2 0 2 2 0 8 0 syncache 336 3 0 3 1 0 1 1 0 8 1 tcpcb 808 19 0 12 1 0 1 1 0 8 0 arp 120 18 0 0 1 0 1 1 0 8 0 inpcb 336 111 0 96 4 0 4 4 0 8 2 nd6 136 24 0 0 1 0 1 1 0 8 0 kcovpl 48 8 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 453 0 0 29 0 29 29 0 8 0 art_table 32 454 0 0 4 0 4 4 0 8 0 art_node 16 110 0 10 1 0 1 1 0 8 0 semapl 112 1 0 0 1 0 1 1 0 8 0 shmpl 112 33 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1564 0 63 94 0 94 94 0 8 0 ffsino 272 1564 0 63 101 0 101 101 0 8 0 nchpl 144 1776 0 99 63 0 63 63 0 8 0 uvmvnodes 80 1677 0 0 35 0 35 35 0 8 0 vnodes 216 1677 0 0 94 0 94 94 0 8 0 namei 1024 5135 0 5135 2 0 2 2 0 8 2 percpumem 16 46 0 0 1 0 1 1 0 8 0 kstatmem 264 22 0 0 2 0 2 2 0 8 0 scxspl 216 5143 0 5143 3 1 2 2 1 8 2 plimitpl 152 35 0 11 1 0 1 1 0 8 0 sigapl 424 430 0 374 8 0 8 8 0 8 0 futexpl 64 331 0 323 1 0 1 1 0 8 0 knotepl 120 269 0 0 9 0 9 9 0 8 0 kqueuepl 216 28 0 12 1 0 1 1 0 8 0 pipepl 320 98 0 71 3 0 3 3 0 8 0 fdescpl 496 412 0 374 7 1 6 6 0 8 0 filepl 152 1436 0 1162 11 0 11 11 0 8 0 lockfpl 104 13 0 10 1 0 1 1 0 8 0 lockfspl 48 8 0 5 1 0 1 1 0 8 0 sessionpl 144 21 0 5 1 0 1 1 0 8 0 pgrppl 48 30 0 6 1 0 1 1 0 8 0 ucredpl 104 90 0 71 1 0 1 1 0 8 0 zombiepl 144 374 0 374 1 0 1 1 0 8 1 processpl 1160 430 0 374 5 0 5 5 0 8 0 procpl 648 468 0 398 6 0 6 6 0 8 0 sockpl 664 215 0 161 6 0 6 6 0 8 1 mcl8k 8192 4 0 0 1 0 1 1 0 8 0 mcl4k 4096 133 0 0 17 0 17 17 0 8 0 mcl2k 2048 14 0 0 2 0 2 2 0 8 0 mtagpl 96 3 0 0 1 0 1 1 0 8 0 mbufpl 256 155 0 0 10 0 10 10 0 8 0 bufpl 280 2173 0 95 149 0 149 149 0 8 0 anonpl 24 131119 0 127687 24 0 24 24 0 185 3 amapchunkpl 152 8944 0 8320 24 0 24 24 0 158 0 amappl16 200 3431 0 3417 5 0 5 5 0 8 4 amappl15 192 6 0 6 1 0 1 1 0 8 1 amappl14 184 110 0 100 1 0 1 1 0 8 0 amappl13 176 7 0 7 1 0 1 1 0 8 1 amappl12 168 1022 0 984 2 0 2 2 0 8 0 amappl11 160 50 0 40 1 0 1 1 0 8 0 amappl10 152 12 0 12 1 1 0 1 0 8 0 amappl9 144 134 0 134 1 0 1 1 0 8 1 amappl8 136 16 0 15 1 0 1 1 0 8 0 amappl7 128 94 0 84 1 0 1 1 0 8 0 amappl6 120 158 0 157 1 0 1 1 0 8 0 amappl5 112 123 0 115 1 0 1 1 0 8 0 amappl4 104 276 0 261 1 0 1 1 0 8 0 amappl3 96 1747 0 1605 4 0 4 4 0 8 0 amappl2 88 630 0 571 2 0 2 2 0 8 0 amappl1 80 7193 0 6658 14 1 13 13 0 8 0 amappl 88 2496 0 2280 6 1 5 5 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 72 35 0 0 1 0 1 1 0 8 0 uaddrrnd 24 412 0 374 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 412 0 374 1 0 1 1 0 8 0 vmmpekpl 168 4697 0 4657 2 0 2 2 0 8 0 vmmpepl 168 33501 0 31467 89 0 89 89 0 357 0 vmsppl 448 411 0 374 5 0 5 5 0 8 0 rwobjpl 56 15314 0 12749 37 0 37 37 0 8 0 pdppl 4096 831 0 748 111 14 97 97 0 8 14 pvpl 32 10198 0 0 84 1 83 83 0 265 0 pmappl 248 411 0 374 4 1 3 3 0 8 0 extentpl 40 55 0 38 1 0 1 1 0 8 0 phpool 112 385 0 16 11 0 11 11 0 8 0 ddb{1}> machine ddbcpu 0 Stopped at x86_ipi_db+0x27: addq $0x8,%rsp x86_ipi_db(ffffffff834adff0) at x86_ipi_db+0x27 sys/arch/amd64/amd64/db_interface.c:393 x86_ipi_handler() at x86_ipi_handler+0xd9 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x27 __mp_lock(ffffffff835a1ff8) at __mp_lock+0x192 __mp_lock_spin sys/kern/kern_lock.c:113 [inline] __mp_lock(ffffffff835a1ff8) at __mp_lock+0x192 sys/kern/kern_lock.c:144 uvm_fault(fffffd806c9f38d0,a55a0db9000,0,1) at uvm_fault+0x1ed sys/uvm/uvm_fault.c:622 upageflttrap(ffff8000371d3bd0,a55a0db9000) at upageflttrap+0xa9 sys/arch/amd64/amd64/trap.c:188 usertrap(ffff8000371d3bd0) at usertrap+0x2d8 sys/arch/amd64/amd64/trap.c:436 recall_trap() at recall_trap+0x8 end of kernel end trace frame: 0x7c8c885f2f60, count: 7 ddb{0}> trace x86_ipi_db(ffffffff834adff0) at x86_ipi_db+0x27 sys/arch/amd64/amd64/db_interface.c:393 x86_ipi_handler() at x86_ipi_handler+0xd9 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x27 __mp_lock(ffffffff835a1ff8) at __mp_lock+0x192 __mp_lock_spin sys/kern/kern_lock.c:113 [inline] __mp_lock(ffffffff835a1ff8) at __mp_lock+0x192 sys/kern/kern_lock.c:144 uvm_fault(fffffd806c9f38d0,a55a0db9000,0,1) at uvm_fault+0x1ed sys/uvm/uvm_fault.c:622 upageflttrap(ffff8000371d3bd0,a55a0db9000) at upageflttrap+0xa9 sys/arch/amd64/amd64/trap.c:188 usertrap(ffff8000371d3bd0) at usertrap+0x2d8 sys/arch/amd64/amd64/trap.c:436 recall_trap() at recall_trap+0x8 end of kernel end trace frame: 0x7c8c885f2f60, count: -8 ddb{0}> machine ddbcpu 1 Stopped at db_enter+0x25: addq $0x8,%rsp db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff83078e14) at panic+0x1e5 sys/kern/subr_prf.c:198 mtx_leave(fffffd806c0084b8) at mtx_leave+0x17c sys/kern/kern_lock.c:335 msleep(fffffd806c0083d0,fffffd806c0084b8,4,ffffffff832a21d0,0) at msleep+0x125 sys/kern/kern_synch.c:249 vm_map_lock_ln(fffffd806c0083a0,ffffffff830e8868,208) at vm_map_lock_ln+0xd4 sys/uvm/uvm_map.c:5250 sys_munmap(ffff8000327942b0,ffff800037221220,ffff800037221170) at sys_munmap+0x1cc sys/uvm/uvm_mmap.c:526 syscall(ffff800037221220) at syscall+0xbb6 mi_syscall sys/sys/syscall_mi.h:179 [inline] syscall(ffff800037221220) at syscall+0xbb6 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x14e1ee5790, count: 7 ddb{1}> trace db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff83078e14) at panic+0x1e5 sys/kern/subr_prf.c:198 mtx_leave(fffffd806c0084b8) at mtx_leave+0x17c sys/kern/kern_lock.c:335 msleep(fffffd806c0083d0,fffffd806c0084b8,4,ffffffff832a21d0,0) at msleep+0x125 sys/kern/kern_synch.c:249 vm_map_lock_ln(fffffd806c0083a0,ffffffff830e8868,208) at vm_map_lock_ln+0xd4 sys/uvm/uvm_map.c:5250 sys_munmap(ffff8000327942b0,ffff800037221220,ffff800037221170) at sys_munmap+0x1cc sys/uvm/uvm_mmap.c:526 syscall(ffff800037221220) at syscall+0xbb6 mi_syscall sys/sys/syscall_mi.h:179 [inline] syscall(ffff800037221220) at syscall+0xbb6 sys/arch/amd64/amd64/trap.c:577 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x14e1ee5790, count: -8