panic: malloc: out of space in kmem_map Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *272014 23711 0 0x2 0 0 syz-executor.0 db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:398 panic() at panic+0x15c sys/kern/subr_prf.c:208 malloc(200000,2a,9) at malloc+0xa79 sys/kern/kern_malloc.c:242 kcovioctl(1b1300,80084b01,ffff8000149c3ec0,3,ffff8000149e6e30) at kcovioctl+0xe6 kd_init sys/dev/kcov.c:405 [inline] kcovioctl(1b1300,80084b01,ffff8000149c3ec0,3,ffff8000149e6e30) at kcovioctl+0xe6 sys/dev/kcov.c:298 VOP_IOCTL(fffffd802fd09d60,80084b01,ffff8000149c3ec0,3,fffffd803f7c6780,ffff8000149e6e30) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:290 vn_ioctl(fffffd802f467628,80084b01,ffff8000149c3ec0,ffff8000149e6e30) at vn_ioctl+0xc9 sys/kern/vfs_vnops.c:512 sys_ioctl(ffff8000149e6e30,ffff8000149c4000,ffff8000149c3ff0) at sys_ioctl+0x638 syscall(ffff8000149c40a0) at syscall+0x541 Xsyscall(6,36,7f7fffff8138,36,3,2878699f890) at Xsyscall+0x128 end of kernel end trace frame: 0x7f7fffff7c50, count: 6 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 malloc: out of space in kmem_map 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:208 malloc(200000,2a,9) at malloc+0xa79 sys/kern/kern_malloc.c:242 kcovioctl(1b1300,80084b01,ffff8000149c3ec0,3,ffff8000149e6e30) at kcovioctl+0xe6 kd_init sys/dev/kcov.c:405 [inline] kcovioctl(1b1300,80084b01,ffff8000149c3ec0,3,ffff8000149e6e30) at kcovioctl+0xe6 sys/dev/kcov.c:298 VOP_IOCTL(fffffd802fd09d60,80084b01,ffff8000149c3ec0,3,fffffd803f7c6780,ffff8000149e6e30) at VOP_IOCTL+0x9a sys/kern/vfs_vops.c:290 vn_ioctl(fffffd802f467628,80084b01,ffff8000149c3ec0,ffff8000149e6e30) at vn_ioctl+0xc9 sys/kern/vfs_vnops.c:512 sys_ioctl(ffff8000149e6e30,ffff8000149c4000,ffff8000149c3ff0) at sys_ioctl+0x638 syscall(ffff8000149c40a0) at syscall+0x541 Xsyscall(6,36,7f7fffff8138,36,3,2878699f890) at Xsyscall+0x128 end of kernel end trace frame: 0x7f7fffff7c50, count: -9 ddb> show registers rdi 0 rsi 0x1 rbp 0xffff8000149c3af0 rbx 0xffff8000149c3ba0 rdx 0x2 rcx 0 rax 0 r8 0xffff8000149c3ab0 r9 0x1 r10 0 r11 0xc0f73ce21cdc2bff r12 0x3000000008 r13 0xffff8000149c3b00 r14 0x100 r15 0x1 rip 0xffffffff81d46eb8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000149c3ae0 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (syz-executor.0) pid=272014 stat=onproc flags process=2 proc=0 pri=51, usrpri=51, nice=20 forw=0xffffffffffffffff, list=0xffff8000ffff8e18,0xffffffff822b8800 process=0xffff800014953a58 user=0xffff8000149bf000, vmspace=0xfffffd803f014738 estcpu=1, cpticks=3, pctcpu=0.0 user=0, sys=3, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND *23711 272014 50742 0 7 0x2 syz-executor.0 34837 311258 50742 0 3 0x82 piperd syz-executor.1 97210 314846 1 0 3 0x100083 ttyin getty 53865 428298 0 0 3 0x14200 bored sosplice 50742 328061 30050 0 3 0x82 kqread syz-fuzzer 50742 246331 30050 0 3 0x4000082 thrsleep syz-fuzzer 50742 10706 30050 0 3 0x4000082 thrsleep syz-fuzzer 50742 65725 30050 0 3 0x4000082 thrsleep syz-fuzzer 50742 209053 30050 0 3 0x4000082 thrsleep syz-fuzzer 50742 89407 30050 0 3 0x4000082 thrsleep syz-fuzzer 50742 277597 30050 0 3 0x4000082 thrsleep syz-fuzzer 50742 249445 30050 0 3 0x4000082 thrsleep syz-fuzzer 30050 229433 17859 0 3 0x10008a pause ksh 17859 417527 6660 0 3 0x92 select sshd 6660 78048 1 0 3 0x80 select sshd 2488 484670 58421 73 3 0x100090 kqread syslogd 58421 327997 1 0 3 0x100082 netio syslogd 48181 56771 1 77 3 0x100090 poll dhclient 39597 477563 1 0 3 0x80 poll dhclient 31568 522629 0 0 3 0x14200 pgzero zerothread 34621 140556 0 0 3 0x14200 aiodoned aiodoned 77573 323901 0 0 3 0x14200 syncer update 71280 482329 0 0 3 0x14200 cleaner cleaner 88700 224050 0 0 3 0x14200 reaper reaper 13677 71554 0 0 3 0x14200 pgdaemon pagedaemon 57411 424545 0 0 3 0x14200 bored crynlk 43829 314483 0 0 3 0x14200 bored crypto 86030 437180 0 0 3 0x40014200 acpi0 acpi0 84127 10782 0 0 3 0x14200 bored softnet 28745 428348 0 0 3 0x14200 bored systqmp 88350 107068 0 0 3 0x14200 bored systq 58673 245372 0 0 3 0x40014200 bored softclock 17776 77934 0 0 3 0x40014200 idle0 1702 14173 0 0 3 0x14200 bored smr 1 144171 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb> show all locks No such command ddb> show malloc Type InUse MemUse HighUse Limit Requests Type Lim Kern Lim devbuf 9544 71900K 71900K 78643K 12085 0 0 pcb 23 9K 10K 78643K 1971 0 0 rtable 88 3K 4K 78643K 2644 0 0 ifaddr 64 16K 19K 78643K 807 0 0 counters 19 16K 16K 78643K 19 0 0 ioctlops 0 0K 2K 78643K 123 0 0 iov 0 0K 24K 78643K 510 0 0 mount 1 1K 1K 78643K 1 0 0 vnodes 1188 74K 76K 78643K 3762 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 49 0 0 VM map 2 0K 0K 78643K 2 0 0 sem 12 0K 0K 78643K 521 0 0 dirhash 12 2K 2K 78643K 12 0 0 ACPI 1793 195K 288K 78643K 12537 0 0 file desc 4 9K 25K 78643K 4239 0 0 sigio 0 0K 0K 78643K 86 0 0 proc 42 30K 54K 78643K 1761 0 0 subproc 53 55297K 69634K 78643K 1870 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 431 0 0 in_multi 22 1K 2K 78643K 725 0 0 ether_multi 1 0K 0K 78643K 24 0 0 mrt 0 0K 0K 78643K 4 0 0 ISOFS mount 1 32K 32K 78643K 1 0 0 MSDOSFS mount 1 16K 16K 78643K 1 0 0 ttys 108 477K 477K 78643K 108 0 0 exec 0 0K 1K 78643K 708 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 81 12K 39K 78643K 10939 0 0 UVM aobj 130 7K 8K 78643K 144 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 143 0 0 NDP 15 0K 0K 78643K 287 0 0 temp 186 2359K 2487K 78643K 18501 0 0 kqueue 0 0K 0K 78643K 22 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 56 0 53 1 0 1 1 0 8 0 inpcbpl 280 1789 0 1782 2 1 1 2 0 8 0 plimitpl 152 171 0 164 1 0 1 1 0 8 0 rtentry 112 515 0 484 2 0 2 2 0 8 0 syncache 264 4 0 4 1 1 0 1 0 8 0 tcpcb 544 586 0 582 1 0 1 1 0 8 0 nd6 48 108 0 106 1 0 1 1 0 8 0 ppxss 1128 91 0 91 20 20 0 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 2379 0 2232 12 0 12 12 0 8 0 art_table 32 2380 0 2232 2 0 2 2 0 8 0 art_node 16 508 0 480 1 0 1 1 0 8 0 sysvmsgpl 40 65 0 42 1 0 1 1 0 8 0 semapl 112 519 0 509 1 0 1 1 0 8 0 shmpl 112 142 0 14 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino1pl 128 8849 0 7284 51 0 51 51 0 8 0 ffsino 240 8849 0 7284 93 0 93 93 0 8 0 nchpl 144 15991 0 14252 65 0 65 65 0 8 0 uvmvnodes 72 6967 0 0 127 0 127 127 0 8 0 vnodes 200 6967 0 0 367 0 367 367 0 8 0 namei 1024 48589 0 48589 4 3 1 1 0 8 1 scsiplug 64 9 0 9 9 8 1 1 0 8 1 scxspl 192 59802 0 59802 27 23 4 6 0 8 4 sigapl 432 4254 0 4242 2 0 2 2 0 8 0 futexpl 56 74319 0 74319 4 3 1 1 0 8 1 knotepl 112 1751 0 1730 1 0 1 1 0 8 0 kqueuepl 104 904 0 902 1 0 1 1 0 8 0 pipepl 112 2322 0 2303 4 3 1 2 0 8 0 fdescpl 424 4255 0 4242 2 0 2 2 0 8 0 filepl 120 25569 0 25481 9 5 4 5 0 8 1 lockfpl 104 1155 0 1155 11 10 1 1 0 8 1 lockfspl 32 1401 0 1401 10 9 1 1 0 8 1 sessionpl 112 73 0 64 1 0 1 1 0 8 0 pgrppl 48 109 0 100 1 0 1 1 0 8 0 ucredpl 96 5461 0 5454 1 0 1 1 0 8 0 zombiepl 144 4242 0 4242 2 1 1 1 0 8 1 processpl 840 4270 0 4242 4 0 4 4 0 8 0 procpl 600 9237 0 9202 5 1 4 4 0 8 0 sosppl 128 60 0 60 17 16 1 1 0 8 1 sockpl 384 3487 0 3470 10 7 3 3 0 8 1 mcl64k 65536 1938 0 1938 170 169 1 47 0 8 1 mcl16k 16384 12 0 12 10 9 1 1 0 8 1 mcl12k 12288 80 0 80 19 18 1 1 0 8 1 mcl9k 9216 62 0 62 19 19 0 1 0 8 0 mcl8k 8192 49 0 49 23 22 1 1 0 8 1 mcl4k 4096 195 0 195 14 13 1 1 0 8 1 mcl2k2 2112 19 0 19 10 10 0 1 0 8 0 mcl2k 2048 53626 0 53589 19 13 6 12 0 8 0 mtagpl 80 2 0 2 1 1 0 1 0 8 0 mbufpl 256 113204 0 113129 116 107 9 29 0 8 1 bufpl 256 18082 0 11114 436 0 436 436 0 8 0 anonpl 16 478316 0 471145 170 128 42 54 0 62 2 amapchunkpl 152 19808 0 19731 55 50 5 15 0 158 1 amappl16 192 24091 0 23615 216 189 27 42 0 8 2 amappl15 184 1363 0 1359 1 0 1 1 0 8 0 amappl14 176 864 0 863 2 1 1 1 0 8 0 amappl13 168 570 0 567 1 0 1 1 0 8 0 amappl12 160 671 0 668 1 0 1 1 0 8 0 amappl11 152 1200 0 1189 1 0 1 1 0 8 0 amappl10 144 362 0 359 2 1 1 1 0 8 0 amappl9 136 1449 0 1445 1 0 1 1 0 8 0 amappl8 128 1000 0 979 1 0 1 1 0 8 0 amappl7 120 336 0 330 1 0 1 1 0 8 0 amappl6 112 285 0 275 1 0 1 1 0 8 0 amappl5 104 355 0 343 1 0 1 1 0 8 0 amappl4 96 4118 0 4094 2 1 1 2 0 8 0 amappl3 88 1603 0 1596 1 0 1 1 0 8 0 amappl2 80 36695 0 36651 2 0 2 2 0 8 0 amappl1 72 88072 0 87672 25 15 10 19 0 8 0 amappl 72 9821 0 9792 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 143 0 14 3 0 3 3 0 8 0 uaddrrnd 24 4255 0 4242 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 4255 0 4242 1 0 1 1 0 8 0 vmmpekpl 168 29477 0 29457 2 0 2 2 0 8 0 vmmpepl 168 462619 0 461306 235 155 80 85 0 357 11 vmsppl 264 4254 0 4242 8 7 1 2 0 8 0 pdppl 4096 8516 0 8484 6 1 5 6 0 8 0 pvpl 32 1498967 0 1488754 513 358 155 243 0 265 53 pmappl 192 4254 0 4242 1 0 1 1 0 8 0 extentpl 40 39 0 25 1 0 1 1 0 8 0 phpool 112 910 0 339 21 3 18 18 0 8 0