panic: amap_add: slot in use Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND * 86057 94900 0 0 0x4000000 0K syz-executor1 79975 97587 0 0x2 0x4000000 1 syz-fuzzer db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:399 panic() at panic+0x16c sys/kern/subr_prf.c:208 amap_add(5f38f35a3d8515af,fffffd807e0a38a0,fffffd8006661ba0,ffff800020c77638) at amap_add+0x1a6 sys/uvm/uvm_amap.c:1120 uvm_fault(b8003cf243d2b2af,ffff800020bba270,0,ffffffff816897a0) at uvm_fault+0x1986 sys/uvm/uvm_fault.c:1194 pageflttrap() at pageflttrap+0x216 sys/arch/amd64/amd64/trap.c:200 kerntrap(f078a75494b8c7f4) at kerntrap+0xeb sys/arch/amd64/amd64/trap.c:294 alltraps_kern(6,7f7fdfffc000,20000000,0,ffff800020bba270,ffff800020c77a50) at alltraps_kern+0x7b copyinstr(75819b85d234ae56,0,20000000,ffff800020c77a10,3,1450) at copyinstr+0x50 dounlinkat(3b1a8e8ff5bcad63,0,ffff800020bba270,7687d0c5a8) at dounlinkat+0xa1 sys/kern/vfs_syscalls.c:1673 syscall(cba635fff3627911) at syscall+0x5a0 mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(cba635fff3627911) at syscall+0x5a0 sys/arch/amd64/amd64/trap.c:583 Xsyscall(6,0,7,0,3,73e90cc1a0) at Xsyscall+0x128 end of kernel end trace frame: 0x7687d0c630, count: 4 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{0}> ddb{0}> set $lines = 0 ddb{0}> show panic amap_add: slot in use ddb{0}> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:399 panic() at panic+0x16c sys/kern/subr_prf.c:208 amap_add(5f38f35a3d8515af,fffffd807e0a38a0,fffffd8006661ba0,ffff800020c77638) at amap_add+0x1a6 sys/uvm/uvm_amap.c:1120 uvm_fault(b8003cf243d2b2af,ffff800020bba270,0,ffffffff816897a0) at uvm_fault+0x1986 sys/uvm/uvm_fault.c:1194 pageflttrap() at pageflttrap+0x216 sys/arch/amd64/amd64/trap.c:200 kerntrap(f078a75494b8c7f4) at kerntrap+0xeb sys/arch/amd64/amd64/trap.c:294 alltraps_kern(6,7f7fdfffc000,20000000,0,ffff800020bba270,ffff800020c77a50) at alltraps_kern+0x7b copyinstr(75819b85d234ae56,0,20000000,ffff800020c77a10,3,1450) at copyinstr+0x50 dounlinkat(3b1a8e8ff5bcad63,0,ffff800020bba270,7687d0c5a8) at dounlinkat+0xa1 sys/kern/vfs_syscalls.c:1673 syscall(cba635fff3627911) at syscall+0x5a0 mi_syscall sys/sys/syscall_mi.h:99 [inline] syscall(cba635fff3627911) at syscall+0x5a0 sys/arch/amd64/amd64/trap.c:583 Xsyscall(6,0,7,0,3,73e90cc1a0) at Xsyscall+0x128 end of kernel end trace frame: 0x7687d0c630, count: -11 ddb{0}> show registers rdi 0xffffffff81326597 db_enter+0x17 rsi 0xfe0 rbp 0xffff800020c77490 rbx 0xffff800020c77530 rdx 0xfe1 rcx 0xffff800002f48000 rax 0xffff800002f48000 r8 0xffffffff81c104a4 kprintf+0x174 r9 0x1 r10 0x581d497f74f9fe87 r11 0xa4cc454b5983f0a r12 0x3000000008 r13 0xffff800020c774a0 r14 0x100 r15 0x1 rip 0xffffffff81326598 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff800020c77480 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb{0}> show proc PROC (syz-executor1) pid=86057 stat=onproc flags process=0 proc=4000000 pri=4, usrpri=80, nice=20 forw=0xffffffffffffffff, list=0xffff800020bbb788,0xffffffff8230d770 process=0xffff800020b95078 user=0xffff800020c72000, vmspace=0xfffffd807f00c5a0 estcpu=36, cpticks=0, pctcpu=0.0 user=0, sys=0, intr=0 ddb{0}> ps PID TID PPID UID S FLAGS WAIT COMMAND 94900 272196 51488 0 2 0 syz-executor1 94900 414735 51488 0 2 0x4000000 syz-executor1 94900 131541 51488 0 2 0x4000000 syz-executor1 *94900 86057 51488 0 7 0x4000000 syz-executor1 47927 477643 1 0 3 0x100083 ttyin getty 79138 313244 0 0 3 0x14200 bored sosplice 51488 148377 97587 0 3 0x82 nanosleep syz-executor1 91327 331123 97587 0 2 0x2 syz-executor0 97587 454468 69891 0 3 0x82 thrsleep syz-fuzzer 97587 210439 69891 0 3 0x4000082 nanosleep syz-fuzzer 97587 519060 69891 0 3 0x4000082 thrsleep syz-fuzzer 97587 256597 69891 0 3 0x4000082 thrsleep syz-fuzzer 97587 258949 69891 0 3 0x4000082 thrsleep syz-fuzzer 97587 79975 69891 0 7 0x4000002 syz-fuzzer 97587 523176 69891 0 3 0x4000082 kqread syz-fuzzer 97587 461482 69891 0 3 0x4000082 thrsleep syz-fuzzer 97587 141019 69891 0 3 0x4000082 thrsleep syz-fuzzer 97587 218649 69891 0 3 0x4000082 thrsleep syz-fuzzer 69891 430899 1695 0 3 0x10008a pause ksh 1695 14351 3785 0 3 0x92 select sshd 3785 5144 1 0 3 0x80 select sshd 90927 195564 11593 73 3 0x100090 kqread syslogd 11593 496559 1 0 3 0x100082 netio syslogd 11684 112649 1 77 3 0x100090 poll dhclient 83350 75664 1 0 3 0x80 poll dhclient 82682 252149 0 0 3 0x14200 pgzero zerothread 65139 325589 0 0 3 0x14200 aiodoned aiodoned 66386 503169 0 0 3 0x14200 syncer update 5891 277800 0 0 3 0x14200 cleaner cleaner 29881 73827 0 0 3 0x14200 reaper reaper 77520 511216 0 0 3 0x14200 pgdaemon pagedaemon 24762 372891 0 0 3 0x14200 bored crynlk 64790 453427 0 0 3 0x14200 bored crypto 70221 83170 0 0 3 0x40014200 acpi0 acpi0 12286 306900 0 0 3 0x40014200 idle1 10457 250736 0 0 3 0x14200 bored softnet 79706 519003 0 0 3 0x14200 bored systqmp 84753 469090 0 0 3 0x14200 bored systq 64511 296835 0 0 3 0x40014200 bored softclock 57156 69682 0 0 3 0x40014200 idle0 1 189600 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb{0}> show all locks Process 94900 (syz-executor1) thread 0xffff800020bba270 (86057) exclusive kernel_lock &kernel_lock r = 1 (0xffffffff8231ef10) locked @ /syzkaller/managers/multicore/kernel/sys/kern/sched_bsd.c:429 ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9571 10470K 10486K 78643K 14328 0 0 pcb 23 9K 11K 78643K 8365 0 0 rtable 100 3K 4K 78643K 1738 0 0 ifaddr 65 21K 25K 78643K 998 0 0 counters 39 33K 33K 78643K 39 0 0 ioctlops 0 0K 2K 78643K 109 0 0 iov 0 0K 32K 78643K 1677 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1197 75K 76K 78643K 11326 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 262 0 0 VM map 2 1K 1K 78643K 2 0 0 sem 12 0K 0K 78643K 1663 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1792 194K 288K 78643K 12592 0 0 file desc 5 13K 25K 78643K 16534 0 0 sigio 1 0K 0K 78643K 270 0 0 proc 42 38K 70K 78643K 2722 0 0 subproc 64 65538K 67586K 78643K 150 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 2409 0 0 in_multi 33 2K 2K 78643K 832 0 0 ether_multi 1 0K 0K 78643K 127 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 162 715K 715K 78643K 162 0 0 exec 0 0K 1K 78643K 1287 0 0 pfkey data 0 0K 0K 78643K 8 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 140 23K 43K 78643K 53190 0 0 UVM aobj 130 4K 4K 78643K 145 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 435 0 0 NDP 14 0K 0K 78643K 280 0 0 temp 184 2363K 2437K 78643K 45810 0 0 kqueue 0 0K 0K 78643K 175 0 0 SYN cache 2 16K 16K 78643K 2 0 0 ddb{0}> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle arp 64 4 0 0 1 0 1 1 0 8 0 inpcbpl 280 7540 0 7531 1 0 1 1 0 8 0 plimitpl 152 179 0 172 1 0 1 1 0 8 0 plcache 128 20 0 0 1 0 1 1 0 8 0 rtentry 112 41 0 1 2 0 2 2 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpcb 544 2656 0 2650 1 0 1 1 0 8 0 nd6 48 4 0 0 1 0 1 1 0 8 0 ppxss 1128 161 0 161 66 66 0 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 186 0 0 12 0 12 12 0 8 0 art_table 32 187 0 0 2 0 2 2 0 8 0 art_node 16 40 0 6 1 0 1 1 0 8 0 sysvmsgpl 40 18 0 11 1 0 1 1 0 8 0 semupl 112 2 0 2 2 2 0 1 0 8 0 semapl 112 1659 0 1649 1 0 1 1 0 8 0 shmpl 112 143 0 15 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 33610 0 31854 60 3 57 57 0 8 0 ffsino 272 33610 0 31854 121 3 118 118 0 8 0 nchpl 144 57649 0 56052 61 1 60 60 0 8 0 uvmvnodes 72 5926 0 0 108 0 108 108 0 8 0 vnodes 200 5926 0 0 312 0 312 312 0 8 0 namei 1024 180366 0 180365 3 2 1 1 0 8 0 percpumem 16 30 0 0 1 0 1 1 0 8 0 scsiplug 64 53 0 53 37 37 0 1 0 8 0 scxspl 192 154959 0 154959 57 56 1 6 0 8 1 sigapl 432 16708 0 16695 2 0 2 2 0 8 0 futexpl 56 217847 0 217847 2 1 1 1 0 8 1 knotepl 112 4219 0 4192 25 24 1 2 0 8 0 kqueuepl 104 5437 0 5435 1 0 1 1 0 8 0 pipepl 112 10916 0 10897 41 40 1 2 0 8 0 fdescpl 488 16709 0 16695 3 1 2 3 0 8 0 filepl 152 104955 0 104857 54 49 5 7 0 8 1 lockfpl 96 5154 0 5154 36 35 1 1 0 8 1 lockfspl 24 8578 0 8578 34 33 1 1 0 8 1 sessionpl 112 24 0 14 1 0 1 1 0 8 0 pgrppl 48 179 0 169 1 0 1 1 0 8 0 ucredpl 96 34205 0 34198 1 0 1 1 0 8 0 zombiepl 144 16695 0 16695 3 2 1 1 0 8 1 processpl 840 16724 0 16695 4 0 4 4 0 8 0 procpl 600 51861 0 51820 4 0 4 4 0 8 0 sosppl 128 391 0 391 70 69 1 1 0 8 1 sockpl 384 15520 0 15501 44 41 3 4 0 8 0 mcl64k 65536 2200 0 0 172 120 52 66 0 8 1 mcl16k 16384 26 0 0 4 2 2 3 0 8 0 mcl12k 12288 105 0 0 2 0 2 2 0 8 0 mcl9k 9216 41 0 0 2 0 2 2 0 8 0 mcl8k 8192 30 0 0 4 1 3 3 0 8 0 mcl4k 4096 57 0 0 5 2 3 3 0 8 0 mcl2k2 2112 9 0 0 1 0 1 1 0 8 0 mcl2k 2048 183 0 0 13 5 8 13 0 8 0 mtagpl 80 2 0 0 1 0 1 1 0 8 0 mbufpl 256 2294 0 0 41 6 35 35 0 8 0 bufpl 256 32399 0 25430 436 0 436 436 0 8 0 anonpl 16 1753568 0 1745775 586 538 48 56 0 125 10 amapchunkpl 152 112362 0 112260 472 448 24 97 0 158 19 amappl16 192 103337 0 102945 648 620 28 33 0 8 8 amappl15 184 1 0 0 1 0 1 1 0 8 0 amappl14 176 6 0 4 2 1 1 1 0 8 0 amappl13 168 8278 0 8274 1 0 1 1 0 8 0 amappl12 160 13 0 13 4 4 0 1 0 8 0 amappl11 152 186 0 176 1 0 1 1 0 8 0 amappl10 144 71 0 68 2 1 1 1 0 8 0 amappl9 136 350 0 349 1 0 1 1 0 8 0 amappl8 128 372 0 287 3 0 3 3 0 8 0 amappl7 120 8280 0 8275 1 0 1 1 0 8 0 amappl6 112 56 0 48 1 0 1 1 0 8 0 amappl5 104 257 0 244 1 0 1 1 0 8 0 amappl4 96 8686 0 8660 2 1 1 2 0 8 0 amappl3 88 1885 0 1879 1 0 1 1 0 8 0 amappl2 80 167115 0 167064 2 0 2 2 0 8 0 amappl1 72 360976 0 360549 24 14 10 19 0 8 0 amappl 72 52326 0 52288 1 0 1 1 0 75 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 dma64 64 259 0 259 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 144 0 15 3 0 3 3 0 8 0 uaddrrnd 24 16709 0 16695 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 16709 0 16695 1 0 1 1 0 8 0 vmmpekpl 168 145708 0 145685 2 0 2 2 0 8 0 vmmpepl 168 1745364 0 1743943 464 387 77 77 0 357 9 vmsppl 360 16708 0 16695 2 0 2 2 0 8 0 pdppl 4096 33425 0 33390 6 1 5 6 0 8 0 pvpl 32 4380774 0 4369897 1045 918 127 145 0 265 34 pmappl 224 16708 0 16695 1 0 1 1 0 8 0 extentpl 40 39 0 25 1 0 1 1 0 8 0 phpool 112 824 0 144 20 0 20 20 0 8 0