panic: amap_pp_adjref: negative reference count Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *303148 20399 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(fffffd80375a3eb0,7f0,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000b29b00,0,200000,7f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000b29b00,0,7,fffffd803f013220,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000b29b00,0,7,fffffd803f013220,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff80001494d670,ffff8000ffff2780) at vm_impl_init_vmx+0xf1 sys/arch/amd64/amd64/vmm.c:1270 vm_create(ffff800000a8e000,ffff8000ffff2780) at vm_create+0x193 vm_impl_init sys/arch/amd64/amd64/vmm.c:1385 [inline] vm_create(ffff800000a8e000,ffff8000ffff2780) at vm_create+0x193 sys/arch/amd64/amd64/vmm.c:1174 VOP_IOCTL(fffffd80361af680,c5005601,ffff800000a8e000,1,fffffd803f7c6900,ffff8000ffff2780) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd8037563618,c5005601,ffff800000a8e000,ffff8000ffff2780) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff8000ffff2780,ffff800014884318,ffff800014884360) at sys_ioctl+0x5b9 syscall(ffff8000148843e0) at syscall+0x507 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa19baa9e440, 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(fffffd80375a3eb0,7f0,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000b29b00,0,200000,7f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000b29b00,0,7,fffffd803f013220,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000b29b00,0,7,fffffd803f013220,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff80001494d670,ffff8000ffff2780) at vm_impl_init_vmx+0xf1 sys/arch/amd64/amd64/vmm.c:1270 vm_create(ffff800000a8e000,ffff8000ffff2780) at vm_create+0x193 vm_impl_init sys/arch/amd64/amd64/vmm.c:1385 [inline] vm_create(ffff800000a8e000,ffff8000ffff2780) at vm_create+0x193 sys/arch/amd64/amd64/vmm.c:1174 VOP_IOCTL(fffffd80361af680,c5005601,ffff800000a8e000,1,fffffd803f7c6900,ffff8000ffff2780) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd8037563618,c5005601,ffff800000a8e000,ffff8000ffff2780) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff8000ffff2780,ffff800014884318,ffff800014884360) at sys_ioctl+0x5b9 syscall(ffff8000148843e0) at syscall+0x507 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa19baa9e440, count: -12 ddb> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800014883c70 rbx 0xffff800014883d20 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800015967000 rax 0xffff800000b48600 r8 0xffff800014883c30 r9 0x1 r10 0xffff800000b48600 r11 0x662c3cae4abcf457 r12 0x3000000008 r13 0xffff800014883c80 r14 0x100 r15 0x1 rip 0xffffffff81a4ef68 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800014883c60 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (syz-executor.0) pid=303148 stat=onproc flags process=0 proc=4000000 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff8000ffff3650,0xffffffff825ab8a8 process=0xffff8000ffff6370 user=0xffff80001487f000, vmspace=0xfffffd803f013220 estcpu=36, cpticks=49, pctcpu=20.28 user=0, sys=11198, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 20399 74762 77368 0 2 0 syz-executor.0 *20399 303148 77368 0 7 0x4000000 syz-executor.0 77368 156777 6847 0 2 0x482 syz-executor.0 13370 458297 6847 0 2 0x482 syz-executor.1 15820 468256 0 0 2 0x14600 acct 9308 161948 0 0 3 0x14200 bored sosplice 6847 312188 98018 0 3 0x82 thrsleep syz-fuzzer 6847 444172 98018 0 2 0x4000482 syz-fuzzer 6847 307072 98018 0 3 0x4000082 thrsleep syz-fuzzer 6847 30739 98018 0 3 0x4000082 thrsleep syz-fuzzer 6847 40625 98018 0 3 0x4000082 thrsleep syz-fuzzer 6847 199614 98018 0 3 0x4000082 kqread syz-fuzzer 6847 472518 98018 0 3 0x4000082 thrsleep syz-fuzzer 6847 512408 98018 0 2 0x4000482 syz-fuzzer 98018 317931 37468 0 3 0x10008a pause ksh 37468 164003 78474 0 3 0x92 select sshd 7052 389327 1 0 3 0x100083 ttyin getty 78474 322051 1 0 3 0x80 select sshd 89140 275384 48328 73 2 0x100490 syslogd 48328 452437 1 0 3 0x100082 netio syslogd 7475 488826 0 0 2 0x14200 zerothread 22739 3670 0 0 3 0x14200 aiodoned aiodoned 63021 229737 0 0 2 0x14200 update 50672 135416 0 0 3 0x14200 cleaner cleaner 61723 341819 0 0 3 0x14200 reaper reaper 3129 235470 0 0 3 0x14200 pgdaemon pagedaemon 95534 255388 0 0 3 0x14200 bored crynlk 82887 426469 0 0 3 0x14200 bored crypto 84093 152207 0 0 3 0x40014200 acpi0 acpi0 10568 522673 0 0 2 0x14200 softnet 49557 30174 0 0 2 0x14200 systqmp 41017 402748 0 0 2 0x14200 systq 20345 159181 0 0 2 0x40014200 softclock 55216 362678 0 0 3 0x40014200 idle0 43961 270284 0 0 3 0x14200 bored smr 1 124934 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 9548 6952K 7649K 78643K 22957 0 0 pcb 13 11K 12K 78643K 1031 0 0 rtable 122 12K 13K 78643K 1758 0 0 ifaddr 249 30K 30K 78643K 892 0 0 counters 19 16K 16K 78643K 19 0 0 ioctlops 1 2K 2K 78643K 344 0 0 iov 0 0K 32K 78643K 1093 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1223 77K 77K 78643K 6156 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 76 0 0 VM map 50 12K 12K 78643K 77 0 0 sem 12 0K 1K 78643K 2506 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1793 195K 288K 78643K 12645 0 0 file desc 5 13K 25K 78643K 4576 0 0 sigio 0 0K 0K 78643K 347 0 0 proc 44 30K 54K 78643K 1649 0 0 subproc 32 2K 2K 78643K 446 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 465 0 0 in_multi 72 4K 4K 78643K 578 0 0 ether_multi 1 0K 0K 78643K 33 0 0 mrt 0 0K 0K 78643K 25 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 120 530K 530K 78643K 120 0 0 exec 0 0K 1K 78643K 954 0 0 pfkey data 0 0K 0K 78643K 2 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 194 396K 396K 78643K 12304 0 0 UVM aobj 130 9K 9K 78643K 136 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 1635 0 0 NDP 20 0K 0K 78643K 238 0 0 temp 166 3535K 4175K 78643K 132884 0 0 kqueue 0 0K 0K 78643K 68 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 97 0 91 1 0 1 1 0 8 0 rtpcb 80 534 0 534 9 8 1 1 0 8 1 rtentry 112 515 0 472 2 0 2 2 0 8 0 unpcb 120 7821 0 7806 2 1 1 2 0 8 0 syncache 264 22 0 22 8 8 0 1 0 8 0 sackhl 24 1 0 1 1 1 0 1 0 8 0 tcpqe 32 122 0 122 5 5 0 1 0 8 0 tcpcb 544 4245 0 4241 38 37 1 14 0 8 0 ipq 40 129 0 127 16 15 1 1 0 8 0 ipqe 40 3944 0 3942 16 15 1 1 0 8 0 inpcb 280 13306 0 13302 45 43 2 9 0 8 1 rttmr 72 11 0 10 7 6 1 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 77 0 73 3 2 1 1 0 8 0 pkpcb 40 43 0 43 11 11 0 1 0 8 0 ppxss 1128 66 0 66 21 20 1 1 0 8 1 art_heap8 4096 9 0 8 7 6 1 3 0 8 0 art_heap4 256 2477 0 2236 43 27 16 17 0 8 0 art_table 32 2486 0 2244 4 1 3 3 0 8 0 art_node 16 514 0 475 1 0 1 1 0 8 0 sysvmsgpl 40 54 0 46 1 0 1 1 0 8 0 semupl 112 4 0 4 1 1 0 1 0 8 0 semapl 112 2504 0 2494 1 0 1 1 0 8 0 shmpl 112 134 0 6 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 8226 0 6816 46 0 46 46 0 8 0 ffsino 240 8226 0 6816 84 0 84 84 0 8 0 nchpl 144 14758 0 14276 60 39 21 60 0 8 0 uvmvnodes 72 6683 0 0 122 0 122 122 0 8 0 vnodes 208 6683 0 0 352 0 352 352 0 8 0 namei 1024 51396 0 51396 4 3 1 1 0 8 1 vcpupl 1984 48 0 1 6 0 6 6 0 8 0 vmpool 520 75 0 27 4 0 4 4 0 8 0 scsiplug 64 5 0 5 4 4 0 1 0 8 0 scxspl 192 54670 0 54670 31 29 2 6 0 8 2 plimitpl 152 330 0 324 1 0 1 1 0 8 0 sigapl 432 4674 0 4663 2 0 2 2 0 8 0 futexpl 56 149962 0 149962 3 2 1 1 0 8 1 knotepl 112 1146 0 1127 9 8 1 3 0 8 0 kqueuepl 104 2153 0 2150 7 6 1 4 0 8 0 pipepl 128 4900 0 4881 16 14 2 3 0 8 0 fdescpl 424 4675 0 4663 2 0 2 2 0 8 0 filepl 120 51826 0 51739 42 37 5 11 0 8 2 lockfpl 104 1705 0 1705 6 5 1 1 0 8 1 lockfspl 48 546 0 546 6 5 1 1 0 8 1 sessionpl 112 41 0 33 1 0 1 1 0 8 0 pgrppl 48 129 0 121 1 0 1 1 0 8 0 ucredpl 96 4958 0 4952 1 0 1 1 0 8 0 zombiepl 144 4663 0 4662 2 1 1 1 0 8 0 processpl 864 4691 0 4662 4 0 4 4 0 8 0 procpl 632 10225 0 10188 4 0 4 4 0 8 0 sosppl 128 78 0 78 18 17 1 1 0 8 1 sockpl 384 21872 0 21853 61 56 5 14 0 8 2 mcl64k 65536 1414 0 1414 108 107 1 33 0 8 1 mcl16k 16384 57 0 57 19 18 1 1 0 8 1 mcl12k 12288 694 0 694 14 13 1 1 0 8 1 mcl9k 9216 93 0 93 14 13 1 1 0 8 1 mcl8k 8192 224 0 224 5 4 1 1 0 8 1 mcl4k 4096 466 0 466 5 4 1 1 0 8 1 mcl2k2 2112 33 0 33 18 17 1 1 0 8 1 mcl2k 2048 81572 0 81522 17 10 7 15 0 8 0 mtagpl 80 204 0 192 9 8 1 1 0 8 0 mbufpl 256 191234 0 191116 300 283 17 38 0 8 8 bufpl 256 23965 0 17238 421 0 421 421 0 8 0 anonpl 16 633796 0 613065 256 149 107 117 0 62 10 amapchunkpl 152 26125 0 25957 97 88 9 21 0 158 0 amappl16 192 30188 0 28852 258 187 71 84 0 8 2 amappl15 184 1377 0 1375 3 2 1 1 0 8 0 amappl14 176 1221 0 1213 1 0 1 1 0 8 0 amappl13 168 121 0 120 1 0 1 1 0 8 0 amappl12 160 477 0 477 6 6 0 1 0 8 0 amappl11 152 906 0 900 1 0 1 1 0 8 0 amappl10 144 549 0 548 1 0 1 1 0 8 0 amappl9 136 1088 0 1085 1 0 1 1 0 8 0 amappl8 128 712 0 659 2 0 2 2 0 8 0 amappl7 120 670 0 664 1 0 1 1 0 8 0 amappl6 112 849 0 834 1 0 1 1 0 8 0 amappl5 104 845 0 837 1 0 1 1 0 8 0 amappl4 96 4587 0 4559 1 0 1 1 0 8 0 amappl3 88 2110 0 2105 1 0 1 1 0 8 0 amappl2 80 36118 0 36051 3 1 2 3 0 8 0 amappl1 72 95912 0 95532 26 18 8 20 0 8 0 amappl 80 10957 0 10889 4 2 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 17 0 17 1 1 0 1 0 8 0 aobjpl 64 135 0 6 3 0 3 3 0 8 0 uaddrrnd 24 4750 0 4663 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 4750 0 4663 1 0 1 1 0 8 0 vmmpekpl 168 35913 0 35879 2 0 2 2 0 8 0 vmmpepl 168 578176 0 575623 417 257 160 180 0 357 38 vmsppl 272 4674 0 4663 2 1 1 2 0 8 0 pdppl 4096 9506 0 9427 13 3 10 10 0 8 0 pvpl 32 1561198 0 1539955 475 230 245 302 0 265 44 pmappl 200 4749 0 4690 6 2 4 4 0 8 0 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 1071 0 505 18 1 17 17 0 8 0