panic: amap_pp_adjref: negative reference count Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *141763 45976 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(fffffd8031ceb5f8,e4,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000aa2800,0,200000,e4000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000aa2800,0,7,fffffd803f011110,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000aa2800,0,7,fffffd803f011110,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800015969860,ffff8000ffff29f8) at vm_impl_init_vmx+0xf1 sys/arch/amd64/amd64/vmm.c:1270 vm_create(ffff800000aab000,ffff8000ffff29f8) at vm_create+0x193 vm_impl_init sys/arch/amd64/amd64/vmm.c:1385 [inline] vm_create(ffff800000aab000,ffff8000ffff29f8) at vm_create+0x193 sys/arch/amd64/amd64/vmm.c:1174 VOP_IOCTL(fffffd80361849c0,c5005601,ffff800000aab000,1,fffffd803f7c6ba0,ffff8000ffff29f8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd80376711e0,c5005601,ffff800000aab000,ffff8000ffff29f8) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff8000ffff29f8,ffff800015959638,ffff800015959680) at sys_ioctl+0x5b9 syscall(ffff800015959700) at syscall+0x507 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x6f5a2bad780, 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(fffffd8031ceb5f8,e4,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000aa2800,0,200000,e4000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000aa2800,0,7,fffffd803f011110,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000aa2800,0,7,fffffd803f011110,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800015969860,ffff8000ffff29f8) at vm_impl_init_vmx+0xf1 sys/arch/amd64/amd64/vmm.c:1270 vm_create(ffff800000aab000,ffff8000ffff29f8) at vm_create+0x193 vm_impl_init sys/arch/amd64/amd64/vmm.c:1385 [inline] vm_create(ffff800000aab000,ffff8000ffff29f8) at vm_create+0x193 sys/arch/amd64/amd64/vmm.c:1174 VOP_IOCTL(fffffd80361849c0,c5005601,ffff800000aab000,1,fffffd803f7c6ba0,ffff8000ffff29f8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd80376711e0,c5005601,ffff800000aab000,ffff8000ffff29f8) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff8000ffff29f8,ffff800015959638,ffff800015959680) at sys_ioctl+0x5b9 syscall(ffff800015959700) at syscall+0x507 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x6f5a2bad780, count: -12 ddb> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800015958f90 rbx 0xffff800015959040 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff80001574d000 rax 0xffff800000a6e1c0 r8 0xffff800015958f50 r9 0x1 r10 0xffff800000a6e1c0 r11 0x70b49025131778ea r12 0x3000000008 r13 0xffff800015958fa0 r14 0x100 r15 0x1 rip 0xffffffff811e7a38 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800015958f80 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (syz-executor.1) pid=141763 stat=onproc flags process=0 proc=4000000 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff8000ffff38c8,0xffffffff82591710 process=0xffff8000ffff7450 user=0xffff800015954000, vmspace=0xfffffd803f011110 estcpu=36, cpticks=19, pctcpu=20.28 user=0, sys=11136, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 45976 95180 94036 0 2 0x480 syz-executor.1 *45976 141763 94036 0 7 0x4000000 syz-executor.1 10381 230133 56830 0 2 0x480 syz-executor.0 10381 524080 56830 0 2 0x4000480 syz-executor.0 88546 462833 0 0 2 0x14600 acct 94036 64374 43461 0 2 0x482 syz-executor.1 56830 10053 43461 0 2 0x482 syz-executor.0 93256 214078 0 0 3 0x14200 bored sosplice 43461 49892 16855 0 3 0x82 thrsleep syz-fuzzer 43461 52916 16855 0 2 0x4000482 syz-fuzzer 43461 427305 16855 0 3 0x4000082 thrsleep syz-fuzzer 43461 415225 16855 0 3 0x4000082 thrsleep syz-fuzzer 43461 86267 16855 0 2 0x4000482 syz-fuzzer 43461 505978 16855 0 3 0x4000082 kqread syz-fuzzer 43461 407145 16855 0 3 0x4000082 thrsleep syz-fuzzer 43461 65390 16855 0 3 0x4000082 thrsleep syz-fuzzer 16855 180583 98630 0 3 0x10008a pause ksh 98630 5857 1889 0 3 0x92 select sshd 94822 416140 1 0 3 0x100083 ttyin getty 1889 364390 1 0 3 0x80 select sshd 45878 194806 28186 73 2 0x100490 syslogd 28186 241542 1 0 3 0x100082 netio syslogd 13355 111279 1 77 3 0x100090 poll dhclient 93637 183769 1 0 3 0x80 poll dhclient 58717 487096 0 0 2 0x14200 zerothread 23178 373648 0 0 3 0x14200 aiodoned aiodoned 93184 92375 0 0 2 0x14200 update 13404 179854 0 0 3 0x14200 cleaner cleaner 64799 85636 0 0 3 0x14200 reaper reaper 23058 402456 0 0 3 0x14200 pgdaemon pagedaemon 82378 94177 0 0 3 0x14200 bored crynlk 33157 195898 0 0 3 0x14200 bored crypto 78611 148524 0 0 3 0x40014200 acpi0 acpi0 76958 147272 0 0 2 0x14200 softnet 16982 5096 0 0 2 0x14200 systqmp 35741 174621 0 0 3 0x14200 bored systq 70633 313692 0 0 2 0x40014200 softclock 29712 473395 0 0 3 0x40014200 idle0 81366 50383 0 0 3 0x14200 bored smr 1 115683 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 9505 6352K 6798K 78643K 11906 0 0 pcb 13 8K 8K 78643K 173 0 0 rtable 100 3K 4K 78643K 534 0 0 ifaddr 87 15K 16K 78643K 165 0 0 counters 19 16K 16K 78643K 19 0 0 ioctlops 1 2K 2K 78643K 53 0 0 iov 0 0K 18K 78643K 151 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1214 76K 77K 78643K 1739 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 10 0 0 VM map 16 4K 4K 78643K 18 0 0 sem 12 0K 0K 78643K 101 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1794 195K 288K 78643K 12646 0 0 file desc 6 17K 25K 78643K 667 0 0 sigio 0 0K 0K 78643K 38 0 0 proc 49 38K 63K 78643K 547 0 0 subproc 32 2K 2K 78643K 85 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 52 0 0 in_multi 58 3K 3K 78643K 127 0 0 ether_multi 1 0K 0K 78643K 7 0 0 mrt 0 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 60 265K 265K 78643K 60 0 0 exec 0 0K 1K 78643K 316 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 140 91K 91K 78643K 2549 0 0 UVM aobj 26 2K 2K 78643K 28 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 181 0 0 NDP 12 0K 0K 78643K 37 0 0 temp 133 3530K 3597K 78643K 30711 0 0 kqueue 0 0K 0K 78643K 12 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 27 0 20 1 0 1 1 0 8 0 rtpcb 80 84 0 82 1 0 1 1 0 8 0 rtentry 112 115 0 75 2 0 2 2 0 8 0 unpcb 120 487 0 479 1 0 1 1 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpqe 32 152 0 152 1 1 0 1 0 8 0 tcpcb 544 265 0 261 1 0 1 1 0 8 0 ipq 40 6 0 6 2 2 0 1 0 8 0 ipqe 40 184 0 184 2 2 0 1 0 8 0 inpcb 280 809 0 802 3 1 2 2 0 8 1 nd6 48 12 0 9 1 0 1 1 0 8 0 pkpcb 40 2 0 2 1 1 0 1 0 8 0 ppxss 1128 7 0 7 3 2 1 1 0 8 1 art_heap8 4096 2 0 0 2 0 2 2 0 8 0 art_heap4 256 452 0 242 17 3 14 15 0 8 0 art_table 32 454 0 242 2 0 2 2 0 8 0 art_node 16 114 0 77 1 0 1 1 0 8 0 sysvmsgpl 40 40 0 23 1 0 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 97 0 87 1 0 1 1 0 8 0 shmpl 112 26 0 2 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 2417 0 1022 46 0 46 46 0 8 0 ffsino 240 2417 0 1022 83 0 83 83 0 8 0 nchpl 144 3829 0 2226 60 0 60 60 0 8 0 uvmvnodes 72 2792 0 0 51 0 51 51 0 8 0 vnodes 208 2792 0 0 147 0 147 147 0 8 0 namei 1024 12408 0 12408 1 0 1 1 0 8 1 vcpupl 1984 13 0 0 2 0 2 2 0 8 0 vmpool 520 16 0 2 1 0 1 1 0 8 0 scxspl 192 11351 0 11351 11 7 4 7 0 8 4 plimitpl 152 70 0 63 1 0 1 1 0 8 0 sigapl 432 828 0 814 2 0 2 2 0 8 0 futexpl 56 17345 0 17343 1 0 1 1 0 8 0 knotepl 112 156 0 137 1 0 1 1 0 8 0 kqueuepl 104 144 0 141 1 0 1 1 0 8 0 pipepl 128 566 0 547 4 2 2 2 0 8 1 fdescpl 424 829 0 814 2 0 2 2 0 8 0 filepl 120 7382 0 7285 5 1 4 5 0 8 1 lockfpl 104 184 0 183 1 0 1 1 0 8 0 lockfspl 48 65 0 64 1 0 1 1 0 8 0 sessionpl 112 20 0 10 1 0 1 1 0 8 0 pgrppl 48 24 0 14 1 0 1 1 0 8 0 ucredpl 96 1626 0 1619 1 0 1 1 0 8 0 zombiepl 144 816 0 816 1 0 1 1 0 8 1 processpl 864 847 0 816 4 0 4 4 0 8 0 procpl 632 1658 0 1618 4 0 4 4 0 8 0 sosppl 128 5 0 5 2 2 0 1 0 8 0 sockpl 384 1404 0 1387 6 3 3 5 0 8 1 mcl64k 65536 102 0 102 4 3 1 4 0 8 1 mcl16k 16384 7 0 7 5 4 1 1 0 8 1 mcl12k 12288 21 0 21 1 0 1 1 0 8 1 mcl9k 9216 10 0 10 2 1 1 1 0 8 1 mcl8k 8192 23 0 23 2 1 1 1 0 8 1 mcl4k 4096 62 0 62 2 1 1 1 0 8 1 mcl2k2 2112 6 0 6 1 1 0 1 0 8 0 mcl2k 2048 71148 0 71095 19 12 7 18 0 8 0 mtagpl 80 33 0 12 3 2 1 1 0 8 0 mbufpl 256 118579 0 118414 32 19 13 25 0 8 0 bufpl 256 8294 0 3375 308 0 308 308 0 8 0 anonpl 16 139568 0 112786 131 11 120 120 0 62 5 amapchunkpl 152 4849 0 4334 27 5 22 22 0 158 0 amappl16 192 5793 0 4573 88 19 69 73 0 8 8 amappl15 184 1 0 0 1 0 1 1 0 8 0 amappl14 176 482 0 474 1 0 1 1 0 8 0 amappl12 160 107 0 106 1 0 1 1 0 8 0 amappl11 152 126 0 115 1 0 1 1 0 8 0 amappl10 144 18 0 16 1 0 1 1 0 8 0 amappl9 136 591 0 588 1 0 1 1 0 8 0 amappl8 128 199 0 169 1 0 1 1 0 8 0 amappl7 120 50 0 44 1 0 1 1 0 8 0 amappl6 112 121 0 111 1 0 1 1 0 8 0 amappl5 104 277 0 266 1 0 1 1 0 8 0 amappl4 96 818 0 792 1 0 1 1 0 8 0 amappl3 88 676 0 667 1 0 1 1 0 8 0 amappl2 80 5567 0 5490 3 1 2 3 0 8 0 amappl1 72 24323 0 23888 24 15 9 20 0 8 0 amappl 80 1961 0 1902 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 27 0 2 1 0 1 1 0 8 0 uaddrrnd 24 845 0 814 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 845 0 814 1 0 1 1 0 8 0 vmmpekpl 168 9541 0 9511 2 0 2 2 0 8 0 vmmpepl 168 109279 0 106864 158 21 137 148 0 357 27 vmsppl 272 828 0 814 2 1 1 2 0 8 0 pdppl 4096 1696 0 1645 8 1 7 7 0 8 0 pvpl 32 345761 0 321490 256 23 233 233 0 265 31 pmappl 200 844 0 816 2 0 2 2 0 8 0 extentpl 40 46 0 29 1 0 1 1 0 8 0 phpool 112 491 0 47 14 0 14 14 0 8 0