panic: amap_pp_adjref: negative reference count Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *269476 29297 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(fffffd8029ce45f8,7ff,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000ace700,0,200000,7fc000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000ace700,0,7,fffffd803f011330,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000ace700,0,7,fffffd803f011330,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800017b41878,ffff8000ffff2ee8) at vm_impl_init_vmx+0xf1 sys/arch/amd64/amd64/vmm.c:1270 vm_create(ffff800000afa000,ffff8000ffff2ee8) at vm_create+0x193 vm_impl_init sys/arch/amd64/amd64/vmm.c:1385 [inline] vm_create(ffff800000afa000,ffff8000ffff2ee8) at vm_create+0x193 sys/arch/amd64/amd64/vmm.c:1174 VOP_IOCTL(fffffd8038b24680,c5005601,ffff800000afa000,1,fffffd803f7c6900,ffff8000ffff2ee8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd802d797718,c5005601,ffff800000afa000,ffff8000ffff2ee8) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff8000ffff2ee8,ffff80001796ee08,ffff80001796ee50) at sys_ioctl+0x5b9 syscall(ffff80001796eed0) at syscall+0x507 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x5518b0c49c0, 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(fffffd8029ce45f8,7ff,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000ace700,0,200000,7fc000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000ace700,0,7,fffffd803f011330,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000ace700,0,7,fffffd803f011330,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800017b41878,ffff8000ffff2ee8) at vm_impl_init_vmx+0xf1 sys/arch/amd64/amd64/vmm.c:1270 vm_create(ffff800000afa000,ffff8000ffff2ee8) at vm_create+0x193 vm_impl_init sys/arch/amd64/amd64/vmm.c:1385 [inline] vm_create(ffff800000afa000,ffff8000ffff2ee8) at vm_create+0x193 sys/arch/amd64/amd64/vmm.c:1174 VOP_IOCTL(fffffd8038b24680,c5005601,ffff800000afa000,1,fffffd803f7c6900,ffff8000ffff2ee8) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd802d797718,c5005601,ffff800000afa000,ffff8000ffff2ee8) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff8000ffff2ee8,ffff80001796ee08,ffff80001796ee50) at sys_ioctl+0x5b9 syscall(ffff80001796eed0) at syscall+0x507 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x5518b0c49c0, count: -12 ddb> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff80001796e760 rbx 0xffff80001796e810 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800017b8d000 rax 0xffff800000a6fec0 r8 0xffff80001796e720 r9 0x1 r10 0xffff800000a6fec0 r11 0xbffdee2fc4946e13 r12 0x3000000008 r13 0xffff80001796e770 r14 0x100 r15 0x1 rip 0xffffffff812012d8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff80001796e750 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (syz-executor.1) pid=269476 stat=onproc flags process=0 proc=4000000 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff8000ffff3650,0xffff8000ffff3170 process=0xffff8000ffff66d0 user=0xffff800017969000, vmspace=0xfffffd803f011330 estcpu=36, cpticks=8, pctcpu=20.28 user=0, sys=10527, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 29297 186288 29640 0 2 0 syz-executor.1 *29297 269476 29640 0 7 0x4000000 syz-executor.1 59493 132794 16364 0 2 0 syz-executor.0 59493 438643 16364 0 3 0x4000080 pipewr syz-executor.0 59493 449824 16364 0 3 0x4000080 fsleep syz-executor.0 29640 175999 54062 0 2 0x482 syz-executor.1 16364 440282 54062 0 2 0x482 syz-executor.0 73465 385742 0 0 2 0x14600 acct 30218 211034 0 0 3 0x14200 bored sosplice 54062 163190 81711 0 3 0x82 thrsleep syz-fuzzer 54062 469906 81711 0 2 0x4000482 syz-fuzzer 54062 398850 81711 0 3 0x4000082 kqread syz-fuzzer 54062 129721 81711 0 3 0x4000082 thrsleep syz-fuzzer 54062 149874 81711 0 2 0x4000482 syz-fuzzer 54062 205628 81711 0 3 0x4000082 thrsleep syz-fuzzer 54062 32496 81711 0 3 0x4000082 thrsleep syz-fuzzer 54062 37885 81711 0 3 0x4000082 thrsleep syz-fuzzer 81711 209027 77477 0 3 0x10008a pause ksh 77477 493618 8123 0 3 0x92 select sshd 52172 135708 1 0 3 0x100083 ttyin getty 8123 378246 1 0 3 0x80 select sshd 51647 425724 54767 73 2 0x100490 syslogd 54767 124502 1 0 3 0x100082 netio syslogd 72382 118977 0 0 2 0x14200 zerothread 23034 25528 0 0 3 0x14200 aiodoned aiodoned 2806 78922 0 0 2 0x14200 update 81898 373957 0 0 3 0x14200 cleaner cleaner 49680 127780 0 0 3 0x14200 reaper reaper 4979 176387 0 0 3 0x14200 pgdaemon pagedaemon 36503 70184 0 0 3 0x14200 bored crynlk 26772 133734 0 0 3 0x14200 bored crypto 47955 228700 0 0 3 0x40014200 acpi0 acpi0 70675 455766 0 0 2 0x14200 softnet 56330 213971 0 0 2 0x14200 systqmp 79614 407199 0 0 3 0x14200 bored systq 17450 110432 0 0 2 0x40014200 softclock 76919 436782 0 0 3 0x40014200 idle0 42348 207067 0 0 3 0x14200 bored smr 1 257433 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 9554 6385K 15015K 78643K 19288 0 0 pcb 13 11K 12K 78643K 408 0 0 rtable 111 12K 13K 78643K 659 0 0 ifaddr 100 18K 18K 78643K 396 0 0 counters 19 16K 16K 78643K 19 0 0 ioctlops 1 2K 2K 78643K 150 0 0 iov 0 0K 32K 78643K 1090 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1226 77K 78K 78643K 3747 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 49 12K 12K 78643K 56 0 0 sem 12 0K 0K 78643K 587 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1794 195K 288K 78643K 12646 0 0 file desc 6 17K 25K 78643K 1605 0 0 sigio 0 0K 0K 78643K 37 0 0 proc 44 30K 63K 78643K 844 0 0 subproc 32 2K 2K 78643K 187 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 1219 0 0 in_multi 144 7K 7K 78643K 306 0 0 ether_multi 1 0K 0K 78643K 14 0 0 mrt 1 0K 0K 78643K 16 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 519 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 174 406K 406K 78643K 5007 0 0 UVM aobj 90 3K 3K 78643K 95 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 369 0 0 NDP 18 0K 0K 78643K 91 0 0 temp 159 3541K 3627K 78643K 60504 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 33 0 28 1 0 1 1 0 8 0 rtpcb 80 202 0 202 2 1 1 1 0 8 1 rtentry 112 198 0 157 2 0 2 2 0 8 0 unpcb 120 1724 0 1717 4 3 1 2 0 8 0 syncache 264 12 0 12 4 3 1 1 0 8 1 tcpqe 32 102 0 102 5 4 1 1 0 8 1 tcpcb 544 1436 0 1432 18 17 1 13 0 8 0 ipq 40 16 0 16 4 4 0 1 0 8 0 ipqe 40 548 0 548 4 4 0 1 0 8 0 inpcb 280 2814 0 2810 20 18 2 9 0 8 1 rttmr 72 4 0 4 3 3 0 1 0 8 0 nd6 48 29 0 26 1 0 1 1 0 8 0 pkpcb 40 8 0 8 4 4 0 1 0 8 0 swfcl 56 4 0 0 1 0 1 1 0 8 0 ppxss 1128 27 0 27 6 5 1 1 0 8 1 art_heap8 4096 3 0 0 3 0 3 3 0 8 0 art_heap4 256 951 0 718 19 4 15 15 0 8 0 art_table 32 954 0 718 2 0 2 2 0 8 0 art_node 16 197 0 159 1 0 1 1 0 8 0 sysvmsgpl 40 28 0 15 1 0 1 1 0 8 0 semupl 112 3 0 3 1 1 0 1 0 8 0 semapl 112 585 0 575 1 0 1 1 0 8 0 shmpl 112 93 0 5 3 0 3 3 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 3954 0 2562 46 0 46 46 0 8 0 ffsino 240 3954 0 2562 83 0 83 83 0 8 0 nchpl 144 6539 0 4946 60 0 60 60 0 8 0 uvmvnodes 72 5926 0 0 108 0 108 108 0 8 0 vnodes 208 5926 0 0 312 0 312 312 0 8 0 namei 1024 22245 0 22245 2 1 1 1 0 8 1 vcpupl 1984 46 0 0 6 0 6 6 0 8 0 vmpool 520 54 0 7 4 0 4 4 0 8 0 scxspl 192 21460 0 21460 21 18 3 7 0 8 3 plimitpl 152 171 0 165 1 0 1 1 0 8 0 sigapl 432 1748 0 1736 2 0 2 2 0 8 0 futexpl 56 60104 0 60103 2 1 1 1 0 8 0 knotepl 112 455 0 435 2 1 1 2 0 8 0 kqueuepl 104 617 0 614 4 3 1 4 0 8 0 pipepl 128 1104 0 1081 7 6 1 2 0 8 0 fdescpl 424 1749 0 1736 2 0 2 2 0 8 0 filepl 120 16575 0 16484 18 14 4 11 0 8 1 lockfpl 104 564 0 564 2 1 1 1 0 8 1 lockfspl 48 190 0 190 2 1 1 1 0 8 1 sessionpl 112 26 0 18 1 0 1 1 0 8 0 pgrppl 48 48 0 40 1 0 1 1 0 8 0 ucredpl 96 1822 0 1816 1 0 1 1 0 8 0 zombiepl 144 1738 0 1738 1 0 1 1 0 8 1 processpl 864 1767 0 1738 4 0 4 4 0 8 0 procpl 632 3759 0 3720 4 0 4 4 0 8 0 sosppl 128 18 0 18 6 5 1 1 0 8 1 sockpl 384 4763 0 4752 31 26 5 13 0 8 3 mcl64k 65536 237 0 237 6 4 2 4 0 8 2 mcl16k 16384 43 0 43 5 4 1 1 0 8 1 mcl12k 12288 73 0 73 5 4 1 1 0 8 1 mcl9k 9216 40 0 40 4 3 1 1 0 8 1 mcl8k 8192 103 0 103 2 1 1 1 0 8 1 mcl4k 4096 204 0 204 2 1 1 1 0 8 1 mcl2k2 2112 18 0 18 8 7 1 1 0 8 1 mcl2k 2048 73344 0 73308 16 10 6 12 0 8 1 mtagpl 80 73 0 64 2 1 1 1 0 8 0 mbufpl 256 130923 0 130834 82 71 11 27 0 8 3 bufpl 256 13498 0 7501 375 0 375 375 0 8 0 anonpl 16 317865 0 297998 134 45 89 100 0 62 0 amapchunkpl 152 9298 0 9012 23 12 11 11 0 158 0 amappl16 192 15231 0 14030 164 95 69 73 0 8 8 amappl15 184 319 0 315 2 1 1 1 0 8 0 amappl14 176 472 0 465 1 0 1 1 0 8 0 amappl13 168 295 0 295 2 1 1 1 0 8 1 amappl12 160 145 0 142 2 1 1 1 0 8 0 amappl11 152 342 0 337 1 0 1 1 0 8 0 amappl10 144 188 0 185 1 0 1 1 0 8 0 amappl9 136 742 0 738 1 0 1 1 0 8 0 amappl8 128 349 0 311 2 0 2 2 0 8 0 amappl7 120 231 0 225 1 0 1 1 0 8 0 amappl6 112 327 0 314 1 0 1 1 0 8 0 amappl5 104 400 0 392 1 0 1 1 0 8 0 amappl4 96 2169 0 2140 1 0 1 1 0 8 0 amappl3 88 578 0 572 1 0 1 1 0 8 0 amappl2 80 12842 0 12770 3 1 2 3 0 8 0 amappl1 72 41406 0 40994 26 16 10 20 0 8 0 amappl 80 4189 0 4119 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 94 0 5 2 0 2 2 0 8 0 uaddrrnd 24 1803 0 1736 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 1803 0 1736 1 0 1 1 0 8 0 vmmpekpl 168 14887 0 14853 2 0 2 2 0 8 0 vmmpepl 168 225633 0 223203 245 98 147 152 0 357 41 vmsppl 272 1748 0 1736 2 1 1 2 0 8 0 pdppl 4096 3612 0 3532 13 3 10 10 0 8 0 pvpl 32 674330 0 651237 271 69 202 231 0 265 9 pmappl 200 1802 0 1743 5 1 4 4 0 8 0 extentpl 40 46 0 29 1 0 1 1 0 8 0 phpool 112 633 0 119 16 1 15 15 0 8 0