panic: amap_pp_adjref: negative reference count Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *412222 93557 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(fffffd802d047008,7f0,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000a47b00,0,200000,7f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000a47b00,0,7,fffffd803f011220,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000a47b00,0,7,fffffd803f011220,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800015976820,ffff8000ffff98b8) at vm_impl_init_vmx+0xf1 sys/arch/amd64/amd64/vmm.c:1270 vm_create(ffff800000ad8800,ffff8000ffff98b8) at vm_create+0x193 vm_impl_init sys/arch/amd64/amd64/vmm.c:1385 [inline] vm_create(ffff800000ad8800,ffff8000ffff98b8) at vm_create+0x193 sys/arch/amd64/amd64/vmm.c:1174 VOP_IOCTL(fffffd80394b9820,c5005601,ffff800000ad8800,1,fffffd803f7c6b40,ffff8000ffff98b8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd802d15cda8,c5005601,ffff800000ad8800,ffff8000ffff98b8) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff8000ffff98b8,ffff800017983ca8,ffff800017983cf0) at sys_ioctl+0x5b9 syscall(ffff800017983d70) at syscall+0x507 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa566ca5f9a0, 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(fffffd802d047008,7f0,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000a47b00,0,200000,7f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000a47b00,0,7,fffffd803f011220,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000a47b00,0,7,fffffd803f011220,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800015976820,ffff8000ffff98b8) at vm_impl_init_vmx+0xf1 sys/arch/amd64/amd64/vmm.c:1270 vm_create(ffff800000ad8800,ffff8000ffff98b8) at vm_create+0x193 vm_impl_init sys/arch/amd64/amd64/vmm.c:1385 [inline] vm_create(ffff800000ad8800,ffff8000ffff98b8) at vm_create+0x193 sys/arch/amd64/amd64/vmm.c:1174 VOP_IOCTL(fffffd80394b9820,c5005601,ffff800000ad8800,1,fffffd803f7c6b40,ffff8000ffff98b8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd802d15cda8,c5005601,ffff800000ad8800,ffff8000ffff98b8) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff8000ffff98b8,ffff800017983ca8,ffff800017983cf0) at sys_ioctl+0x5b9 syscall(ffff800017983d70) at syscall+0x507 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa566ca5f9a0, count: -12 ddb> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800017983600 rbx 0xffff8000179836b0 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800016b78000 rax 0xffff800000aa3b40 r8 0xffff8000179835c0 r9 0x1 r10 0xffff800000aa3b40 r11 0xc9fff3058332596e r12 0x3000000008 r13 0xffff800017983610 r14 0x100 r15 0x1 rip 0xffffffff820e6c28 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000179835f0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (syz-executor.0) pid=412222 stat=onproc flags process=0 proc=4000000 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff8000ffff8770,0xffffffff82586810 process=0xffff8000ffff70f0 user=0xffff80001797e000, vmspace=0xfffffd803f011220 estcpu=36, cpticks=53, pctcpu=20.28 user=0, sys=11592, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 93557 379536 91244 0 2 0 syz-executor.0 *93557 412222 91244 0 7 0x4000000 syz-executor.0 17301 200572 47479 0 2 0x2 syz-executor.1 91244 166330 47479 0 2 0x482 syz-executor.0 31271 313539 0 0 2 0x14600 acct 71531 357620 0 0 3 0x14200 bored sosplice 47479 419616 18575 0 3 0x82 thrsleep syz-fuzzer 47479 166942 18575 0 2 0x4000482 syz-fuzzer 47479 176449 18575 0 3 0x4000082 thrsleep syz-fuzzer 47479 157537 18575 0 3 0x4000082 thrsleep syz-fuzzer 47479 448244 18575 0 3 0x4000082 thrsleep syz-fuzzer 47479 179046 18575 0 2 0x4000482 syz-fuzzer 47479 510478 18575 0 3 0x4000082 thrsleep syz-fuzzer 47479 253649 18575 0 3 0x4000082 kqread syz-fuzzer 18575 428656 87718 0 3 0x10008a pause ksh 87718 455321 78944 0 3 0x92 select sshd 37169 488267 1 0 3 0x100083 ttyin getty 78944 381498 1 0 3 0x80 select sshd 73195 195356 63926 73 2 0x100490 syslogd 63926 64523 1 0 3 0x100082 netio syslogd 71159 180553 0 0 2 0x14200 zerothread 16173 23619 0 0 3 0x14200 aiodoned aiodoned 59512 25987 0 0 2 0x14200 update 72582 209303 0 0 3 0x14200 cleaner cleaner 60539 50698 0 0 3 0x14200 reaper reaper 86826 86454 0 0 3 0x14200 pgdaemon pagedaemon 72879 62612 0 0 3 0x14200 bored crynlk 53688 267366 0 0 3 0x14200 bored crypto 54919 299566 0 0 3 0x40014200 acpi0 acpi0 89603 200901 0 0 2 0x14200 softnet 63443 21425 0 0 2 0x14200 systqmp 27259 310944 0 0 2 0x14200 systq 24411 328511 0 0 2 0x40014200 softclock 72141 416556 0 0 3 0x40014200 idle0 64890 388330 0 0 2 0x14200 smr 1 129757 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 9538 6430K 6945K 78643K 14436 0 0 pcb 13 10K 12K 78643K 395 0 0 rtable 88 11K 12K 78643K 933 0 0 ifaddr 121 16K 18K 78643K 344 0 0 counters 19 16K 16K 78643K 19 0 0 ioctlops 1 2K 2K 78643K 119 0 0 iov 0 0K 32K 78643K 356 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1227 77K 77K 78643K 2792 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 18 0 0 VM map 12 3K 3K 78643K 14 0 0 sem 12 0K 0K 78643K 578 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1794 195K 288K 78643K 12646 0 0 file desc 5 13K 25K 78643K 1425 0 0 sigio 0 0K 0K 78643K 18 0 0 proc 44 30K 55K 78643K 844 0 0 subproc 32 2K 2K 78643K 187 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 459 0 0 in_multi 26 1K 2K 78643K 228 0 0 ether_multi 1 0K 0K 78643K 9 0 0 mrt 0 0K 0K 78643K 4 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 66 291K 291K 78643K 66 0 0 exec 0 0K 1K 78643K 455 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 137 124K 124K 78643K 5145 0 0 UVM aobj 101 3K 3K 78643K 112 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 323 0 0 NDP 16 0K 0K 78643K 87 0 0 temp 151 3535K 3608K 78643K 28679 0 0 kqueue 0 0K 0K 78643K 16 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 33 0 31 1 0 1 1 0 8 0 rtpcb 80 205 0 205 4 3 1 1 0 8 1 rtentry 112 211 0 183 2 0 2 2 0 8 0 unpcb 120 1662 0 1654 8 7 1 2 0 8 0 syncache 264 12 0 12 5 4 1 1 0 8 1 tcpqe 32 84 0 84 2 2 0 1 0 8 0 tcpcb 544 804 0 800 16 15 1 15 0 8 0 ipq 40 41 0 40 13 12 1 1 0 8 0 ipqe 40 1045 0 1044 13 12 1 1 0 8 0 inpcb 280 2354 0 2350 22 21 1 9 0 8 0 rttmr 72 1 0 1 1 1 0 1 0 8 0 nd6 48 30 0 29 6 5 1 1 0 8 0 pkpcb 40 14 0 14 4 4 0 1 0 8 0 ppxss 1128 19 0 19 12 12 0 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 946 0 782 27 16 11 15 0 8 0 art_table 32 947 0 782 2 0 2 2 0 8 0 art_node 16 210 0 184 1 0 1 1 0 8 0 sysvmsgpl 40 174 0 147 1 0 1 1 0 8 0 semupl 112 2 0 2 1 1 0 1 0 8 0 semapl 112 574 0 564 1 0 1 1 0 8 0 shmpl 112 110 0 11 4 1 3 3 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 3896 0 2497 46 0 46 46 0 8 0 ffsino 240 3896 0 2497 83 0 83 83 0 8 0 nchpl 144 6404 0 5940 60 40 20 60 0 8 0 uvmvnodes 72 5157 0 0 94 0 94 94 0 8 0 vnodes 208 5157 0 0 272 0 272 272 0 8 0 namei 1024 21618 0 21618 3 2 1 1 0 8 1 vcpupl 1984 9 0 0 2 0 2 2 0 8 0 vmpool 520 12 0 2 1 0 1 1 0 8 0 scsiplug 64 2 0 2 2 2 0 1 0 8 0 scxspl 192 19309 0 19309 19 17 2 7 0 8 2 plimitpl 152 145 0 139 1 0 1 1 0 8 0 sigapl 432 1568 0 1557 2 0 2 2 0 8 0 futexpl 56 49788 0 49788 2 1 1 1 0 8 1 knotepl 112 526 0 507 1 0 1 1 0 8 0 kqueuepl 104 1124 0 1121 4 3 1 4 0 8 0 pipepl 128 1910 0 1889 13 11 2 3 0 8 1 fdescpl 424 1569 0 1557 2 0 2 2 0 8 0 filepl 120 16820 0 16732 31 27 4 11 0 8 1 lockfpl 104 537 0 537 2 1 1 1 0 8 1 lockfspl 48 176 0 176 2 1 1 1 0 8 1 sessionpl 112 26 0 18 1 0 1 1 0 8 0 pgrppl 48 480 0 472 1 0 1 1 0 8 0 ucredpl 96 1740 0 1734 1 0 1 1 0 8 0 zombiepl 144 1557 0 1557 2 1 1 1 0 8 1 processpl 864 1585 0 1557 4 0 4 4 0 8 0 procpl 632 3422 0 3386 5 1 4 5 0 8 0 sosppl 128 25 0 25 7 7 0 1 0 8 0 sockpl 384 4247 0 4235 40 36 4 14 0 8 1 mcl64k 65536 412 0 412 39 38 1 32 0 8 1 mcl16k 16384 31 0 31 13 12 1 1 0 8 1 mcl12k 12288 38 0 38 16 15 1 1 0 8 1 mcl9k 9216 26 0 26 14 14 0 1 0 8 0 mcl8k 8192 93 0 93 8 7 1 1 0 8 1 mcl4k 4096 169 0 169 3 2 1 1 0 8 1 mcl2k2 2112 14 0 14 9 9 0 1 0 8 0 mcl2k 2048 74285 0 74232 16 9 7 13 0 8 0 mtagpl 80 60 0 60 8 8 0 1 0 8 0 mbufpl 256 133242 0 133146 126 115 11 25 0 8 1 bufpl 256 12295 0 5930 398 0 398 398 0 8 0 anonpl 16 682625 0 661234 180 77 103 121 0 62 4 amapchunkpl 152 10936 0 10787 42 34 8 17 0 158 0 amappl16 192 36505 0 35290 311 237 74 85 0 8 13 amappl15 184 324 0 324 1 1 0 1 0 8 0 amappl14 176 427 0 418 1 0 1 1 0 8 0 amappl13 168 162 0 161 1 0 1 1 0 8 0 amappl12 160 48 0 47 3 2 1 1 0 8 0 amappl11 152 74 0 70 1 0 1 1 0 8 0 amappl10 144 333 0 329 2 1 1 1 0 8 0 amappl9 136 669 0 663 1 0 1 1 0 8 0 amappl8 128 268 0 225 3 1 2 2 0 8 0 amappl7 120 398 0 390 1 0 1 1 0 8 0 amappl6 112 71 0 61 1 0 1 1 0 8 0 amappl5 104 309 0 301 1 0 1 1 0 8 0 amappl4 96 1968 0 1947 1 0 1 1 0 8 0 amappl3 88 171 0 166 1 0 1 1 0 8 0 amappl2 80 11445 0 11381 3 1 2 3 0 8 0 amappl1 72 39495 0 39116 27 18 9 20 0 8 0 amappl 80 3926 0 3876 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 111 0 11 2 0 2 2 0 8 0 uaddrrnd 24 1581 0 1557 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 1581 0 1557 1 0 1 1 0 8 0 vmmpekpl 168 15931 0 15906 2 0 2 2 0 8 0 vmmpepl 168 229847 0 227611 248 135 113 149 0 357 6 vmsppl 272 1568 0 1557 2 1 1 2 0 8 0 pdppl 4096 3168 0 3127 7 1 6 6 0 8 0 pvpl 32 1150340 0 1125874 421 157 264 314 0 265 45 pmappl 200 1580 0 1559 3 1 2 2 0 8 0 extentpl 40 46 0 29 1 0 1 1 0 8 0 phpool 112 747 0 220 16 0 16 16 0 8 0