panic: amap_pp_adjref: negative reference count Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *169811 36833 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(fffffd80383d3468,7f0,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000aed800,0,200000,7f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000aed800,0,7,fffffd803f011000,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000aed800,0,7,fffffd803f011000,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff80001597f460,ffff8000ffff2ee8) at vm_impl_init_vmx+0xf1 sys/arch/amd64/amd64/vmm.c:1270 vm_create(ffff800000af2800,ffff8000ffff2ee8) at vm_create+0x193 vm_impl_init sys/arch/amd64/amd64/vmm.c:1385 [inline] vm_create(ffff800000af2800,ffff8000ffff2ee8) at vm_create+0x193 sys/arch/amd64/amd64/vmm.c:1174 VOP_IOCTL(fffffd80396bb8f0,c5005601,ffff800000af2800,1,fffffd803f7c6ae0,ffff8000ffff2ee8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd802d915178,c5005601,ffff800000af2800,ffff8000ffff2ee8) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff8000ffff2ee8,ffff800014924cd8,ffff800014924d20) at sys_ioctl+0x5b9 syscall(ffff800014924da0) at syscall+0x507 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x4e8ef9e2e40, 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(fffffd80383d3468,7f0,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000aed800,0,200000,7f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000aed800,0,7,fffffd803f011000,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000aed800,0,7,fffffd803f011000,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff80001597f460,ffff8000ffff2ee8) at vm_impl_init_vmx+0xf1 sys/arch/amd64/amd64/vmm.c:1270 vm_create(ffff800000af2800,ffff8000ffff2ee8) at vm_create+0x193 vm_impl_init sys/arch/amd64/amd64/vmm.c:1385 [inline] vm_create(ffff800000af2800,ffff8000ffff2ee8) at vm_create+0x193 sys/arch/amd64/amd64/vmm.c:1174 VOP_IOCTL(fffffd80396bb8f0,c5005601,ffff800000af2800,1,fffffd803f7c6ae0,ffff8000ffff2ee8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd802d915178,c5005601,ffff800000af2800,ffff8000ffff2ee8) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff8000ffff2ee8,ffff800014924cd8,ffff800014924d20) at sys_ioctl+0x5b9 syscall(ffff800014924da0) at syscall+0x507 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x4e8ef9e2e40, count: -12 ddb> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800014924630 rbx 0xffff8000149246e0 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800014b41000 rax 0xffff800000ae04c0 r8 0xffff8000149245f0 r9 0x1 r10 0xffff800000ae04c0 r11 0xc9a8a1092e0a1032 r12 0x3000000008 r13 0xffff800014924640 r14 0x100 r15 0x1 rip 0xffffffff81056c28 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800014924620 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (syz-executor.0) pid=169811 stat=onproc flags process=0 proc=4000000 pri=84, usrpri=84, nice=20 forw=0xffffffffffffffff, list=0xffff8000ffff3b40,0xffff8000ffff3170 process=0xffff8000ffff6370 user=0xffff80001491f000, vmspace=0xfffffd803f011000 estcpu=34, cpticks=2, pctcpu=20.28 user=0, sys=11246, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 36833 163342 71551 0 2 0 syz-executor.0 36833 352573 71551 0 3 0x4000080 lockf syz-executor.0 36833 255426 71551 0 3 0x4000080 lockf syz-executor.0 36833 65909 71551 0 3 0x4000080 lockf syz-executor.0 *36833 169811 71551 0 7 0x4000000 syz-executor.0 36833 387598 71551 0 3 0x4000080 fsleep syz-executor.0 71551 346226 55373 0 2 0x482 syz-executor.0 6737 107140 0 0 2 0x14600 acct 35665 294897 55373 0 2 0x2 syz-executor.1 69843 94312 0 0 3 0x14200 bored sosplice 55373 33077 23541 0 3 0x82 thrsleep syz-fuzzer 55373 241706 23541 0 2 0x4000002 syz-fuzzer 55373 409676 23541 0 2 0x4000002 syz-fuzzer 55373 32730 23541 0 3 0x4000082 thrsleep syz-fuzzer 55373 391813 23541 0 3 0x4000082 thrsleep syz-fuzzer 55373 295509 23541 0 3 0x4000082 kqread syz-fuzzer 55373 245454 23541 0 3 0x4000082 thrsleep syz-fuzzer 55373 402499 23541 0 3 0x4000082 thrsleep syz-fuzzer 55373 209362 23541 0 3 0x4000082 thrsleep syz-fuzzer 23541 512450 55462 0 3 0x10008a pause ksh 55462 328013 88288 0 3 0x92 select sshd 13717 331362 1 0 3 0x100083 ttyin getty 88288 398377 1 0 3 0x80 select sshd 62082 20032 48884 73 2 0x100490 syslogd 48884 153983 1 0 3 0x100082 netio syslogd 62549 181992 1 77 3 0x100090 poll dhclient 6375 72116 1 0 3 0x80 poll dhclient 55937 488064 0 0 2 0x14200 zerothread 71570 403820 0 0 3 0x14200 aiodoned aiodoned 69519 54971 0 0 2 0x14200 update 19088 426041 0 0 3 0x14200 cleaner cleaner 10439 305301 0 0 3 0x14200 reaper reaper 76333 383559 0 0 3 0x14200 pgdaemon pagedaemon 47015 1894 0 0 3 0x14200 bored crynlk 1033 45574 0 0 3 0x14200 bored crypto 63301 126453 0 0 3 0x40014200 acpi0 acpi0 32063 305098 0 0 2 0x14200 softnet 97872 510801 0 0 2 0x14200 systqmp 85663 221337 0 0 3 0x14200 bored systq 44025 199255 0 0 2 0x40014200 softclock 55313 299823 0 0 3 0x40014200 idle0 63345 455231 0 0 3 0x14200 bored smr 1 202654 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 9557 7015K 7790K 78643K 16789 0 0 pcb 13 11K 12K 78643K 919 0 0 rtable 96 4K 5K 78643K 1214 0 0 ifaddr 111 21K 21K 78643K 448 0 0 counters 19 16K 16K 78643K 19 0 0 ioctlops 1 2K 2K 78643K 193 0 0 iov 0 0K 96K 78643K 690 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1217 76K 77K 78643K 3909 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 53 0 0 VM map 20 5K 5K 78643K 21 0 0 sem 12 0K 1K 78643K 889 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1794 195K 288K 78643K 12646 0 0 file desc 5 13K 25K 78643K 1990 0 0 sigio 0 0K 0K 78643K 36 0 0 proc 50 38K 55K 78643K 822 0 0 subproc 32 2K 2K 78643K 136 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 272 0 0 in_multi 120 5K 6K 78643K 304 0 0 ether_multi 1 0K 0K 78643K 18 0 0 mrt 1 0K 0K 78643K 38 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 84 371K 371K 78643K 84 0 0 exec 0 0K 1K 78643K 486 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 160 166K 166K 78643K 7446 0 0 UVM aobj 130 6K 6K 78643K 169 0 0 memdesc 1 4K 4K 78643K 1 0 0 crypto data 1 1K 1K 78643K 1 0 0 ip6_options 0 0K 1K 78643K 561 0 0 NDP 19 0K 0K 78643K 103 0 0 temp 162 3539K 4179K 78643K 100142 0 0 kqueue 0 0K 0K 78643K 26 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 42 1 0 1 1 0 8 0 rtpcb 80 215 0 213 1 0 1 1 0 8 0 rtentry 112 232 0 197 2 0 2 2 0 8 0 unpcb 120 4056 0 4048 17 13 4 4 0 8 3 syncache 264 16 0 16 9 9 0 1 0 8 0 tcpqe 32 157 0 157 7 7 0 1 0 8 0 tcpcb 544 1388 0 1384 30 29 1 15 0 8 0 ipq 40 33 0 33 12 12 0 1 0 8 0 ipqe 40 1025 0 1025 12 12 0 1 0 8 0 inpcb 280 4056 0 4049 31 28 3 9 0 8 2 rttmr 72 10 0 10 6 6 0 1 0 8 0 nd6 48 28 0 26 1 0 1 1 0 8 0 pkpcb 40 22 0 22 3 3 0 1 0 8 0 ppxss 1128 34 0 34 14 14 0 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 1011 0 808 22 7 15 16 0 8 1 art_table 32 1012 0 808 3 0 3 3 0 8 0 art_node 16 231 0 198 1 0 1 1 0 8 0 sysvmsgpl 40 98 0 58 1 0 1 1 0 8 0 semupl 112 2 0 2 1 1 0 1 0 8 0 semapl 112 887 0 877 1 0 1 1 0 8 0 shmpl 112 167 0 39 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 5217 0 3822 46 0 46 46 0 8 0 ffsino 240 5217 0 3822 83 0 83 83 0 8 0 nchpl 144 8702 0 7090 61 0 61 61 0 8 0 uvmvnodes 72 5980 0 0 109 0 109 109 0 8 0 vnodes 208 5980 0 0 315 0 315 315 0 8 0 namei 1024 32908 0 32908 3 2 1 1 0 8 1 vcpupl 1984 17 0 0 3 0 3 3 0 8 0 vmpool 520 19 0 1 3 1 2 2 0 8 0 scsiplug 64 2 0 2 1 1 0 1 0 8 0 scxspl 192 29159 0 29159 25 24 1 7 0 8 1 plimitpl 152 179 0 172 1 0 1 1 0 8 0 sigapl 432 2142 0 2129 2 0 2 2 0 8 0 futexpl 56 99145 0 99144 3 2 1 1 0 8 0 knotepl 112 445 0 426 2 1 1 2 0 8 0 kqueuepl 104 837 0 835 7 6 1 4 0 8 0 pipepl 128 1750 0 1731 14 12 2 2 0 8 1 fdescpl 424 2143 0 2129 2 0 2 2 0 8 0 filepl 120 27839 0 27737 40 32 8 11 0 8 4 lockfpl 104 7749 0 7743 1 0 1 1 0 8 0 lockfspl 48 1825 0 1822 1 0 1 1 0 8 0 sessionpl 112 23 0 13 1 0 1 1 0 8 0 pgrppl 48 56 0 46 1 0 1 1 0 8 0 ucredpl 96 7570 0 7563 1 0 1 1 0 8 0 zombiepl 144 2130 0 2130 1 0 1 1 0 8 1 processpl 864 2160 0 2130 4 0 4 4 0 8 0 procpl 632 6365 0 6322 12 7 5 5 0 8 1 sosppl 128 42 0 42 12 12 0 1 0 8 0 sockpl 384 8392 0 8373 75 63 12 15 0 8 8 mcl64k 65536 535 0 535 36 35 1 29 0 8 1 mcl16k 16384 55 0 55 14 13 1 1 0 8 1 mcl12k 12288 96 0 96 15 14 1 1 0 8 1 mcl9k 9216 45 0 45 19 19 0 1 0 8 0 mcl8k 8192 143 0 143 11 10 1 1 0 8 1 mcl4k 4096 278 0 278 5 4 1 1 0 8 1 mcl2k2 2112 15 0 15 10 9 1 1 0 8 1 mcl2k 2048 76838 0 76789 24 17 7 18 0 8 0 mtagpl 80 110 0 105 2 1 1 1 0 8 0 mbufpl 256 147730 0 147614 124 111 13 31 0 8 0 bufpl 256 18160 0 11159 438 0 438 438 0 8 0 anonpl 16 283565 0 267195 215 125 90 104 0 62 0 amapchunkpl 152 14373 0 14211 49 41 8 21 0 158 0 amappl16 192 15262 0 14024 195 131 64 75 0 8 1 amappl15 184 8 0 7 1 0 1 1 0 8 0 amappl14 176 276 0 270 1 0 1 1 0 8 0 amappl13 168 154 0 153 1 0 1 1 0 8 0 amappl12 160 785 0 784 2 1 1 1 0 8 0 amappl11 152 70 0 58 1 0 1 1 0 8 0 amappl10 144 19 0 14 1 0 1 1 0 8 0 amappl9 136 679 0 676 1 0 1 1 0 8 0 amappl8 128 305 0 256 2 0 2 2 0 8 0 amappl7 120 66 0 57 1 0 1 1 0 8 0 amappl6 112 82 0 65 1 0 1 1 0 8 0 amappl5 104 1130 0 1120 1 0 1 1 0 8 0 amappl4 96 1648 0 1615 1 0 1 1 0 8 0 amappl3 88 1035 0 1029 1 0 1 1 0 8 0 amappl2 80 16188 0 16120 3 1 2 3 0 8 0 amappl1 72 52485 0 52055 26 16 10 20 0 8 0 amappl 80 6694 0 6637 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 168 0 39 3 0 3 3 0 8 0 uaddrrnd 24 2162 0 2129 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 2162 0 2129 1 0 1 1 0 8 0 vmmpekpl 168 21770 0 21741 2 0 2 2 0 8 0 vmmpepl 168 277943 0 275539 340 185 155 160 0 357 45 vmsppl 272 2142 0 2129 4 3 1 2 0 8 0 pdppl 4096 4330 0 4277 9 2 7 7 0 8 0 pvpl 32 743970 0 724624 423 205 218 237 0 265 14 pmappl 200 2161 0 2130 2 0 2 2 0 8 0 extentpl 40 46 0 29 1 0 1 1 0 8 0 phpool 112 809 0 235 19 1 18 18 0 8 0