panic: amap_pp_adjref: negative reference count Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *192769 95381 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(fffffd8029ab2c88,7f0,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000a76600,0,200000,7f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000a76600,0,7,fffffd803f011dd0,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000a76600,0,7,fffffd803f011dd0,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800015961c70,ffff8000ffff33d8) at vm_impl_init_vmx+0xf1 sys/arch/amd64/amd64/vmm.c:1270 vm_create(ffff800000a8d800,ffff8000ffff33d8) at vm_create+0x193 vm_impl_init sys/arch/amd64/amd64/vmm.c:1385 [inline] vm_create(ffff800000a8d800,ffff8000ffff33d8) at vm_create+0x193 sys/arch/amd64/amd64/vmm.c:1174 VOP_IOCTL(fffffd8036153680,c5005601,ffff800000a8d800,1,fffffd803f7c6ba0,ffff8000ffff33d8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd802d4e7f10,c5005601,ffff800000a8d800,ffff8000ffff33d8) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff8000ffff33d8,ffff800015958b38,ffff800015958b80) at sys_ioctl+0x5b9 syscall(ffff800015958c00) at syscall+0x507 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x31ae8de9410, 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(fffffd8029ab2c88,7f0,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000a76600,0,200000,7f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000a76600,0,7,fffffd803f011dd0,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000a76600,0,7,fffffd803f011dd0,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800015961c70,ffff8000ffff33d8) at vm_impl_init_vmx+0xf1 sys/arch/amd64/amd64/vmm.c:1270 vm_create(ffff800000a8d800,ffff8000ffff33d8) at vm_create+0x193 vm_impl_init sys/arch/amd64/amd64/vmm.c:1385 [inline] vm_create(ffff800000a8d800,ffff8000ffff33d8) at vm_create+0x193 sys/arch/amd64/amd64/vmm.c:1174 VOP_IOCTL(fffffd8036153680,c5005601,ffff800000a8d800,1,fffffd803f7c6ba0,ffff8000ffff33d8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd802d4e7f10,c5005601,ffff800000a8d800,ffff8000ffff33d8) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff8000ffff33d8,ffff800015958b38,ffff800015958b80) at sys_ioctl+0x5b9 syscall(ffff800015958c00) at syscall+0x507 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x31ae8de9410, count: -12 ddb> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff800015958490 rbx 0xffff800015958540 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800014947000 rax 0xffff800000a67e80 r8 0xffff800015958450 r9 0x1 r10 0xffff800000a67e80 r11 0xc7227465f47de89d r12 0x3000000008 r13 0xffff8000159584a0 r14 0x100 r15 0x1 rip 0xffffffff81cb09e8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800015958480 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (syz-executor.1) pid=192769 stat=onproc flags process=0 proc=4000000 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff8000ffff2780,0xffffffff8256dc98 process=0xffff8000ffff6370 user=0xffff800015953000, vmspace=0xfffffd803f011dd0 estcpu=36, cpticks=92, pctcpu=20.28 user=0, sys=11327, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 95381 128449 77830 0 2 0 syz-executor.1 *95381 192769 77830 0 7 0x4000000 syz-executor.1 83958 394816 24598 0 2 0 syz-executor.0 83958 289244 24598 0 3 0x4000080 fsleep syz-executor.0 85479 288451 0 0 3 0x14200 bored sosplice 24598 462984 89204 0 2 0x482 syz-executor.0 77830 213216 89204 0 2 0x482 syz-executor.1 89204 105413 25996 0 3 0x82 thrsleep syz-fuzzer 89204 94561 25996 0 2 0x4000482 syz-fuzzer 89204 29893 25996 0 3 0x4000082 thrsleep syz-fuzzer 89204 336605 25996 0 3 0x4000082 thrsleep syz-fuzzer 89204 285064 25996 0 3 0x4000082 thrsleep syz-fuzzer 89204 476596 25996 0 2 0x4000482 syz-fuzzer 89204 424465 25996 0 3 0x4000082 thrsleep syz-fuzzer 89204 305942 25996 0 3 0x4000082 kqread syz-fuzzer 25996 136335 62859 0 3 0x10008a pause ksh 62859 469078 35624 0 3 0x92 select sshd 89624 260565 1 0 3 0x100083 ttyin getty 35624 445828 1 0 3 0x80 select sshd 45383 401050 11997 73 2 0x100490 syslogd 11997 112493 1 0 3 0x100082 netio syslogd 13653 18140 1 77 3 0x100090 poll dhclient 91435 516577 1 0 3 0x80 poll dhclient 85120 286127 0 0 2 0x14200 zerothread 96798 459070 0 0 3 0x14200 aiodoned aiodoned 24729 191462 0 0 2 0x14200 update 23159 49988 0 0 3 0x14200 cleaner cleaner 34703 232239 0 0 3 0x14200 reaper reaper 93472 441773 0 0 3 0x14200 pgdaemon pagedaemon 74748 516910 0 0 3 0x14200 bored crynlk 90638 77944 0 0 3 0x14200 bored crypto 49489 206632 0 0 3 0x40014200 acpi0 acpi0 82515 700 0 0 2 0x14200 softnet 84497 53467 0 0 2 0x14200 systqmp 51619 46041 0 0 3 0x14200 bored systq 27804 289490 0 0 2 0x40014200 softclock 13547 477238 0 0 3 0x40014200 idle0 48163 511021 0 0 3 0x14200 bored smr 1 77604 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 9451 6323K 6775K 78643K 10650 0 0 pcb 13 8K 8K 78643K 43 0 0 rtable 101 2K 3K 78643K 203 0 0 ifaddr 38 9K 10K 78643K 42 0 0 counters 19 16K 16K 78643K 19 0 0 ioctlops 1 2K 2K 78643K 20 0 0 iov 0 0K 16K 78643K 6 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1213 76K 76K 78643K 1252 0 0 UFS quota 1 32K 32K 78643K 1 0 0 UFS mount 5 36K 36K 78643K 5 0 0 shm 2 1K 1K 78643K 2 0 0 VM map 3 0K 0K 78643K 3 0 0 sem 9 0K 0K 78643K 16 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1794 195K 288K 78643K 12646 0 0 file desc 6 17K 25K 78643K 87 0 0 proc 47 38K 54K 78643K 393 0 0 subproc 32 2K 2K 78643K 34 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 28 0 0 in_multi 29 1K 2K 78643K 43 0 0 ether_multi 1 0K 0K 78643K 1 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 42 185K 185K 78643K 42 0 0 exec 0 0K 1K 78643K 192 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 109 34K 34K 78643K 1061 0 0 UVM aobj 2 2K 2K 78643K 2 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 20 0 0 NDP 5 0K 0K 78643K 10 0 0 temp 69 3525K 3589K 78643K 3931 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 6 0 0 1 0 1 1 0 8 0 rtpcb 80 29 0 27 1 0 1 1 0 8 0 rtentry 112 49 0 7 2 0 2 2 0 8 0 unpcb 120 51 0 43 1 0 1 1 0 8 0 syncache 264 6 0 6 2 1 1 1 0 8 1 tcpqe 32 331 0 331 1 0 1 1 0 8 1 tcpcb 544 42 0 38 1 0 1 1 0 8 0 ipq 40 2 0 2 1 0 1 1 0 8 1 ipqe 40 8 0 8 1 0 1 1 0 8 1 inpcb 280 128 0 121 2 0 2 2 0 8 1 nd6 48 5 0 2 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 236 0 39 14 0 14 14 0 8 0 art_table 32 237 0 39 2 0 2 2 0 8 0 art_node 16 48 0 9 1 0 1 1 0 8 0 semapl 112 10 0 3 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 1507 0 108 46 0 46 46 0 8 0 ffsino 240 1507 0 108 83 0 83 83 0 8 0 nchpl 144 1856 0 257 60 0 60 60 0 8 0 uvmvnodes 72 1570 0 0 29 0 29 29 0 8 0 vnodes 208 1570 0 0 83 0 83 83 0 8 0 namei 1024 4555 0 4555 1 0 1 1 0 8 1 vmpool 520 1 0 0 1 0 1 1 0 8 0 scxspl 192 4977 0 4977 8 1 7 7 0 8 7 plimitpl 152 14 0 7 1 0 1 1 0 8 0 sigapl 432 257 0 243 2 0 2 2 0 8 0 futexpl 56 1568 0 1567 1 0 1 1 0 8 0 knotepl 112 57 0 38 1 0 1 1 0 8 0 kqueuepl 104 26 0 24 1 0 1 1 0 8 0 pipepl 128 178 0 159 1 0 1 1 0 8 0 fdescpl 424 258 0 243 2 0 2 2 0 8 0 filepl 120 1500 0 1402 4 0 4 4 0 8 1 lockfpl 104 36 0 34 1 0 1 1 0 8 0 lockfspl 48 14 0 12 1 0 1 1 0 8 0 sessionpl 112 17 0 7 1 0 1 1 0 8 0 pgrppl 48 17 0 7 1 0 1 1 0 8 0 ucredpl 96 104 0 97 1 0 1 1 0 8 0 zombiepl 144 243 0 243 1 0 1 1 0 8 1 processpl 864 273 0 243 4 0 4 4 0 8 0 procpl 632 359 0 320 4 0 4 4 0 8 0 sosppl 128 3 0 3 1 0 1 1 0 8 1 sockpl 384 208 0 191 4 0 4 4 0 8 2 mcl16k 16384 2 0 2 1 0 1 1 0 8 1 mcl12k 12288 1 0 1 1 0 1 1 0 8 1 mcl8k 8192 3 0 3 1 0 1 1 0 8 1 mcl4k 4096 15 0 15 2 1 1 1 0 8 1 mcl2k 2048 68125 0 68066 18 3 15 15 0 8 7 mtagpl 80 2 0 2 1 1 0 1 0 8 0 mbufpl 256 109127 0 108930 20 1 19 19 0 8 5 bufpl 256 6214 0 1389 302 0 302 302 0 8 0 anonpl 16 57037 0 37643 112 2 110 110 0 62 32 amapchunkpl 152 1527 0 1378 12 0 12 12 0 158 5 amappl16 192 2036 0 955 72 10 62 72 0 8 7 amappl14 176 75 0 69 1 0 1 1 0 8 0 amappl12 160 4 0 3 2 1 1 1 0 8 0 amappl11 152 82 0 68 1 0 1 1 0 8 0 amappl10 144 9 0 7 1 0 1 1 0 8 0 amappl9 136 553 0 549 1 0 1 1 0 8 0 amappl8 128 162 0 133 2 0 2 2 0 8 0 amappl7 120 35 0 31 1 0 1 1 0 8 0 amappl6 112 80 0 69 1 0 1 1 0 8 0 amappl5 104 151 0 141 1 0 1 1 0 8 0 amappl4 96 472 0 443 1 0 1 1 0 8 0 amappl3 88 137 0 131 1 0 1 1 0 8 0 amappl2 80 1276 0 1200 3 1 2 3 0 8 0 amappl1 72 14296 0 13886 27 17 10 20 0 8 1 amappl 80 588 0 543 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 1 0 0 1 0 1 1 0 8 0 uaddrrnd 24 259 0 243 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 259 0 243 1 0 1 1 0 8 0 vmmpekpl 168 6016 0 5992 2 0 2 2 0 8 0 vmmpepl 168 39584 0 37346 137 6 131 131 0 357 33 vmsppl 272 257 0 243 2 0 2 2 0 8 1 pdppl 4096 524 0 486 6 0 6 6 0 8 1 pvpl 32 156904 0 134436 246 0 246 246 0 265 61 pmappl 200 258 0 243 1 0 1 1 0 8 0 extentpl 40 46 0 29 1 0 1 1 0 8 0 phpool 112 457 0 7 13 0 13 13 0 8 0