panic: amap_pp_adjref: negative reference count Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *215181 57755 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(fffffd80244f7440,7f0,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000cbe900,0,200000,7f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000cbe900,0,7,fffffd803f014110,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000cbe900,0,7,fffffd803f014110,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800017876aa0,ffff8000ffff8008) at vm_impl_init_vmx+0xf1 sys/arch/amd64/amd64/vmm.c:1270 vm_create(ffff800000b13000,ffff8000ffff8008) at vm_create+0x193 vm_impl_init sys/arch/amd64/amd64/vmm.c:1385 [inline] vm_create(ffff800000b13000,ffff8000ffff8008) at vm_create+0x193 sys/arch/amd64/amd64/vmm.c:1174 VOP_IOCTL(fffffd803659c340,c5005601,ffff800000b13000,1,fffffd803f7c6c00,ffff8000ffff8008) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd8037564528,c5005601,ffff800000b13000,ffff8000ffff8008) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff8000ffff8008,ffff8000177e5ba8,ffff8000177e5bf0) at sys_ioctl+0x5b9 syscall(ffff8000177e5c70) at syscall+0x507 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff59,0,3,a9ea4642010) at Xsyscall+0x128 end of kernel end trace frame: 0xaa13e1a2f90, 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(fffffd80244f7440,7f0,200,1) at amap_pp_adjref+0x59e sys/uvm/uvm_amap.c:829 uvm_mapent_clone(ffff800000cbe900,0,200000,7f0000,7,7) at uvm_mapent_clone+0x14c sys/uvm/uvm_map.c:3733 uvm_share(ffff800000cbe900,0,7,fffffd803f014110,20800000,200000) at uvm_share+0x4b4 uvm_mapent_share sys/uvm/uvm_map.c:3767 [inline] uvm_share(ffff800000cbe900,0,7,fffffd803f014110,20800000,200000) at uvm_share+0x4b4 sys/uvm/uvm_map.c:3668 vm_impl_init_vmx(ffff800017876aa0,ffff8000ffff8008) at vm_impl_init_vmx+0xf1 sys/arch/amd64/amd64/vmm.c:1270 vm_create(ffff800000b13000,ffff8000ffff8008) at vm_create+0x193 vm_impl_init sys/arch/amd64/amd64/vmm.c:1385 [inline] vm_create(ffff800000b13000,ffff8000ffff8008) at vm_create+0x193 sys/arch/amd64/amd64/vmm.c:1174 VOP_IOCTL(fffffd803659c340,c5005601,ffff800000b13000,1,fffffd803f7c6c00,ffff8000ffff8008) at VOP_IOCTL+0x88 sys/kern/vfs_vops.c:291 vn_ioctl(fffffd8037564528,c5005601,ffff800000b13000,ffff8000ffff8008) at vn_ioctl+0xb7 sys/kern/vfs_vnops.c:533 sys_ioctl(ffff8000ffff8008,ffff8000177e5ba8,ffff8000177e5bf0) at sys_ioctl+0x5b9 syscall(ffff8000177e5c70) at syscall+0x507 sys/arch/amd64/amd64/trap.c:555 Xsyscall(6,0,ffffffffffffff59,0,3,a9ea4642010) at Xsyscall+0x128 end of kernel end trace frame: 0xaa13e1a2f90, count: -12 ddb> show registers rdi 0 rsi 0x3ffff acpi_pdirpa+0x2be67 rbp 0xffff8000177e5500 rbx 0xffff8000177e55b0 rdx 0x40000 acpi_pdirpa+0x2be68 rcx 0xffff800014b3d000 rax 0xffff800000cc0d40 r8 0xffff8000177e54c0 r9 0x1 r10 0xffff800000cc0d40 r11 0x48045089bd869cd6 r12 0x3000000008 r13 0xffff8000177e5510 r14 0x100 r15 0x1 rip 0xffffffff816154e8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000177e54f0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (syz-executor.1) pid=215181 stat=onproc flags process=0 proc=4000000 pri=84, usrpri=84, nice=20 forw=0xffffffffffffffff, list=0xffff8000ffff84f8,0xffffffff825946d8 process=0xffff8000ffff70f0 user=0xffff8000177e0000, vmspace=0xfffffd803f014110 estcpu=34, cpticks=0, pctcpu=20.28 user=0, sys=11120, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 57755 458516 20646 0 2 0 syz-executor.1 *57755 215181 20646 0 7 0x4000000 syz-executor.1 22495 442821 59684 0 2 0x2 syz-executor.0 20646 522252 59684 0 2 0x482 syz-executor.1 28551 228187 0 0 2 0x14600 acct 72163 63619 1 0 3 0x100083 ttyin getty 84968 346917 0 0 3 0x14200 bored sosplice 59684 372712 80600 0 3 0x82 thrsleep syz-fuzzer 59684 523646 80600 0 2 0x4000482 syz-fuzzer 59684 486325 80600 0 3 0x4000082 thrsleep syz-fuzzer 59684 420772 80600 0 3 0x4000082 thrsleep syz-fuzzer 59684 300024 80600 0 3 0x4000082 thrsleep syz-fuzzer 59684 23645 80600 0 3 0x4000082 kqread syz-fuzzer 59684 311309 80600 0 3 0x4000082 thrsleep syz-fuzzer 59684 2492 80600 0 2 0x4000482 syz-fuzzer 59684 67605 80600 0 3 0x4000082 thrsleep syz-fuzzer 80600 84124 4712 0 3 0x10008a pause ksh 4712 238750 58391 0 3 0x92 select sshd 58391 347097 1 0 3 0x80 select sshd 34533 93335 46292 73 2 0x100490 syslogd 46292 322801 1 0 3 0x100082 netio syslogd 80633 5609 0 0 2 0x14200 zerothread 31102 481952 0 0 3 0x14200 aiodoned aiodoned 93900 294095 0 0 2 0x14200 update 36882 377014 0 0 3 0x14200 cleaner cleaner 65346 462198 0 0 3 0x14200 reaper reaper 94692 186731 0 0 3 0x14200 pgdaemon pagedaemon 33955 120314 0 0 3 0x14200 bored crynlk 53714 146654 0 0 3 0x14200 bored crypto 79754 386669 0 0 3 0x40014200 acpi0 acpi0 71167 451943 0 0 2 0x14200 softnet 3769 507128 0 0 2 0x14200 systqmp 16916 363991 0 0 2 0x14200 systq 90852 359477 0 0 2 0x40014200 softclock 68181 101844 0 0 3 0x40014200 idle0 41099 76570 0 0 2 0x14200 smr 1 438041 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 9586 6355K 8155K 78643K 58030 0 0 pcb 13 11K 12K 78643K 4141 0 0 rtable 118 12K 14K 78643K 6148 0 0 ifaddr 651 64K 68K 78643K 2842 0 0 counters 19 16K 16K 78643K 19 0 0 ioctlops 1 2K 2K 78643K 1278 0 0 iov 0 0K 32K 78643K 4577 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1224 77K 78K 78643K 18733 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 264 0 0 VM map 223 55K 55K 78643K 289 0 0 sem 12 0K 1K 78643K 4858 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1793 195K 288K 78643K 12645 0 0 file desc 5 13K 25K 78643K 17059 0 0 sigio 0 0K 0K 78643K 1345 0 0 proc 45 30K 55K 78643K 5606 0 0 subproc 32 2K 2K 78643K 1680 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 2157 0 0 in_multi 22 1K 2K 78643K 1910 0 0 ether_multi 1 0K 0K 78643K 182 0 0 mrt 4 0K 0K 78643K 140 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 102 450K 450K 78643K 102 0 0 exec 0 0K 1K 78643K 3725 0 0 pfkey data 0 0K 4K 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 425 1722K 1722K 78643K 45234 0 0 UVM aobj 130 8K 8K 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 4101 0 0 NDP 25 0K 1K 78643K 778 0 0 temp 186 3536K 4177K 78643K 790759 0 0 kqueue 0 0K 0K 78643K 225 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 410 0 406 1 0 1 1 0 8 0 rtpcb 80 2001 0 2001 35 34 1 1 0 8 1 rtentry 112 1752 0 1713 2 0 2 2 0 8 0 unpcb 120 10622 0 10592 27 25 2 2 0 8 1 syncache 264 119 0 119 51 51 0 1 0 8 0 sackhl 24 1 0 1 1 1 0 1 0 8 0 tcpqe 32 83 0 83 34 34 0 1 0 8 0 tcpcb 544 12048 0 12044 270 261 9 15 0 8 8 ipq 40 317 0 317 77 76 1 1 0 8 1 ipqe 40 11369 0 11369 77 76 1 1 0 8 1 inpcb 280 27528 0 27524 209 201 8 9 0 8 7 rttmr 72 48 0 47 7 6 1 1 0 8 0 ip6q 72 13 0 13 6 6 0 1 0 8 0 ip6af 40 35 0 35 6 6 0 1 0 8 0 nd6 48 230 0 228 15 14 1 1 0 8 0 pkpcb 40 84 0 84 27 27 0 1 0 8 0 swfcl 56 6 0 0 1 0 1 1 0 8 0 ppxss 1128 309 0 309 80 79 1 1 0 8 1 art_heap8 4096 37 0 36 27 26 1 3 0 8 0 art_heap4 256 6845 0 6586 99 82 17 20 0 8 0 art_table 32 6882 0 6622 20 17 3 3 0 8 0 art_node 16 1751 0 1715 1 0 1 1 0 8 0 sysvmsgpl 40 45 0 38 1 0 1 1 0 8 0 semupl 112 3 0 3 1 1 0 1 0 8 0 semapl 112 4854 0 4844 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 32684 0 31227 48 0 48 48 0 8 0 ffsino 240 32684 0 31227 88 1 87 87 0 8 0 nchpl 144 61384 0 60862 60 39 21 60 0 8 0 uvmvnodes 72 9911 0 0 181 0 181 181 0 8 0 vnodes 208 9911 0 0 522 0 522 522 0 8 0 namei 1024 225088 0 225088 16 15 1 1 0 8 1 vcpupl 1984 223 0 3 28 0 28 28 0 8 0 vmpool 520 287 0 66 16 1 15 15 0 8 0 scsiplug 64 19 0 19 14 14 0 1 0 8 0 scxspl 192 243951 0 243951 125 124 1 7 0 8 1 plimitpl 152 1530 0 1524 1 0 1 1 0 8 0 sigapl 432 16943 0 16932 2 0 2 2 0 8 0 futexpl 56 565512 0 565512 21 20 1 1 0 8 1 knotepl 112 4518 0 4499 16 13 3 3 0 8 2 kqueuepl 104 7808 0 7805 58 54 4 4 0 8 3 pipepl 128 13364 0 13343 71 70 1 2 0 8 0 fdescpl 424 16944 0 16932 2 0 2 2 0 8 0 filepl 120 173505 0 173412 176 166 10 11 0 8 7 lockfpl 104 7357 0 7356 13 12 1 1 0 8 0 lockfspl 48 2304 0 2303 13 12 1 1 0 8 0 sessionpl 112 115 0 107 1 0 1 1 0 8 0 pgrppl 48 327 0 319 1 0 1 1 0 8 0 ucredpl 96 19231 0 19225 1 0 1 1 0 8 0 zombiepl 144 16949 0 16949 1 0 1 1 0 8 1 processpl 864 16977 0 16949 4 0 4 4 0 8 0 procpl 632 39124 0 39087 15 11 4 5 0 8 0 sosppl 128 303 0 303 76 76 0 1 0 8 0 sockpl 384 40605 0 40569 282 270 12 16 0 8 8 mcl64k 65536 3719 0 3719 270 269 1 64 0 8 1 mcl16k 16384 282 0 282 73 73 0 1 0 8 0 mcl12k 12288 642 0 642 52 51 1 1 0 8 1 mcl9k 9216 249 0 249 80 80 0 1 0 8 0 mcl8k 8192 1137 0 1137 29 28 1 1 0 8 1 mcl4k 4096 2823 0 2823 20 19 1 1 0 8 1 mcl2k2 2112 205 0 205 79 79 0 1 0 8 0 mcl2k 2048 107706 0 107663 48 42 6 13 0 8 0 mtagpl 80 797 0 793 16 15 1 1 0 8 0 mbufpl 256 370902 0 370802 1002 986 16 48 0 8 8 bufpl 256 84289 0 74377 620 0 620 620 0 8 0 anonpl 16 2171094 0 2144672 592 477 115 126 0 62 2 amapchunkpl 152 93273 0 93035 323 312 11 33 0 158 0 amappl16 192 113163 0 111585 802 717 85 93 0 8 5 amappl15 184 1896 0 1896 8 8 0 1 0 8 0 amappl14 176 3142 0 3135 1 0 1 1 0 8 0 amappl13 168 2492 0 2492 12 12 0 1 0 8 0 amappl12 160 2457 0 2454 1 0 1 1 0 8 0 amappl11 152 2813 0 2809 1 0 1 1 0 8 0 amappl10 144 2610 0 2610 13 13 0 1 0 8 0 amappl9 136 3218 0 3214 1 0 1 1 0 8 0 amappl8 128 2725 0 2639 8 5 3 3 0 8 0 amappl7 120 3016 0 3007 1 0 1 1 0 8 0 amappl6 112 2525 0 2506 1 0 1 1 0 8 0 amappl5 104 3576 0 3568 1 0 1 1 0 8 0 amappl4 96 15846 0 15812 1 0 1 1 0 8 0 amappl3 88 5756 0 5745 1 0 1 1 0 8 0 amappl2 80 131885 0 131792 6 3 3 3 0 8 0 amappl1 72 324130 0 323754 25 16 9 20 0 8 0 amappl 80 41180 0 41027 7 3 4 4 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 133 0 4 3 0 3 3 0 8 0 uaddrrnd 24 17231 0 16932 2 0 2 2 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 17231 0 16932 2 0 2 2 0 8 0 vmmpekpl 168 101713 0 101651 5 1 4 4 0 8 0 vmmpepl 168 2104543 0 2101323 1394 1208 186 195 0 357 34 vmsppl 272 16943 0 16932 7 6 1 2 0 8 0 pdppl 4096 34468 0 34216 46 14 32 32 0 8 0 pvpl 32 6050693 0 6027402 1350 1129 221 350 0 265 5 pmappl 200 17230 0 16998 16 3 13 13 0 8 0 extentpl 40 41 0 26 1 0 1 1 0 8 0 phpool 112 2620 0 1824 27 3 24 24 0 8 0