panic: amap_pp_adjref: negative reference count Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *520444 52882 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(fffffd803b7820a8,e4,1df,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000ad7900,0,1df000,e4000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000ad7900,0,7,fffffd803f012110,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000ad7900,0,7,fffffd803f012110,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff80001487fc78,ffff8000ffff84f8) at vm_impl_init_vmx+0xf1 sys/arch/amd64/amd64/vmm.c:1270 vm_create(ffff800000ad2000,ffff8000ffff84f8) at vm_create+0x193 vm_impl_init sys/arch/amd64/amd64/vmm.c:1385 [inline] vm_create(ffff800000ad2000,ffff8000ffff84f8) at vm_create+0x193 sys/arch/amd64/amd64/vmm.c:1174 VOP_IOCTL(fffffd80360d44e0,c5005601,ffff800000ad2000,1,fffffd803f7c69c0,ffff8000ffff84f8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd802d4e9628,c5005601,ffff800000ad2000,ffff8000ffff84f8) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff8000ffff84f8,ffff80001533d3e8,ffff80001533d430) at sys_ioctl+0x5b9 syscall(ffff80001533d4b0) at syscall+0x507 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xe6827471240, 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(fffffd803b7820a8,e4,1df,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000ad7900,0,1df000,e4000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000ad7900,0,7,fffffd803f012110,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000ad7900,0,7,fffffd803f012110,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff80001487fc78,ffff8000ffff84f8) at vm_impl_init_vmx+0xf1 sys/arch/amd64/amd64/vmm.c:1270 vm_create(ffff800000ad2000,ffff8000ffff84f8) at vm_create+0x193 vm_impl_init sys/arch/amd64/amd64/vmm.c:1385 [inline] vm_create(ffff800000ad2000,ffff8000ffff84f8) at vm_create+0x193 sys/arch/amd64/amd64/vmm.c:1174 VOP_IOCTL(fffffd80360d44e0,c5005601,ffff800000ad2000,1,fffffd803f7c69c0,ffff8000ffff84f8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd802d4e9628,c5005601,ffff800000ad2000,ffff8000ffff84f8) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff8000ffff84f8,ffff80001533d3e8,ffff80001533d430) at sys_ioctl+0x5b9 syscall(ffff80001533d4b0) at syscall+0x507 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xe6827471240, count: -12 ddb> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff80001533cd40 rbx 0xffff80001533cdf0 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff80001632c000 rax 0xffff800000aa7240 r8 0xffff80001533cd00 r9 0x1 r10 0xffff800000aa7240 r11 0xd72a8ca61cb8c44e r12 0x3000000008 r13 0xffff80001533cd50 r14 0x100 r15 0x1 rip 0xffffffff81210978 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff80001533cd30 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (syz-executor.0) pid=520444 stat=onproc flags process=0 proc=4000000 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff8000ffff8008,0xffffffff8257d7e0 process=0xffff8000ffff7450 user=0xffff800015338000, vmspace=0xfffffd803f012110 estcpu=36, cpticks=13, pctcpu=20.28 user=0, sys=10862, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 52882 184988 29338 0 2 0 syz-executor.0 52882 213742 29338 0 2 0x4000000 syz-executor.0 *52882 520444 29338 0 7 0x4000000 syz-executor.0 77187 508080 84510 0 2 0 syz-executor.1 77187 437778 84510 0 3 0x4000080 kqread syz-executor.1 29338 291316 50068 0 2 0x482 syz-executor.0 84510 10797 50068 0 2 0x482 syz-executor.1 39973 162018 0 0 2 0x14600 acct 69900 90217 1 0 3 0x100083 ttyin getty 64471 275436 0 0 3 0x14200 bored sosplice 50068 56502 58276 0 3 0x82 thrsleep syz-fuzzer 50068 209655 58276 0 2 0x4000482 syz-fuzzer 50068 77341 58276 0 2 0x4000482 syz-fuzzer 50068 523602 58276 0 3 0x4000082 thrsleep syz-fuzzer 50068 227901 58276 0 3 0x4000082 thrsleep syz-fuzzer 50068 46121 58276 0 3 0x4000082 kqread syz-fuzzer 50068 262145 58276 0 3 0x4000082 thrsleep syz-fuzzer 50068 434915 58276 0 3 0x4000082 thrsleep syz-fuzzer 58276 343974 81492 0 3 0x10008a pause ksh 81492 448919 40527 0 3 0x92 select sshd 40527 385973 1 0 3 0x80 select sshd 25683 86452 61719 73 2 0x100490 syslogd 61719 106870 1 0 3 0x100082 netio syslogd 93991 77652 0 0 2 0x14200 zerothread 78512 189051 0 0 3 0x14200 aiodoned aiodoned 54037 300059 0 0 2 0x14200 update 74075 175023 0 0 3 0x14200 cleaner cleaner 70793 363863 0 0 3 0x14200 reaper reaper 54900 283021 0 0 3 0x14200 pgdaemon pagedaemon 76983 220536 0 0 3 0x14200 bored crynlk 40904 125551 0 0 3 0x14200 bored crypto 94778 116555 0 0 3 0x40014200 acpi0 acpi0 19792 224056 0 0 2 0x14200 softnet 81676 355097 0 0 2 0x14200 systqmp 73637 354761 0 0 3 0x14200 bored systq 15424 308235 0 0 2 0x40014200 softclock 10909 106769 0 0 3 0x40014200 idle0 68250 23425 0 0 3 0x14200 bored smr 1 166151 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 9549 6312K 8101K 78643K 18296 0 0 pcb 13 11K 12K 78643K 590 0 0 rtable 112 12K 12K 78643K 1208 0 0 ifaddr 188 23K 23K 78643K 582 0 0 counters 19 16K 16K 78643K 19 0 0 ioctlops 1 2K 2K 78643K 411 0 0 iov 0 0K 32K 78643K 711 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1227 77K 78K 78643K 4182 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 48 0 0 VM map 17 4K 4K 78643K 25 0 0 sem 12 0K 1K 78643K 678 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1794 195K 288K 78643K 12646 0 0 file desc 6 17K 25K 78643K 2657 0 0 sigio 0 0K 0K 78643K 66 0 0 proc 43 30K 63K 78643K 1210 0 0 subproc 32 2K 2K 78643K 306 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 268 0 0 in_multi 29 1K 2K 78643K 369 0 0 ether_multi 1 0K 0K 78643K 19 0 0 mrt 0 0K 0K 78643K 14 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 132 583K 583K 78643K 132 0 0 exec 0 0K 1K 78643K 1029 0 0 pfkey data 0 0K 0K 78643K 3 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 146 125K 125K 78643K 7864 0 0 UVM aobj 130 4K 4K 78643K 134 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 603 0 0 NDP 21 0K 0K 78643K 165 0 0 temp 158 3535K 3615K 78643K 95421 0 0 kqueue 0 0K 0K 78643K 25 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 66 0 60 1 0 1 1 0 8 0 rtpcb 80 347 0 347 3 2 1 1 0 8 1 rtentry 112 340 0 300 2 0 2 2 0 8 0 unpcb 120 7557 0 7549 12 11 1 3 0 8 0 syncache 264 17 0 17 6 6 0 1 0 8 0 tcpqe 32 168 0 168 5 5 0 1 0 8 0 tcpcb 544 1454 0 1449 31 30 1 15 0 8 0 ipq 40 69 0 69 13 12 1 1 0 8 1 ipqe 40 2253 0 2253 13 12 1 1 0 8 1 inpcb 280 4173 0 4168 27 26 1 9 0 8 0 rttmr 72 3 0 3 2 2 0 1 0 8 0 ip6q 72 1 0 1 1 1 0 1 0 8 0 ip6af 40 3 0 3 1 1 0 1 0 8 0 nd6 48 54 0 51 2 1 1 1 0 8 0 pkpcb 40 24 0 24 6 6 0 1 0 8 0 swfcl 56 5 0 0 1 0 1 1 0 8 0 ppxss 1128 47 0 47 13 12 1 1 0 8 1 art_heap8 4096 3 0 2 3 2 1 3 0 8 0 art_heap4 256 1569 0 1370 33 19 14 15 0 8 0 art_table 32 1572 0 1372 2 0 2 2 0 8 0 art_node 16 339 0 302 1 0 1 1 0 8 0 sysvmsgpl 40 77 0 45 1 0 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 112 676 0 666 1 0 1 1 0 8 0 shmpl 112 132 0 4 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 5697 0 4300 46 0 46 46 0 8 0 ffsino 240 5697 0 4300 83 0 83 83 0 8 0 nchpl 144 9928 0 9459 60 40 20 60 0 8 0 uvmvnodes 72 6345 0 0 116 0 116 116 0 8 0 vnodes 208 6345 0 0 334 0 334 334 0 8 0 namei 1024 35119 0 35119 2 1 1 1 0 8 1 vcpupl 1984 14 0 0 2 0 2 2 0 8 0 vmpool 520 23 0 8 2 1 1 1 0 8 0 scsiplug 64 1 0 1 1 1 0 1 0 8 0 scxspl 192 32126 0 32126 18 16 2 7 0 8 2 plimitpl 152 223 0 217 1 0 1 1 0 8 0 sigapl 432 2780 0 2768 2 0 2 2 0 8 0 futexpl 56 100027 0 100027 2 1 1 1 0 8 1 knotepl 112 1067 0 1048 4 3 1 3 0 8 0 kqueuepl 104 2547 0 2543 8 7 1 4 0 8 0 pipepl 128 1574 0 1555 9 8 1 2 0 8 0 fdescpl 424 2781 0 2768 2 0 2 2 0 8 0 filepl 120 31689 0 31601 33 28 5 11 0 8 2 lockfpl 104 1271 0 1271 2 1 1 1 0 8 1 lockfspl 48 503 0 503 2 1 1 1 0 8 1 sessionpl 112 34 0 26 1 0 1 1 0 8 0 pgrppl 48 72 0 64 1 0 1 1 0 8 0 ucredpl 96 4657 0 4651 1 0 1 1 0 8 0 zombiepl 144 2771 0 2771 1 0 1 1 0 8 1 processpl 864 2800 0 2771 4 0 4 4 0 8 0 procpl 632 6303 0 6264 6 2 4 5 0 8 0 sosppl 128 36 0 36 8 8 0 1 0 8 0 sockpl 384 12131 0 12118 53 48 5 14 0 8 2 mcl64k 65536 705 0 705 33 32 1 29 0 8 1 mcl16k 16384 75 0 75 10 9 1 1 0 8 1 mcl12k 12288 146 0 146 4 4 0 1 0 8 0 mcl9k 9216 49 0 49 11 11 0 1 0 8 0 mcl8k 8192 357 0 357 2 1 1 1 0 8 1 mcl4k 4096 416 0 416 3 2 1 1 0 8 1 mcl2k2 2112 21 0 21 8 8 0 1 0 8 0 mcl2k 2048 75953 0 75904 17 10 7 14 0 8 0 mtagpl 80 147 0 139 6 5 1 1 0 8 0 mbufpl 256 160467 0 160341 174 157 17 32 0 8 8 bufpl 256 16273 0 9925 397 0 397 397 0 8 0 anonpl 16 366141 0 345719 174 80 94 103 0 62 5 amapchunkpl 152 15473 0 15226 51 41 10 32 0 158 0 amappl16 192 15959 0 14534 139 67 72 75 0 8 0 amappl15 184 560 0 560 2 1 1 1 0 8 1 amappl14 176 542 0 536 1 0 1 1 0 8 0 amappl13 168 601 0 601 2 2 0 1 0 8 0 amappl12 160 387 0 385 2 1 1 1 0 8 0 amappl11 152 216 0 212 1 0 1 1 0 8 0 amappl10 144 526 0 522 1 0 1 1 0 8 0 amappl9 136 793 0 789 1 0 1 1 0 8 0 amappl8 128 370 0 323 2 0 2 2 0 8 0 amappl7 120 612 0 605 1 0 1 1 0 8 0 amappl6 112 181 0 167 1 0 1 1 0 8 0 amappl5 104 774 0 768 1 0 1 1 0 8 0 amappl4 96 3109 0 3082 1 0 1 1 0 8 0 amappl3 88 539 0 531 1 0 1 1 0 8 0 amappl2 80 21446 0 21375 3 1 2 3 0 8 0 amappl1 72 62287 0 61886 26 16 10 20 0 8 0 amappl 80 6818 0 6765 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 133 0 4 3 0 3 3 0 8 0 uaddrrnd 24 2804 0 2768 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 2804 0 2768 1 0 1 1 0 8 0 vmmpekpl 168 22083 0 22051 2 0 2 2 0 8 0 vmmpepl 168 349262 0 346651 343 191 152 156 0 357 38 vmsppl 272 2780 0 2768 4 3 1 2 0 8 0 pdppl 4096 5614 0 5566 8 2 6 6 0 8 0 pvpl 32 979256 0 956139 377 163 214 270 0 265 12 pmappl 200 2803 0 2776 3 1 2 2 0 8 0 extentpl 40 46 0 29 1 0 1 1 0 8 0 phpool 112 805 0 270 16 0 16 16 0 8 0