panic: amap_pp_adjref: negative reference count Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *210269 88264 0 0 0x4000000 0 syz-executor.1 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(fffffd8029b5db48,7f0,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000a78300,0,200000,7f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000a78300,0,7,fffffd803f011330,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000a78300,0,7,fffffd803f011330,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800017969a68,ffff8000ffff38c8) at vm_impl_init_vmx+0xf1 sys/arch/amd64/amd64/vmm.c:1270 vm_create(ffff800000a6f000,ffff8000ffff38c8) at vm_create+0x193 vm_impl_init sys/arch/amd64/amd64/vmm.c:1385 [inline] vm_create(ffff800000a6f000,ffff8000ffff38c8) at vm_create+0x193 sys/arch/amd64/amd64/vmm.c:1174 VOP_IOCTL(fffffd8037c8e820,c5005601,ffff800000a6f000,1,fffffd803f7c6a80,ffff8000ffff38c8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd802f089e98,c5005601,ffff800000a6f000,ffff8000ffff38c8) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff8000ffff38c8,ffff80001491a1b8,ffff80001491a200) at sys_ioctl+0x5b9 syscall(ffff80001491a280) at syscall+0x507 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xdb2ca7b1040, 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(fffffd8029b5db48,7f0,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000a78300,0,200000,7f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000a78300,0,7,fffffd803f011330,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000a78300,0,7,fffffd803f011330,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800017969a68,ffff8000ffff38c8) at vm_impl_init_vmx+0xf1 sys/arch/amd64/amd64/vmm.c:1270 vm_create(ffff800000a6f000,ffff8000ffff38c8) at vm_create+0x193 vm_impl_init sys/arch/amd64/amd64/vmm.c:1385 [inline] vm_create(ffff800000a6f000,ffff8000ffff38c8) at vm_create+0x193 sys/arch/amd64/amd64/vmm.c:1174 VOP_IOCTL(fffffd8037c8e820,c5005601,ffff800000a6f000,1,fffffd803f7c6a80,ffff8000ffff38c8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd802f089e98,c5005601,ffff800000a6f000,ffff8000ffff38c8) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff8000ffff38c8,ffff80001491a1b8,ffff80001491a200) at sys_ioctl+0x5b9 syscall(ffff80001491a280) at syscall+0x507 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xdb2ca7b1040, count: -12 ddb> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800014919b10 rbx 0xffff800014919bc0 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800015923000 rax 0xffff800000a67ac0 r8 0xffff800014919ad0 r9 0x1 r10 0xffff800000a67ac0 r11 0x6402d0d08f1e0f3c r12 0x3000000008 r13 0xffff800014919b20 r14 0x100 r15 0x1 rip 0xffffffff81056c28 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800014919b00 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (syz-executor.1) pid=210269 stat=onproc flags process=0 proc=4000000 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff8000ffff2ee8,0xffff8000ffff2a08 process=0xffff8000ffff6a30 user=0xffff800014915000, vmspace=0xfffffd803f011330 estcpu=36, cpticks=79, pctcpu=20.28 user=0, sys=11478, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 21262 511996 17714 0 2 0 syz-executor.0 21262 64158 17714 0 3 0x4000080 fsleep syz-executor.0 21262 449751 17714 0 3 0x4000080 fsleep syz-executor.0 88264 495038 36852 0 2 0 syz-executor.1 *88264 210269 36852 0 7 0x4000000 syz-executor.1 12610 336042 0 0 3 0x14200 bored sosplice 36852 485240 2128 0 2 0x482 syz-executor.1 17714 362306 2128 0 2 0x482 syz-executor.0 2128 205982 14208 0 3 0x82 thrsleep syz-fuzzer 2128 402056 14208 0 2 0x4000482 syz-fuzzer 2128 345785 14208 0 3 0x4000082 kqread syz-fuzzer 2128 449759 14208 0 3 0x4000082 thrsleep syz-fuzzer 2128 431988 14208 0 3 0x4000082 thrsleep syz-fuzzer 2128 267630 14208 0 2 0x4000482 syz-fuzzer 2128 204653 14208 0 3 0x4000082 thrsleep syz-fuzzer 14208 179630 92353 0 3 0x10008a pause ksh 92353 269284 97283 0 3 0x92 select sshd 51905 451144 1 0 3 0x100083 ttyin getty 97283 504291 1 0 3 0x80 select sshd 87158 117676 57052 73 2 0x100490 syslogd 57052 19611 1 0 3 0x100082 netio syslogd 32596 317296 1 77 3 0x100090 poll dhclient 25381 517923 1 0 3 0x80 poll dhclient 81398 219427 0 0 2 0x14200 zerothread 34034 169153 0 0 3 0x14200 aiodoned aiodoned 23268 159102 0 0 2 0x14200 update 77930 3914 0 0 3 0x14200 cleaner cleaner 91111 189686 0 0 3 0x14200 reaper reaper 18340 16981 0 0 3 0x14200 pgdaemon pagedaemon 64712 220538 0 0 3 0x14200 bored crynlk 99287 199364 0 0 3 0x14200 bored crypto 82903 193024 0 0 3 0x40014200 acpi0 acpi0 27837 318238 0 0 2 0x14200 softnet 67152 513303 0 0 2 0x14200 systqmp 72923 49707 0 0 3 0x14200 bored systq 87648 36118 0 0 2 0x40014200 softclock 48961 172178 0 0 3 0x40014200 idle0 37800 177324 0 0 3 0x14200 bored smr 1 257007 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 9453 6331K 6331K 78643K 10551 0 0 pcb 13 8K 8K 78643K 13 0 0 rtable 105 3K 3K 78643K 191 0 0 ifaddr 39 10K 10K 78643K 39 0 0 counters 19 16K 16K 78643K 19 0 0 ioctlops 1 2K 2K 78643K 18 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1212 76K 76K 78643K 1234 0 0 UFS quota 1 32K 32K 78643K 1 0 0 UFS mount 5 36K 36K 78643K 5 0 0 shm 3 5K 5K 78643K 3 0 0 VM map 3 0K 0K 78643K 3 0 0 sem 4 0K 0K 78643K 4 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1794 195K 288K 78643K 12646 0 0 file desc 6 17K 25K 78643K 40 0 0 proc 47 38K 63K 78643K 358 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 37 0 0 ether_multi 1 0K 0K 78643K 1 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 182 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 105 34K 34K 78643K 924 0 0 UVM aobj 3 2K 2K 78643K 3 0 0 memdesc 1 4K 4K 78643K 1 0 0 crypto data 1 1K 1K 78643K 1 0 0 NDP 5 0K 0K 78643K 9 0 0 temp 66 3524K 3588K 78643K 3177 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 19 0 17 1 0 1 1 0 8 0 rtentry 112 45 0 1 2 0 2 2 0 8 0 unpcb 120 37 0 29 1 0 1 1 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 278 0 278 1 0 1 1 0 8 1 tcpcb 544 14 0 10 1 0 1 1 0 8 0 inpcb 280 43 0 35 2 0 2 2 0 8 1 nd6 48 4 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 212 0 0 14 0 14 14 0 8 0 art_table 32 213 0 0 2 0 2 2 0 8 0 art_node 16 44 0 4 1 0 1 1 0 8 0 sysvmsgpl 40 6 0 4 1 0 1 1 0 8 0 semapl 112 2 0 0 1 0 1 1 0 8 0 shmpl 112 1 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 1436 0 40 46 0 46 46 0 8 0 ffsino 240 1436 0 40 83 0 83 83 0 8 0 nchpl 144 1686 0 78 60 0 60 60 0 8 0 uvmvnodes 72 1479 0 0 27 0 27 27 0 8 0 vnodes 208 1479 0 0 78 0 78 78 0 8 0 namei 1024 4095 0 4095 1 0 1 1 0 8 1 vmpool 520 1 0 0 1 0 1 1 0 8 0 scxspl 192 4488 0 4488 8 1 7 7 0 8 7 plimitpl 152 14 0 7 1 0 1 1 0 8 0 sigapl 432 210 0 196 2 0 2 2 0 8 0 futexpl 56 326 0 324 1 0 1 1 0 8 0 knotepl 112 53 0 34 1 0 1 1 0 8 0 kqueuepl 104 3 0 0 1 0 1 1 0 8 0 pipepl 128 134 0 115 2 1 1 1 0 8 0 fdescpl 424 211 0 196 2 0 2 2 0 8 0 filepl 120 1148 0 1046 4 0 4 4 0 8 0 lockfpl 104 6 0 4 1 0 1 1 0 8 0 lockfspl 48 4 0 2 1 0 1 1 0 8 0 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 145 0 138 1 0 1 1 0 8 0 zombiepl 144 196 0 196 2 1 1 1 0 8 1 processpl 864 226 0 196 4 0 4 4 0 8 0 procpl 632 249 0 210 4 0 4 4 0 8 0 sockpl 384 99 0 81 4 0 4 4 0 8 2 mcl8k 8192 2 0 2 1 0 1 1 0 8 1 mcl4k 4096 8 0 8 1 1 0 1 0 8 0 mcl2k 2048 69876 0 69821 20 4 16 17 0 8 8 mtagpl 80 2 0 2 1 1 0 1 0 8 0 mbufpl 256 110310 0 110177 13 2 11 11 0 8 2 bufpl 256 6104 0 1327 299 0 299 299 0 8 0 anonpl 16 39640 0 20342 80 2 78 78 0 62 0 amapchunkpl 152 1049 0 884 9 0 9 9 0 158 2 amappl16 192 1171 0 120 53 0 53 53 0 8 0 amappl15 184 18 0 14 1 0 1 1 0 8 0 amappl14 176 46 0 40 1 0 1 1 0 8 0 amappl13 168 1 0 1 1 1 0 1 0 8 0 amappl12 160 2 0 2 1 1 0 1 0 8 0 amappl11 152 52 0 41 1 0 1 1 0 8 0 amappl10 144 15 0 9 1 0 1 1 0 8 0 amappl9 136 561 0 557 1 0 1 1 0 8 0 amappl8 128 148 0 123 2 0 2 2 0 8 0 amappl7 120 40 0 33 1 0 1 1 0 8 0 amappl6 112 56 0 48 1 0 1 1 0 8 0 amappl5 104 134 0 124 1 0 1 1 0 8 0 amappl4 96 416 0 388 1 0 1 1 0 8 0 amappl3 88 110 0 104 1 0 1 1 0 8 0 amappl2 80 907 0 831 4 2 2 3 0 8 0 amappl1 72 13353 0 12931 27 11 16 20 0 8 7 amappl 80 476 0 426 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 2 0 0 1 0 1 1 0 8 0 uaddrrnd 24 212 0 196 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 212 0 196 1 0 1 1 0 8 0 vmmpekpl 168 5766 0 5742 2 0 2 2 0 8 0 vmmpepl 168 33426 0 31210 147 12 135 135 0 357 38 vmsppl 272 210 0 196 2 0 2 2 0 8 1 pdppl 4096 430 0 392 6 0 6 6 0 8 1 pvpl 32 127717 0 104866 188 3 185 185 0 265 0 pmappl 200 211 0 196 1 0 1 1 0 8 0 extentpl 40 46 0 29 1 0 1 1 0 8 0 phpool 112 447 0 9 13 0 13 13 0 8 0