panic: amap_pp_adjref: negative reference count Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *468731 21418 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(fffffd8039f17008,e4,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000b74400,0,200000,e4000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000b74400,0,7,fffffd803f011dd0,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000b74400,0,7,fffffd803f011dd0,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800016967458,ffff8000ffff33d8) at vm_impl_init_vmx+0xf1 sys/arch/amd64/amd64/vmm.c:1270 vm_create(ffff800000b6e800,ffff8000ffff33d8) at vm_create+0x193 vm_impl_init sys/arch/amd64/amd64/vmm.c:1385 [inline] vm_create(ffff800000b6e800,ffff8000ffff33d8) at vm_create+0x193 sys/arch/amd64/amd64/vmm.c:1174 VOP_IOCTL(fffffd80361f0750,c5005601,ffff800000b6e800,1,fffffd803f7c69c0,ffff8000ffff33d8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd802d374cb8,c5005601,ffff800000b6e800,ffff8000ffff33d8) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff8000ffff33d8,ffff8000159502c8,ffff800015950310) at sys_ioctl+0x5b9 syscall(ffff800015950390) at syscall+0x507 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc879a598a00, 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(fffffd8039f17008,e4,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000b74400,0,200000,e4000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000b74400,0,7,fffffd803f011dd0,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000b74400,0,7,fffffd803f011dd0,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800016967458,ffff8000ffff33d8) at vm_impl_init_vmx+0xf1 sys/arch/amd64/amd64/vmm.c:1270 vm_create(ffff800000b6e800,ffff8000ffff33d8) at vm_create+0x193 vm_impl_init sys/arch/amd64/amd64/vmm.c:1385 [inline] vm_create(ffff800000b6e800,ffff8000ffff33d8) at vm_create+0x193 sys/arch/amd64/amd64/vmm.c:1174 VOP_IOCTL(fffffd80361f0750,c5005601,ffff800000b6e800,1,fffffd803f7c69c0,ffff8000ffff33d8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd802d374cb8,c5005601,ffff800000b6e800,ffff8000ffff33d8) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff8000ffff33d8,ffff8000159502c8,ffff800015950310) at sys_ioctl+0x5b9 syscall(ffff800015950390) at syscall+0x507 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xc879a598a00, count: -12 ddb> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff80001594fc20 rbx 0xffff80001594fcd0 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff80001595b000 rax 0xffff800000b712c0 r8 0xffff80001594fbe0 r9 0x1 r10 0xffff800000b712c0 r11 0xb23f6d4575106ea3 r12 0x3000000008 r13 0xffff80001594fc30 r14 0x100 r15 0x1 rip 0xffffffff820e6c28 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff80001594fc10 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (syz-executor.1) pid=468731 stat=onproc flags process=0 proc=4000000 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff8000ffff3650,0xffffffff82586810 process=0xffff8000ffff66d0 user=0xffff80001594b000, vmspace=0xfffffd803f011dd0 estcpu=36, cpticks=55, pctcpu=20.28 user=0, sys=11340, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 21418 455626 96393 0 2 0 syz-executor.1 *21418 468731 96393 0 7 0x4000000 syz-executor.1 95841 407944 42726 0 2 0x2 syz-executor.0 96393 71694 42726 0 2 0x482 syz-executor.1 63282 523160 1 0 3 0x100083 ttyin getty 13933 274217 0 0 3 0x14200 bored sosplice 42726 127019 16594 0 3 0x82 thrsleep syz-fuzzer 42726 408726 16594 0 2 0x4000482 syz-fuzzer 42726 121068 16594 0 3 0x4000082 kqread syz-fuzzer 42726 40908 16594 0 3 0x4000082 thrsleep syz-fuzzer 42726 162735 16594 0 3 0x4000082 thrsleep syz-fuzzer 42726 435649 16594 0 2 0x4000482 syz-fuzzer 42726 437514 16594 0 3 0x4000082 thrsleep syz-fuzzer 42726 205833 16594 0 3 0x4000082 thrsleep syz-fuzzer 16594 239794 36161 0 3 0x10008a pause ksh 36161 202903 96360 0 3 0x92 select sshd 96360 277559 1 0 3 0x80 select sshd 4287 369375 87035 73 2 0x100490 syslogd 87035 29272 1 0 3 0x100082 netio syslogd 20972 445775 1 77 3 0x100090 poll dhclient 38911 426551 1 0 3 0x80 poll dhclient 71181 396754 0 0 2 0x14200 zerothread 59402 268400 0 0 3 0x14200 aiodoned aiodoned 62882 277872 0 0 2 0x14200 update 62805 93964 0 0 3 0x14200 cleaner cleaner 77074 151955 0 0 3 0x14200 reaper reaper 56096 457607 0 0 3 0x14200 pgdaemon pagedaemon 95030 471267 0 0 3 0x14200 bored crynlk 61053 481555 0 0 3 0x14200 bored crypto 66236 453238 0 0 3 0x40014200 acpi0 acpi0 11446 438240 0 0 2 0x14200 softnet 25261 353596 0 0 2 0x14200 systqmp 4792 42222 0 0 3 0x14200 bored systq 46390 356103 0 0 2 0x40014200 softclock 53025 176827 0 0 3 0x40014200 idle0 26780 239920 0 0 2 0x14200 smr 1 392307 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 9547 6489K 8129K 78643K 18116 0 0 pcb 13 8K 8K 78643K 268 0 0 rtable 123 5K 5K 78643K 1137 0 0 ifaddr 135 19K 20K 78643K 359 0 0 counters 19 16K 16K 78643K 19 0 0 ioctlops 1 2K 2K 78643K 90 0 0 iov 0 0K 16K 78643K 340 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1232 77K 78K 78643K 3287 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 22 0 0 VM map 18 4K 4K 78643K 21 0 0 sem 12 0K 0K 78643K 3085 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1794 195K 288K 78643K 12646 0 0 file desc 5 13K 25K 78643K 1887 0 0 sigio 0 0K 0K 78643K 28 0 0 proc 50 38K 63K 78643K 883 0 0 subproc 32 2K 2K 78643K 204 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 139 0 0 in_multi 64 3K 3K 78643K 242 0 0 ether_multi 1 0K 0K 78643K 12 0 0 mrt 1 0K 0K 78643K 12 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 72 318K 318K 78643K 72 0 0 exec 0 0K 1K 78643K 457 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 157 121K 121K 78643K 5544 0 0 UVM aobj 100 4K 4K 78643K 102 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 261 0 0 NDP 17 0K 1K 78643K 93 0 0 temp 154 3535K 4170K 78643K 39990 0 0 kqueue 0 0K 0K 78643K 6 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 47 0 39 1 0 1 1 0 8 0 rtpcb 80 139 0 137 1 0 1 1 0 8 0 rtentry 112 228 0 181 2 0 2 2 0 8 0 unpcb 120 940 0 931 1 0 1 1 0 8 0 syncache 264 12 0 12 6 5 1 1 0 8 1 tcpqe 32 215 0 215 3 3 0 1 0 8 0 tcpcb 544 781 0 777 2 1 1 2 0 8 0 ipq 40 19 0 17 7 6 1 1 0 8 0 ipqe 40 472 0 470 7 6 1 1 0 8 0 inpcb 280 2120 0 2113 5 3 2 3 0 8 1 rttmr 72 2 0 2 1 1 0 1 0 8 0 nd6 48 33 0 29 1 0 1 1 0 8 0 pkpcb 40 6 0 6 2 2 0 1 0 8 0 ppxss 1128 20 0 20 8 8 0 1 0 8 0 art_heap8 4096 2 0 0 2 0 2 2 0 8 0 art_heap4 256 972 0 740 20 5 15 16 0 8 0 art_table 32 974 0 740 3 1 2 3 0 8 0 art_node 16 226 0 183 1 0 1 1 0 8 0 sysvmsgpl 40 32 0 17 1 0 1 1 0 8 0 semupl 112 3 0 3 1 1 0 1 0 8 0 semapl 112 3083 0 3073 1 0 1 1 0 8 0 shmpl 112 100 0 2 3 0 3 3 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 3905 0 2506 46 0 46 46 0 8 0 ffsino 240 3905 0 2506 83 0 83 83 0 8 0 nchpl 144 7193 0 6743 60 39 21 60 0 8 0 uvmvnodes 72 5721 0 0 105 0 105 105 0 8 0 vnodes 208 5721 0 0 302 0 302 302 0 8 0 namei 1024 22668 0 22667 1 0 1 1 0 8 0 vcpupl 1984 15 0 0 2 0 2 2 0 8 0 vmpool 520 19 0 3 2 0 2 2 0 8 0 scsiplug 64 2 0 2 2 2 0 1 0 8 0 scxspl 192 20908 0 20908 15 14 1 7 0 8 1 plimitpl 152 121 0 114 1 0 1 1 0 8 0 sigapl 432 2028 0 2015 2 0 2 2 0 8 0 futexpl 56 62714 0 62714 1 0 1 1 0 8 1 knotepl 112 349 0 330 1 0 1 1 0 8 0 kqueuepl 104 392 0 389 1 0 1 1 0 8 0 pipepl 128 1050 0 1031 6 5 1 2 0 8 0 fdescpl 424 2029 0 2015 2 0 2 2 0 8 0 filepl 120 15274 0 15177 10 6 4 5 0 8 1 lockfpl 104 721 0 720 1 0 1 1 0 8 0 lockfspl 48 185 0 184 1 0 1 1 0 8 0 sessionpl 112 28 0 18 1 0 1 1 0 8 0 pgrppl 48 56 0 46 1 0 1 1 0 8 0 ucredpl 96 3078 0 3071 1 0 1 1 0 8 0 zombiepl 144 2016 0 2016 1 0 1 1 0 8 1 processpl 864 2045 0 2016 4 0 4 4 0 8 0 procpl 632 4306 0 4269 4 0 4 4 0 8 0 sosppl 128 24 0 24 7 7 0 1 0 8 0 sockpl 384 3224 0 3204 13 10 3 6 0 8 0 mcl64k 65536 214 0 214 7 6 1 4 0 8 1 mcl16k 16384 17 0 17 7 6 1 1 0 8 1 mcl12k 12288 47 0 47 4 4 0 1 0 8 0 mcl9k 9216 19 0 19 7 6 1 1 0 8 1 mcl8k 8192 93 0 93 1 1 0 1 0 8 0 mcl4k 4096 621 0 621 2 1 1 1 0 8 1 mcl2k2 2112 135 0 135 5 4 1 1 0 8 1 mcl2k 2048 73800 0 73756 16 10 6 12 0 8 0 mtagpl 80 63 0 63 5 5 0 1 0 8 0 mbufpl 256 134186 0 134098 65 49 16 20 0 8 6 bufpl 256 11552 0 6310 329 0 329 329 0 8 0 anonpl 16 248802 0 227008 143 42 101 102 0 62 6 amapchunkpl 152 10323 0 9849 33 13 20 20 0 158 1 amappl16 192 11638 0 10445 113 45 68 73 0 8 6 amappl15 184 209 0 209 2 1 1 1 0 8 1 amappl14 176 123 0 118 1 0 1 1 0 8 0 amappl13 168 566 0 566 1 1 0 1 0 8 0 amappl12 160 446 0 441 2 1 1 1 0 8 0 amappl11 152 96 0 81 1 0 1 1 0 8 0 amappl10 144 159 0 157 1 0 1 1 0 8 0 amappl9 136 1111 0 1108 1 0 1 1 0 8 0 amappl8 128 687 0 642 2 0 2 2 0 8 0 amappl7 120 220 0 213 1 0 1 1 0 8 0 amappl6 112 71 0 59 1 0 1 1 0 8 0 amappl5 104 662 0 652 1 0 1 1 0 8 0 amappl4 96 2745 0 2715 1 0 1 1 0 8 0 amappl3 88 265 0 258 1 0 1 1 0 8 0 amappl2 80 14935 0 14869 3 1 2 3 0 8 0 amappl1 72 48585 0 48173 26 16 10 20 0 8 0 amappl 80 4710 0 4653 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 101 0 2 2 0 2 2 0 8 0 uaddrrnd 24 2048 0 2015 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 2048 0 2015 1 0 1 1 0 8 0 vmmpekpl 168 16083 0 16053 2 0 2 2 0 8 0 vmmpepl 168 255712 0 253416 247 97 150 150 0 357 39 vmsppl 272 2028 0 2015 3 1 2 2 0 8 1 pdppl 4096 4102 0 4051 8 1 7 7 0 8 0 pvpl 32 622835 0 603075 286 70 216 234 0 265 18 pmappl 200 2047 0 2018 2 0 2 2 0 8 0 extentpl 40 46 0 29 1 0 1 1 0 8 0 phpool 112 551 0 83 14 0 14 14 0 8 0