panic: amap_pp_adjref: negative reference count Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *346050 75028 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(fffffd802d6a5e18,1f0,fec,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000a90a00,0,fec000,1f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000a90a00,0,7,fffffd803f013dd0,20200000,80000000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000a90a00,0,7,fffffd803f013dd0,20200000,80000000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800017b55c70,ffff8000ffff2290) at vm_impl_init_vmx+0xf1 sys/arch/amd64/amd64/vmm.c:1270 vm_create(ffff800000a8d000,ffff8000ffff2290) at vm_create+0x193 vm_impl_init sys/arch/amd64/amd64/vmm.c:1385 [inline] vm_create(ffff800000a8d000,ffff8000ffff2290) at vm_create+0x193 sys/arch/amd64/amd64/vmm.c:1174 VOP_IOCTL(fffffd803660aa90,c5005601,ffff800000a8d000,1,fffffd803f7c67e0,ffff8000ffff2290) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd802dc93888,c5005601,ffff800000a8d000,ffff8000ffff2290) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff8000ffff2290,ffff800017b71d08,ffff800017b71d50) at sys_ioctl+0x5b9 syscall(ffff800017b71dd0) at syscall+0x507 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x44b524ca9b0, 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(fffffd802d6a5e18,1f0,fec,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000a90a00,0,fec000,1f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000a90a00,0,7,fffffd803f013dd0,20200000,80000000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000a90a00,0,7,fffffd803f013dd0,20200000,80000000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800017b55c70,ffff8000ffff2290) at vm_impl_init_vmx+0xf1 sys/arch/amd64/amd64/vmm.c:1270 vm_create(ffff800000a8d000,ffff8000ffff2290) at vm_create+0x193 vm_impl_init sys/arch/amd64/amd64/vmm.c:1385 [inline] vm_create(ffff800000a8d000,ffff8000ffff2290) at vm_create+0x193 sys/arch/amd64/amd64/vmm.c:1174 VOP_IOCTL(fffffd803660aa90,c5005601,ffff800000a8d000,1,fffffd803f7c67e0,ffff8000ffff2290) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd802dc93888,c5005601,ffff800000a8d000,ffff8000ffff2290) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff8000ffff2290,ffff800017b71d08,ffff800017b71d50) at sys_ioctl+0x5b9 syscall(ffff800017b71dd0) at syscall+0x507 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x44b524ca9b0, count: -12 ddb> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800017b71660 rbx 0xffff800017b71710 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800016b3f000 rax 0xffff800000a5ec40 r8 0xffff800017b71620 r9 0x1 r10 0xffff800000a5ec40 r11 0x7a0d92f54f52587a r12 0x3000000008 r13 0xffff800017b71670 r14 0x100 r15 0x1 rip 0xffffffff81210978 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800017b71650 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (syz-executor.1) pid=346050 stat=onproc flags process=0 proc=4000000 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff8000ffff3160,0xffff8000ffff33e8 process=0xffff8000ffff77b0 user=0xffff800017b6c000, vmspace=0xfffffd803f013dd0 estcpu=36, cpticks=69, pctcpu=20.28 user=0, sys=11034, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 75028 25809 73886 0 2 0 syz-executor.1 *75028 346050 73886 0 7 0x4000000 syz-executor.1 75028 186853 73886 0 3 0x4000080 fsleep syz-executor.1 43761 367668 0 0 2 0x14600 acct 22976 368769 0 0 3 0x14200 bored sosplice 73886 514547 27522 0 2 0x482 syz-executor.1 11521 501921 27522 0 2 0x2 syz-executor.0 27522 118495 48441 0 3 0x82 thrsleep syz-fuzzer 27522 110515 48441 0 2 0x4000482 syz-fuzzer 27522 224115 48441 0 2 0x4000482 syz-fuzzer 27522 490410 48441 0 3 0x4000082 thrsleep syz-fuzzer 27522 179040 48441 0 3 0x4000082 thrsleep syz-fuzzer 27522 192245 48441 0 3 0x4000082 kqread syz-fuzzer 27522 71743 48441 0 3 0x4000082 thrsleep syz-fuzzer 48441 482951 96563 0 3 0x10008a pause ksh 96563 240165 40186 0 3 0x92 select sshd 29300 273557 1 0 3 0x100083 ttyin getty 40186 319472 1 0 3 0x80 select sshd 54922 27840 62121 73 2 0x100010 syslogd 62121 163636 1 0 3 0x100082 netio syslogd 83069 179976 1 77 3 0x100090 poll dhclient 50766 506221 1 0 3 0x80 poll dhclient 3952 52254 0 0 2 0x14200 zerothread 48491 184852 0 0 3 0x14200 aiodoned aiodoned 6092 265473 0 0 2 0x14200 update 52724 495615 0 0 3 0x14200 cleaner cleaner 37485 450629 0 0 3 0x14200 reaper reaper 6154 459889 0 0 3 0x14200 pgdaemon pagedaemon 62277 353730 0 0 3 0x14200 bored crynlk 76414 465372 0 0 3 0x14200 bored crypto 15109 396621 0 0 3 0x40014200 acpi0 acpi0 62726 373320 0 0 2 0x14200 softnet 39190 293199 0 0 2 0x14200 systqmp 23859 520699 0 0 3 0x14200 bored systq 39618 406104 0 0 2 0x40014200 softclock 51546 225485 0 0 3 0x40014200 idle0 42631 505567 0 0 3 0x14200 bored smr 1 89211 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 9482 6332K 7808K 78643K 11258 0 0 pcb 13 8K 8K 78643K 66 0 0 rtable 108 3K 4K 78643K 236 0 0 ifaddr 71 13K 13K 78643K 92 0 0 counters 19 16K 16K 78643K 19 0 0 ioctlops 1 2K 2K 78643K 93 0 0 iov 0 0K 16K 78643K 52 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1233 77K 78K 78643K 1428 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 4 0 0 VM map 3 0K 0K 78643K 67 0 0 sem 12 1K 1K 78643K 26 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1793 195K 288K 78643K 12645 0 0 file desc 5 13K 25K 78643K 199 0 0 sigio 0 0K 0K 78643K 2 0 0 proc 48 38K 63K 78643K 385 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 11 0 0 in_multi 33 2K 2K 78643K 37 0 0 ether_multi 1 0K 0K 78643K 2 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 54 238K 238K 78643K 54 0 0 exec 0 0K 1K 78643K 215 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 100 37K 37K 78643K 1341 0 0 UVM aobj 27 2K 2K 78643K 27 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 34 0 0 NDP 11 0K 0K 78643K 20 0 0 temp 130 3530K 3595K 78643K 3805 0 0 kqueue 0 0K 0K 78643K 2 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 21 0 19 1 0 1 1 0 8 0 rtentry 112 45 0 1 2 0 2 2 0 8 0 unpcb 120 103 0 95 1 0 1 1 0 8 0 syncache 264 7 0 7 2 1 1 1 0 8 1 tcpqe 32 71 0 71 1 0 1 1 0 8 1 tcpcb 544 68 0 64 1 0 1 1 0 8 0 ipq 40 17 0 17 1 0 1 1 0 8 1 ipqe 40 541 0 541 1 0 1 1 0 8 1 inpcb 280 258 0 249 2 0 2 2 0 8 1 nd6 48 4 0 0 1 0 1 1 0 8 0 pkpcb 40 1 0 1 1 0 1 1 0 8 1 ppxss 1128 4 0 4 1 0 1 1 0 8 1 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 13 0 11 1 0 1 1 0 8 0 semupl 112 1 0 1 1 0 1 1 0 8 1 semapl 112 22 0 12 1 0 1 1 0 8 0 shmpl 112 25 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 1688 0 289 46 0 46 46 0 8 0 ffsino 240 1688 0 289 83 0 83 83 0 8 0 nchpl 144 2264 0 654 60 0 60 60 0 8 0 uvmvnodes 72 1904 0 0 35 0 35 35 0 8 0 vnodes 208 1904 0 0 101 0 101 101 0 8 0 namei 1024 6088 0 6087 1 0 1 1 0 8 0 vmpool 520 65 0 64 1 0 1 1 0 8 0 scxspl 192 6567 0 6567 8 1 7 7 0 8 7 plimitpl 152 39 0 32 1 0 1 1 0 8 0 sigapl 432 369 0 356 2 0 2 2 0 8 0 futexpl 56 5522 0 5521 1 0 1 1 0 8 0 knotepl 112 73 0 54 1 0 1 1 0 8 0 kqueuepl 104 27 0 25 1 0 1 1 0 8 0 pipepl 128 238 0 219 1 0 1 1 0 8 0 fdescpl 424 370 0 356 2 0 2 2 0 8 0 filepl 120 2663 0 2556 4 0 4 4 0 8 0 lockfpl 104 83 0 82 1 0 1 1 0 8 0 lockfspl 48 28 0 27 1 0 1 1 0 8 0 sessionpl 112 17 0 7 1 0 1 1 0 8 0 pgrppl 48 19 0 9 1 0 1 1 0 8 0 ucredpl 96 244 0 237 1 0 1 1 0 8 0 zombiepl 144 356 0 356 1 0 1 1 0 8 1 processpl 864 386 0 356 4 0 4 4 0 8 0 procpl 632 629 0 591 4 0 4 4 0 8 0 sosppl 128 3 0 3 1 1 0 1 0 8 0 sockpl 384 386 0 367 3 0 3 3 0 8 1 mcl64k 65536 26 0 26 1 0 1 1 0 8 1 mcl16k 16384 7 0 7 1 0 1 1 0 8 1 mcl12k 12288 3 0 3 1 0 1 1 0 8 1 mcl9k 9216 3 0 3 1 0 1 1 0 8 1 mcl8k 8192 9 0 9 1 0 1 1 0 8 1 mcl4k 4096 37 0 37 2 1 1 1 0 8 1 mcl2k 2048 65997 0 65951 15 7 8 13 0 8 2 mtagpl 80 39 0 2 2 1 1 1 0 8 0 mbufpl 256 108863 0 108721 43 25 18 25 0 8 8 bufpl 256 6787 0 1939 304 0 304 304 0 8 0 anonpl 16 53386 0 33269 85 2 83 83 0 62 1 amapchunkpl 152 1697 0 1547 9 2 7 9 0 158 1 amappl16 192 2119 0 1008 58 0 58 58 0 8 2 amappl14 176 130 0 122 1 0 1 1 0 8 0 amappl13 168 84 0 83 1 0 1 1 0 8 0 amappl12 160 12 0 9 2 1 1 1 0 8 0 amappl11 152 51 0 40 1 0 1 1 0 8 0 amappl10 144 8 0 7 1 0 1 1 0 8 0 amappl9 136 530 0 525 1 0 1 1 0 8 0 amappl8 128 153 0 125 1 0 1 1 0 8 0 amappl7 120 33 0 30 1 0 1 1 0 8 0 amappl6 112 55 0 46 1 0 1 1 0 8 0 amappl5 104 217 0 206 1 0 1 1 0 8 0 amappl4 96 668 0 641 1 0 1 1 0 8 0 amappl3 88 115 0 108 1 0 1 1 0 8 0 amappl2 80 2178 0 2114 3 1 2 3 0 8 0 amappl1 72 16008 0 15595 26 16 10 20 0 8 0 amappl 80 871 0 826 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 17 0 17 1 1 0 1 0 8 0 aobjpl 64 26 0 0 1 0 1 1 0 8 0 uaddrrnd 24 435 0 356 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 435 0 356 1 0 1 1 0 8 0 vmmpekpl 168 6725 0 6699 2 0 2 2 0 8 0 vmmpepl 168 51999 0 49828 132 10 122 127 0 357 22 vmsppl 272 369 0 356 2 1 1 2 0 8 0 pdppl 4096 876 0 840 6 1 5 6 0 8 0 pvpl 32 169398 0 146196 195 0 195 195 0 265 6 pmappl 200 434 0 420 1 0 1 1 0 8 0 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 480 0 37 14 0 14 14 0 8 0