panic: amap_pp_adjref: negative reference count Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *507161 54549 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(fffffd802d1fa058,e4,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000b22700,0,200000,e4000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000b22700,0,7,fffffd803f011000,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000b22700,0,7,fffffd803f011000,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff80001488c840,ffff8000ffff8c60) at vm_impl_init_vmx+0xf1 sys/arch/amd64/amd64/vmm.c:1270 vm_create(ffff800000a9b800,ffff8000ffff8c60) at vm_create+0x193 vm_impl_init sys/arch/amd64/amd64/vmm.c:1385 [inline] vm_create(ffff800000a9b800,ffff8000ffff8c60) at vm_create+0x193 sys/arch/amd64/amd64/vmm.c:1174 VOP_IOCTL(fffffd8039dbc820,c5005601,ffff800000a9b800,1,fffffd803f7c6a20,ffff8000ffff8c60) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd8037561690,c5005601,ffff800000a9b800,ffff8000ffff8c60) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff8000ffff8c60,ffff8000175a9e28,ffff8000175a9e70) at sys_ioctl+0x5b9 syscall(ffff8000175a9ef0) at syscall+0x507 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x69ccf19ca60, 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(fffffd802d1fa058,e4,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000b22700,0,200000,e4000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000b22700,0,7,fffffd803f011000,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000b22700,0,7,fffffd803f011000,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff80001488c840,ffff8000ffff8c60) at vm_impl_init_vmx+0xf1 sys/arch/amd64/amd64/vmm.c:1270 vm_create(ffff800000a9b800,ffff8000ffff8c60) at vm_create+0x193 vm_impl_init sys/arch/amd64/amd64/vmm.c:1385 [inline] vm_create(ffff800000a9b800,ffff8000ffff8c60) at vm_create+0x193 sys/arch/amd64/amd64/vmm.c:1174 VOP_IOCTL(fffffd8039dbc820,c5005601,ffff800000a9b800,1,fffffd803f7c6a20,ffff8000ffff8c60) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd8037561690,c5005601,ffff800000a9b800,ffff8000ffff8c60) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff8000ffff8c60,ffff8000175a9e28,ffff8000175a9e70) at sys_ioctl+0x5b9 syscall(ffff8000175a9ef0) at syscall+0x507 sys/arch/amd64/amd64/trap.c:555 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x69ccf19ca60, count: -12 ddb> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff8000175a9780 rbx 0xffff8000175a9830 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800017783000 rax 0xffff800000a69dc0 r8 0xffff8000175a9740 r9 0x1 r10 0xffff800000a69dc0 r11 0x431e37dc164e85d r12 0x3000000008 r13 0xffff8000175a9790 r14 0x100 r15 0x1 rip 0xffffffff810ba108 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000175a9770 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (syz-executor.1) pid=507161 stat=onproc flags process=0 proc=4000000 pri=86, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff8000ffff9640,0xffffffff82571c58 process=0xffff8000ffff6d90 user=0xffff8000175a4000, vmspace=0xfffffd803f011000 estcpu=36, cpticks=11, pctcpu=20.28 user=0, sys=11336, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 54549 178730 75187 0 2 0 syz-executor.1 *54549 507161 75187 0 7 0x4000000 syz-executor.1 28651 408158 75561 0 2 0 syz-executor.0 28651 479474 75561 0 3 0x4000080 fsleep syz-executor.0 28651 352250 75561 0 3 0x4000080 fsleep syz-executor.0 75561 348341 36503 0 2 0x482 syz-executor.0 75187 281085 36503 0 2 0x482 syz-executor.1 75111 477610 0 0 3 0x14200 bored sosplice 36503 392840 58324 0 3 0x82 thrsleep syz-fuzzer 36503 253102 58324 0 2 0x4000482 syz-fuzzer 36503 216122 58324 0 3 0x4000082 kqread syz-fuzzer 36503 380821 58324 0 3 0x4000082 thrsleep syz-fuzzer 36503 126928 58324 0 3 0x4000082 thrsleep syz-fuzzer 36503 26602 58324 0 3 0x4000082 thrsleep syz-fuzzer 36503 18178 58324 0 3 0x4000082 thrsleep syz-fuzzer 36503 6113 58324 0 2 0x4000482 syz-fuzzer 58324 156650 88089 0 3 0x10008a pause ksh 88089 485795 89182 0 3 0x92 select sshd 40844 197224 1 0 3 0x100083 ttyopn getty 89182 323183 1 0 3 0x80 select sshd 99894 337000 68981 73 2 0x100490 syslogd 68981 247005 1 0 3 0x100082 netio syslogd 29630 449830 0 0 2 0x14200 zerothread 34597 420565 0 0 3 0x14200 aiodoned aiodoned 72423 396640 0 0 2 0x14200 update 26705 262917 0 0 3 0x14200 cleaner cleaner 67748 88901 0 0 3 0x14200 reaper reaper 94537 234606 0 0 3 0x14200 pgdaemon pagedaemon 47553 156283 0 0 3 0x14200 bored crynlk 94813 506965 0 0 3 0x14200 bored crypto 65226 459571 0 0 3 0x40014200 acpi0 acpi0 41645 7238 0 0 2 0x14200 softnet 5619 137200 0 0 2 0x14200 systqmp 81293 171137 0 0 3 0x14200 bored systq 29805 151265 0 0 2 0x40014200 softclock 197 414608 0 0 3 0x40014200 idle0 84579 218789 0 0 2 0x14200 smr 1 448969 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 9544 7075K 8239K 78643K 18840 0 0 pcb 13 8K 9K 78643K 346 0 0 rtable 116 12K 12K 78643K 744 0 0 ifaddr 148 21K 23K 78643K 391 0 0 counters 19 16K 16K 78643K 19 0 0 ioctlops 1 2K 2K 78643K 115 0 0 iov 0 0K 32K 78643K 330 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1238 78K 78K 78643K 3647 0 0 UFS quota 1 32K 32K 78643K 1 0 0 UFS mount 5 36K 36K 78643K 5 0 0 shm 2 1K 9K 78643K 26 0 0 VM map 22 5K 5K 78643K 34 0 0 sem 12 1K 1K 78643K 14 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1794 195K 288K 78643K 12646 0 0 file desc 6 17K 25K 78643K 1297 0 0 sigio 0 0K 0K 78643K 37 0 0 proc 43 30K 63K 78643K 721 0 0 subproc 32 2K 2K 78643K 157 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 412 0 0 in_multi 95 5K 5K 78643K 250 0 0 ether_multi 1 0K 0K 78643K 10 0 0 mrt 1 0K 0K 78643K 12 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 54 238K 238K 78643K 54 0 0 exec 0 0K 1K 78643K 407 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 141 116K 116K 78643K 4269 0 0 UVM aobj 130 8K 8K 78643K 135 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 267 0 0 NDP 18 0K 0K 78643K 94 0 0 temp 159 3535K 4175K 78643K 42968 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 31 0 26 1 0 1 1 0 8 0 rtpcb 80 149 0 149 3 2 1 1 0 8 1 rtentry 112 207 0 165 2 0 2 2 0 8 0 unpcb 120 1718 0 1707 6 4 2 2 0 8 1 syncache 264 8 0 8 3 3 0 1 0 8 0 sackhl 24 1 0 1 1 1 0 1 0 8 0 tcpqe 32 102 0 102 4 4 0 1 0 8 0 tcpcb 544 1526 0 1520 6 4 2 2 0 8 1 ipq 40 18 0 18 5 5 0 1 0 8 0 ipqe 40 724 0 724 5 5 0 1 0 8 0 inpcb 280 2936 0 2928 9 5 4 4 0 8 3 rttmr 72 4 0 4 3 3 0 1 0 8 0 nd6 48 26 0 23 1 0 1 1 0 8 0 pkpcb 40 6 0 6 2 2 0 1 0 8 0 ppxss 1128 20 0 20 6 5 1 1 0 8 1 art_heap8 4096 18 0 13 9 3 6 6 0 8 1 art_heap4 256 999 0 760 26 7 19 19 0 8 2 art_table 32 1017 0 773 3 0 3 3 0 8 0 art_node 16 204 0 165 1 0 1 1 0 8 0 sysvmsgpl 40 89 0 72 1 0 1 1 0 8 0 semupl 112 6 0 6 1 1 0 1 0 8 0 semapl 112 12 0 2 1 0 1 1 0 8 0 shmpl 112 133 0 5 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 3391 0 2001 46 0 46 46 0 8 0 ffsino 240 3391 0 2001 83 0 83 83 0 8 0 nchpl 144 5469 0 5014 60 40 20 60 0 8 0 uvmvnodes 72 5549 0 0 101 0 101 101 0 8 0 vnodes 208 5549 0 0 293 0 293 293 0 8 0 namei 1024 18875 0 18875 1 0 1 1 0 8 1 vcpupl 1984 19 0 0 3 0 3 3 0 8 0 vmpool 520 32 0 12 5 3 2 2 0 8 0 scxspl 192 16788 0 16788 14 13 1 7 0 8 1 plimitpl 152 121 0 115 1 0 1 1 0 8 0 sigapl 432 1446 0 1434 2 0 2 2 0 8 0 futexpl 56 49403 0 49401 2 1 1 1 0 8 0 knotepl 112 361 0 342 3 2 1 2 0 8 0 kqueuepl 104 391 0 388 1 0 1 1 0 8 0 pipepl 128 1834 0 1809 7 4 3 3 0 8 2 fdescpl 424 1447 0 1434 2 0 2 2 0 8 0 filepl 120 15528 0 15425 22 15 7 7 0 8 3 lockfpl 104 558 0 558 2 1 1 1 0 8 1 lockfspl 48 198 0 198 2 1 1 1 0 8 1 sessionpl 112 24 0 16 1 0 1 1 0 8 0 pgrppl 48 467 0 459 1 0 1 1 0 8 0 ucredpl 96 1408 0 1402 1 0 1 1 0 8 0 zombiepl 144 1435 0 1435 1 0 1 1 0 8 1 processpl 864 1463 0 1435 4 0 4 4 0 8 0 procpl 632 3127 0 3089 5 1 4 5 0 8 0 sosppl 128 32 0 32 6 6 0 1 0 8 0 sockpl 384 4841 0 4822 24 17 7 7 0 8 5 mcl64k 65536 163 0 163 4 3 1 1 0 8 1 mcl16k 16384 20 0 20 6 5 1 1 0 8 1 mcl12k 12288 49 0 49 5 4 1 1 0 8 1 mcl9k 9216 27 0 27 6 5 1 1 0 8 1 mcl8k 8192 78 0 78 4 3 1 1 0 8 1 mcl4k 4096 166 0 166 4 3 1 1 0 8 1 mcl2k2 2112 11 0 11 6 6 0 1 0 8 0 mcl2k 2048 72922 0 72874 16 9 7 14 0 8 0 mtagpl 80 57 0 53 2 1 1 1 0 8 0 mbufpl 256 135344 0 135237 74 64 10 30 0 8 0 bufpl 256 11172 0 4984 387 0 387 387 0 8 0 anonpl 16 273061 0 246807 173 55 118 118 0 62 5 amapchunkpl 152 10482 0 9899 65 41 24 24 0 158 0 amappl16 192 11380 0 10149 141 71 70 82 0 8 8 amappl15 184 2 0 2 2 2 0 1 0 8 0 amappl14 176 182 0 175 1 0 1 1 0 8 0 amappl13 168 173 0 173 1 1 0 1 0 8 0 amappl12 160 94 0 92 3 2 1 1 0 8 0 amappl11 152 550 0 546 1 0 1 1 0 8 0 amappl10 144 19 0 16 1 0 1 1 0 8 0 amappl9 136 1000 0 996 1 0 1 1 0 8 0 amappl8 128 573 0 542 3 1 2 2 0 8 1 amappl7 120 67 0 60 1 0 1 1 0 8 0 amappl6 112 520 0 512 1 0 1 1 0 8 0 amappl5 104 304 0 295 1 0 1 1 0 8 0 amappl4 96 1599 0 1573 1 0 1 1 0 8 0 amappl3 88 396 0 385 1 0 1 1 0 8 0 amappl2 80 10560 0 10494 3 1 2 3 0 8 0 amappl1 72 36447 0 36057 26 16 10 20 0 8 0 amappl 80 3532 0 3472 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 134 0 5 3 0 3 3 0 8 0 uaddrrnd 24 1479 0 1434 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 1479 0 1434 1 0 1 1 0 8 0 vmmpekpl 168 15576 0 15540 2 0 2 2 0 8 0 vmmpepl 168 187588 0 185240 246 100 146 146 0 357 36 vmsppl 272 1446 0 1434 2 1 1 2 0 8 0 pdppl 4096 2964 0 2911 8 1 7 7 0 8 0 pvpl 32 663535 0 640771 360 99 261 318 0 265 48 pmappl 200 1478 0 1446 2 0 2 2 0 8 0 extentpl 40 46 0 29 1 0 1 1 0 8 0 phpool 112 635 0 105 16 0 16 16 0 8 0