panic: amap_pp_adjref: negative reference count Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *246557 63193 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 amap_pp_adjref(fffffd802b181788,e4,1df,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000abee00,0,1df000,e4000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000abee00,0,7,fffffd803f011660,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000abee00,0,7,fffffd803f011660,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff80001595e000,ffff8000ffff2c70) at vm_impl_init_vmx+0xf1 sys/arch/amd64/amd64/vmm.c:1270 vm_create(ffff800000a95800,ffff8000ffff2c70) at vm_create+0x193 vm_impl_init sys/arch/amd64/amd64/vmm.c:1385 [inline] vm_create(ffff800000a95800,ffff8000ffff2c70) at vm_create+0x193 sys/arch/amd64/amd64/vmm.c:1174 VOP_IOCTL(fffffd803be109c0,c5005601,ffff800000a95800,1,fffffd803f7c6ae0,ffff8000ffff2c70) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd80290bd4b8,c5005601,ffff800000a95800,ffff8000ffff2c70) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff8000ffff2c70,ffff800016b4bf88,ffff800016b4bfd0) at sys_ioctl+0x5b9 syscall(ffff800016b4c050) at syscall+0x507 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x17c2ad332c0, count: 3 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 amap_pp_adjref: negative reference count 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 amap_pp_adjref(fffffd802b181788,e4,1df,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000abee00,0,1df000,e4000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000abee00,0,7,fffffd803f011660,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000abee00,0,7,fffffd803f011660,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff80001595e000,ffff8000ffff2c70) at vm_impl_init_vmx+0xf1 sys/arch/amd64/amd64/vmm.c:1270 vm_create(ffff800000a95800,ffff8000ffff2c70) at vm_create+0x193 vm_impl_init sys/arch/amd64/amd64/vmm.c:1385 [inline] vm_create(ffff800000a95800,ffff8000ffff2c70) at vm_create+0x193 sys/arch/amd64/amd64/vmm.c:1174 VOP_IOCTL(fffffd803be109c0,c5005601,ffff800000a95800,1,fffffd803f7c6ae0,ffff8000ffff2c70) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd80290bd4b8,c5005601,ffff800000a95800,ffff8000ffff2c70) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff8000ffff2c70,ffff800016b4bf88,ffff800016b4bfd0) at sys_ioctl+0x5b9 syscall(ffff800016b4c050) at syscall+0x507 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x17c2ad332c0, count: -12 ddb> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800016b4b8e0 rbx 0xffff800016b4b990 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800016b4d000 rax 0xffff800000a70000 r8 0xffff800016b4b8a0 r9 0x1 r10 0xffff800000a70000 r11 0xc9aac233190fb559 r12 0x3000000008 r13 0xffff800016b4b8f0 r14 0x100 r15 0x1 rip 0xffffffff81fe1be8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800016b4b8d0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (syz-executor.0) pid=246557 stat=onproc flags process=0 proc=4000000 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff8000ffff2508,0xffffffff82599cf8 process=0xffff8000ffff7450 user=0xffff800016b47000, vmspace=0xfffffd803f011660 estcpu=36, cpticks=49, pctcpu=20.28 user=0, sys=11302, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 63193 136574 39393 0 2 0 syz-executor.0 *63193 246557 39393 0 7 0x4000000 syz-executor.0 12307 165272 1 0 3 0x100083 ttyin getty 21182 56928 0 0 3 0x14200 bored sosplice 39393 128246 33392 0 2 0x482 syz-executor.0 44569 498320 33392 0 2 0x482 syz-executor.1 33392 328853 66567 0 3 0x82 thrsleep syz-fuzzer 33392 372917 66567 0 2 0x4000482 syz-fuzzer 33392 15131 66567 0 3 0x4000082 thrsleep syz-fuzzer 33392 271041 66567 0 3 0x4000082 thrsleep syz-fuzzer 33392 504420 66567 0 3 0x4000082 thrsleep syz-fuzzer 33392 469468 66567 0 2 0x4000482 syz-fuzzer 33392 235161 66567 0 3 0x4000082 thrsleep syz-fuzzer 33392 312394 66567 0 3 0x4000082 kqread syz-fuzzer 66567 39613 1815 0 3 0x10008a pause ksh 1815 336955 78032 0 3 0x92 select sshd 78032 298564 1 0 3 0x80 select sshd 29453 328317 41231 73 2 0x100490 syslogd 41231 66749 1 0 3 0x100082 netio syslogd 18365 3954 1 77 3 0x100090 poll dhclient 82612 184784 1 0 3 0x80 poll dhclient 77918 69493 0 0 2 0x14200 zerothread 86496 184942 0 0 3 0x14200 aiodoned aiodoned 12745 202928 0 0 2 0x14200 update 78338 6588 0 0 3 0x14200 cleaner cleaner 95512 237548 0 0 3 0x14200 reaper reaper 54303 442728 0 0 3 0x14200 pgdaemon pagedaemon 38227 46667 0 0 3 0x14200 bored crynlk 34136 19038 0 0 3 0x14200 bored crypto 57601 30405 0 0 3 0x40014200 acpi0 acpi0 43385 62583 0 0 2 0x14200 softnet 43269 365414 0 0 2 0x14200 systqmp 59870 94731 0 0 3 0x14200 bored systq 36792 272397 0 0 2 0x40014200 softclock 18096 66609 0 0 3 0x40014200 idle0 5161 429258 0 0 3 0x14200 bored smr 1 291283 0 0 3 0x82 wait init 0 0 -1 0 2 0x10200 swapper ddb> show all locks No such command ddb> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9523 6359K 8343K 78643K 12461 0 0 pcb 13 8K 8K 78643K 160 0 0 rtable 101 11K 14K 78643K 618 0 0 ifaddr 92 17K 17K 78643K 305 0 0 counters 19 16K 16K 78643K 19 0 0 ioctlops 1 2K 2K 78643K 49 0 0 iov 0 0K 16K 78643K 141 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1225 77K 77K 78643K 1828 0 0 UFS quota 1 32K 32K 78643K 1 0 0 UFS mount 5 36K 36K 78643K 5 0 0 shm 2 1K 9K 78643K 16 0 0 VM map 10 2K 2K 78643K 12 0 0 sem 12 1K 1K 78643K 140 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1794 195K 288K 78643K 12646 0 0 file desc 5 13K 25K 78643K 661 0 0 sigio 0 0K 0K 78643K 20 0 0 proc 48 38K 63K 78643K 476 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 77 0 0 in_multi 80 3K 3K 78643K 126 0 0 ether_multi 1 0K 0K 78643K 5 0 0 mrt 1 0K 0K 78643K 6 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 48 212K 212K 78643K 48 0 0 exec 0 0K 1K 78643K 263 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 118 74K 74K 78643K 2475 0 0 UVM aobj 71 3K 3K 78643K 76 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 150 0 0 NDP 15 0K 0K 78643K 65 0 0 temp 147 3539K 4169K 78643K 15471 0 0 kqueue 0 0K 1K 78643K 382 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 8 0 4 1 0 1 1 0 8 0 rtpcb 80 125 0 123 1 0 1 1 0 8 0 rtentry 112 80 0 44 2 0 2 2 0 8 0 unpcb 120 435 0 427 1 0 1 1 0 8 0 syncache 264 7 0 7 2 2 0 1 0 8 0 tcpqe 32 152 0 152 1 1 0 1 0 8 0 tcpcb 544 312 0 308 2 1 1 2 0 8 0 ipq 40 13 0 13 3 2 1 1 0 8 1 ipqe 40 457 0 457 3 2 1 1 0 8 1 inpcb 280 1045 0 1038 5 3 2 2 0 8 1 rttmr 72 1 0 1 1 1 0 1 0 8 0 nd6 48 11 0 9 1 0 1 1 0 8 0 pkpcb 40 3 0 3 2 2 0 1 0 8 0 ppxss 1128 28 0 28 4 4 0 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 443 0 247 17 2 15 16 0 8 0 art_table 32 444 0 247 3 0 3 3 0 8 0 art_node 16 79 0 45 1 0 1 1 0 8 0 sysvmsgpl 40 24 0 10 1 0 1 1 0 8 0 semupl 112 2 0 2 1 1 0 1 0 8 0 semapl 112 136 0 126 1 0 1 1 0 8 0 shmpl 112 74 0 5 2 0 2 2 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 2529 0 1130 46 0 46 46 0 8 0 ffsino 240 2529 0 1130 83 0 83 83 0 8 0 nchpl 144 3919 0 3470 61 1 60 61 0 8 39 uvmvnodes 72 2988 0 0 55 0 55 55 0 8 0 vnodes 208 2988 0 0 158 0 158 158 0 8 0 namei 1024 11393 0 11393 2 1 1 1 0 8 1 vcpupl 1984 7 0 0 1 0 1 1 0 8 0 vmpool 520 10 0 2 1 0 1 1 0 8 0 scsiplug 64 7 0 7 3 3 0 1 0 8 0 scxspl 192 11486 0 11486 11 10 1 7 0 8 1 plimitpl 152 69 0 62 1 0 1 1 0 8 0 sigapl 432 832 0 819 2 0 2 2 0 8 0 futexpl 56 22788 0 22788 2 1 1 1 0 8 1 knotepl 112 588 0 569 5 4 1 2 0 8 0 kqueuepl 104 799 0 796 1 0 1 1 0 8 0 pipepl 128 492 0 473 3 2 1 2 0 8 0 fdescpl 424 833 0 819 2 0 2 2 0 8 0 filepl 120 7467 0 7370 10 6 4 6 0 8 0 lockfpl 104 226 0 225 1 0 1 1 0 8 0 lockfspl 48 85 0 84 1 0 1 1 0 8 0 sessionpl 112 18 0 8 1 0 1 1 0 8 0 pgrppl 48 36 0 26 1 0 1 1 0 8 0 ucredpl 96 747 0 740 1 0 1 1 0 8 0 zombiepl 144 819 0 818 1 0 1 1 0 8 0 processpl 864 848 0 818 4 0 4 4 0 8 0 procpl 632 1739 0 1701 4 0 4 4 0 8 0 sosppl 128 11 0 11 3 3 0 1 0 8 0 sockpl 384 1670 0 1653 9 5 4 5 0 8 2 mcl64k 65536 544 0 544 48 46 2 33 0 8 2 mcl16k 16384 6 0 6 4 3 1 1 0 8 1 mcl12k 12288 18 0 18 4 4 0 1 0 8 0 mcl9k 9216 9 0 9 3 2 1 1 0 8 1 mcl8k 8192 33 0 33 5 4 1 1 0 8 1 mcl4k 4096 95 0 95 3 2 1 1 0 8 1 mcl2k2 2112 7 0 7 5 4 1 1 0 8 1 mcl2k 2048 72279 0 72229 18 11 7 15 0 8 0 mtagpl 80 38 0 16 2 1 1 1 0 8 0 mbufpl 256 123026 0 122860 73 52 21 38 0 8 8 bufpl 256 9107 0 3885 327 0 327 327 0 8 0 anonpl 16 117719 0 93638 123 19 104 104 0 62 7 amapchunkpl 152 3905 0 3695 19 10 9 11 0 158 0 amappl16 192 6516 0 5211 101 32 69 72 0 8 3 amappl15 184 3 0 3 3 2 1 1 0 8 1 amappl14 176 45 0 40 1 0 1 1 0 8 0 amappl13 168 2 0 1 1 0 1 1 0 8 0 amappl12 160 15 0 14 1 0 1 1 0 8 0 amappl11 152 50 0 39 1 0 1 1 0 8 0 amappl10 144 9 0 8 1 0 1 1 0 8 0 amappl9 136 546 0 543 1 0 1 1 0 8 0 amappl8 128 165 0 135 1 0 1 1 0 8 0 amappl7 120 36 0 32 1 0 1 1 0 8 0 amappl6 112 71 0 60 1 0 1 1 0 8 0 amappl5 104 173 0 163 1 0 1 1 0 8 0 amappl4 96 1060 0 1026 1 0 1 1 0 8 0 amappl3 88 142 0 136 1 0 1 1 0 8 0 amappl2 80 5906 0 5837 3 1 2 3 0 8 0 amappl1 72 24475 0 24064 26 17 9 20 0 8 0 amappl 80 1980 0 1931 2 0 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 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 75 0 5 2 0 2 2 0 8 0 uaddrrnd 24 843 0 819 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 843 0 819 1 0 1 1 0 8 0 vmmpekpl 168 9030 0 9004 2 0 2 2 0 8 0 vmmpepl 168 105594 0 103190 151 35 116 130 0 357 11 vmsppl 272 832 0 819 2 1 1 2 0 8 0 pdppl 4096 1692 0 1649 7 1 6 6 0 8 0 pvpl 32 305510 0 278647 255 27 228 233 0 265 11 pmappl 200 842 0 821 3 1 2 2 0 8 0 extentpl 40 46 0 29 1 0 1 1 0 8 0 phpool 112 597 0 126 14 0 14 14 0 8 0