panic: amap_pp_adjref: negative reference count Stopped at db_enter+0x25: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 358266 58228 32767 0x10 0 1 syz-executor db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff83520558) at panic+0x1e5 sys/kern/subr_prf.c:198 amap_pp_adjref(fffff6805fc06858,0,2,ffffffff) at amap_pp_adjref+0x74c sys/uvm/uvm_amap.c:880 amap_adjref_anons(fffff6805fc06858,0,2,ffffffff,0) at amap_adjref_anons+0x22d sys/uvm/uvm_amap.c:1298 uvm_unmap_detach(ffff80003c3faf20,0) at uvm_unmap_detach+0x8a sys/uvm/uvm_map.c:1359 uvm_map_teardown(fffff6806d05ed80) at uvm_map_teardown+0x360 sys/uvm/uvm_map.c:2536 exit1(ffff800045fee548,ff,0,1) at exit1+0x71b sys/kern/kern_exit.c:260 sys_exit(ffff800045fee548,ffff80003c3fb0f0,ffff80003c3fb040) at sys_exit+0x1a sys/kern/kern_exit.c:-1 syscall(ffff80003c3fb0f0) at syscall+0xb17 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff80003c3fb0f0) at syscall+0xb17 sys/arch/amd64/amd64/trap.c:783 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7670221526c0, count: 5 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}> set $maxwidth = 0 ddb{0}> show panic *cpu0: amap_pp_adjref: negative reference count ddb{0}> show kasan No such command ddb{0}> trace db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff83520558) at panic+0x1e5 sys/kern/subr_prf.c:198 amap_pp_adjref(fffff6805fc06858,0,2,ffffffff) at amap_pp_adjref+0x74c sys/uvm/uvm_amap.c:880 amap_adjref_anons(fffff6805fc06858,0,2,ffffffff,0) at amap_adjref_anons+0x22d sys/uvm/uvm_amap.c:1298 uvm_unmap_detach(ffff80003c3faf20,0) at uvm_unmap_detach+0x8a sys/uvm/uvm_map.c:1359 uvm_map_teardown(fffff6806d05ed80) at uvm_map_teardown+0x360 sys/uvm/uvm_map.c:2536 exit1(ffff800045fee548,ff,0,1) at exit1+0x71b sys/kern/kern_exit.c:260 sys_exit(ffff800045fee548,ffff80003c3fb0f0,ffff80003c3fb040) at sys_exit+0x1a sys/kern/kern_exit.c:-1 syscall(ffff80003c3fb0f0) at syscall+0xb17 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff80003c3fb0f0) at syscall+0xb17 sys/arch/amd64/amd64/trap.c:783 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7670221526c0, count: -10 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff80003c3facc0 rbx 0xffffffff8399ae07 cpu_info_full_primary+0x2e07 rdx 0 rcx 0xffff800045fee548 rax 0xffffffff83999ff0 cpu_info_full_primary+0x1ff0 r8 0x101010101010101 r9 0x8080808080808080 r10 0xb5f78a2ddf785138 r11 0xc2b48fdb5fa1c75c r12 0xffffffff8399ac08 cpu_info_full_primary+0x2c08 r13 0 r14 0 r15 0x1 rip 0xffffffff81fe16f5 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff80003c3facb0 ss 0x10 db_enter+0x25: addq $0x8,%rsp ddb{0}> show proc PROC (sshd-session) tid=119547 pid=99672 tcnt=0 stat=onproc flags process=a proc=2000 runpri=32, usrpri=58, slppri=32, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=1 forw=0xffffffffffffffff, list=0xffff800045fef240,0xffff80003a3b8560 process=0xffff800036f99830 user=0xffff80003c3f6000, vmspace=0xfffff6806d05ed80 estcpu=8, cpticks=5, pctcpu=0.0, user=0, sys=1, intr=0 ddb{0}> ps PID TID PPID UID S PRLAGS PFLAGS WAIT COMMAND 61253 214646 30843 32767 2 0x10 0 syz-executor 61253 198496 30843 32767 3 0x10 0x4000080 kqsel syz-executor 2840 465583 48735 32767 2 0x10 0 syz-executor 2840 54088 48735 32767 3 0x10 0x4000080 kqread syz-executor 60082 395734 34548 32767 2 0x10 0 syz-executor 60082 142417 34548 32767 3 0x10 0x4000080 kqread syz-executor 60082 356657 34548 32767 2 0x10 0x4000000 syz-executor 64770 118756 67157 32767 2 0x10 0xc80 syz-executor 64770 391023 67157 32767 3 0x10 0x4000080 kqsel syz-executor 64770 245635 67157 32767 3 0x10 0x4000080 fsleep syz-executor 77710 478421 91066 32767 3 0x10 0x80 nanoslp syz-executor 77710 499945 91066 32767 3 0x10 0x4000080 kqsel syz-executor 77710 412663 91066 32767 3 0x10 0x4000080 fsleep syz-executor 88288 427854 28791 32767 2 0x10 0 syz-executor 88288 454472 28791 32767 3 0x10 0x4000080 ttyout syz-executor 88288 281677 28791 32767 2 0x10 0x4000000 syz-executor 32295 62959 58228 32767 2 0x10 0xc80 syz-executor 32295 3749 58228 32767 3 0x10 0x4000080 sbwait syz-executor 32295 403213 58228 32767 3 0x10 0x4000080 fsleep syz-executor 26963 384630 62058 32767 2 0x10 0xc80 syz-executor 26963 490654 62058 32767 3 0x10 0x4000080 lockf syz-executor 26963 161749 62058 32767 3 0x10 0x4000080 fsleep syz-executor 26963 126863 62058 32767 3 0x10 0x4000080 fsleep syz-executor 62058 147496 83810 32767 2 0x10 0xc80 syz-executor 28791 261286 13102 32767 2 0x10 0 syz-executor 91066 51141 44795 32767 2 0x10 0xc80 syz-executor 34548 204423 36017 32767 2 0x10 0 syz-executor 48735 333177 67688 32767 2 0x10 0xc80 syz-executor 67157 9816 27933 32767 2 0x10 0xc80 syz-executor 58228 358266 43314 32767 7 0x10 0 syz-executor 30843 260847 33957 32767 3 0x10 0x80 nanoslp syz-executor 27933 246917 46820 0 3 0x2 0x80 wait syz-executor 43314 131698 46820 0 3 0x2 0x80 wait syz-executor 36017 304653 46820 0 3 0x2 0x80 wait syz-executor 33957 329780 46820 0 3 0x2 0x80 wait syz-executor 13102 186610 46820 0 3 0x2 0x80 wait syz-executor 83810 170769 46820 0 3 0x2 0x80 wait syz-executor 67688 154140 46820 0 3 0x2 0x80 wait syz-executor 44795 419640 46820 0 3 0x2 0x80 wait syz-executor 46820 125180 95645 0 3 0x2 0x80 kqread syz-executor 95645 343227 2989 0 3 0x100002 0x88 sigsusp ksh 2989 332215 38288 0 3 0x10 0x88 kqread sshd-session 38288 209799 68002 0 3 0x12 0x80 kqread sshd-session 19338 136348 1 0 3 0x100003 0x80 ttyin getty 68002 229868 1 0 3 0 0x88 kqread sshd 40542 133749 29115 73 3 0x1100010 0x80 kqread syslogd 29115 496001 1 0 3 0x100002 0x80 sbwait syslogd 62852 421437 1 0 3 0x100000 0x80 kqread resolvd 22991 387870 38298 77 3 0x100012 0x80 kqread dhcpleased 33327 384748 38298 77 3 0x100012 0x80 kqread dhcpleased 38298 98331 1 0 3 0 0x80 kqread dhcpleased 36822 85400 0 0 3 0x14000 0x200 bored smr 46009 196205 0 0 2 0x14000 0x200 zerothread 98999 471377 0 0 3 0x14000 0x200 aiodoned aiodoned 30451 81401 0 0 3 0x14000 0x200 syncer update 52716 473728 0 0 3 0x14000 0x200 cleaner cleaner 92499 347635 0 0 3 0x14000 0x200 reaper reaper 15141 418693 0 0 3 0x14000 0x200 pgdaemon pagedaemon 93367 332634 0 0 3 0x14000 0x200 bored viomb 38471 240878 0 0 3 0x14000 0x40000200 acpi0 acpi0 54927 110561 0 0 3 0x14000 0x40000200 idle1 76988 26258 0 0 3 0x14000 0x200 bored softnet1 12399 99851 0 0 3 0x14000 0x200 bored softnet0 37101 323846 0 0 3 0x14000 0x200 bored systqmp 78967 445377 0 0 3 0x14000 0x200 bored systq 14937 5174 0 0 3 0x14000 0x200 tmoslp softclockmp 94042 429038 0 0 3 0x14000 0x40000200 tmoslp softclock 56148 366776 0 0 3 0x14000 0x40000200 idle0 1 294086 0 0 3 0x2 0x80 wait init 0 0 -1 0 3 0x10000 0x200 scheduler swapper ddb{0}> show all locks ddb{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 11076 12021K 12034K 166960K 12168 0 pcb 17 12K 12K 166960K 17 0 rtable 245 7K 7K 166960K 384 0 pf 31 16K 16K 166960K 31 0 ifaddr 42 7K 7K 166960K 44 0 ifgroup 50 2K 2K 166960K 50 0 sysctl 3 1K 9K 166960K 9 0 counters 70 37K 37K 166960K 70 0 ioctlops 0 0K 4K 166960K 103 0 iov 0 0K 12K 166960K 20 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1287 81K 81K 166960K 1562 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 2 1K 5K 166960K 11 0 VM map 2 1K 1K 166960K 2 0 sem 12 0K 1K 166960K 20 0 dirhash 12 2K 2K 166960K 15 0 ACPI 1692 195K 286K 166960K 12470 0 file desc 26 97K 113K 166960K 465 0 sigio 1 0K 0K 166960K 5 0 proc 58 99K 147K 166960K 539 0 subproc 72 4K 4K 166960K 72 0 NFS srvsock 1 0K 0K 166960K 1 0 NFS daemon 1 16K 16K 166960K 1 0 ip_moptions 2 0K 0K 166960K 69 0 in_multi 99 6K 6K 166960K 112 0 ether_multi 1 0K 0K 166960K 2 0 mrt 3 0K 0K 166960K 18 0 ISOFS mount 1 32K 32K 166960K 1 0 MSDOSFS mount 1 16K 16K 166960K 1 0 ttys 217 970K 970K 166960K 217 0 exec 0 0K 1K 166960K 527 0 fusefs mount 1 32K 32K 166960K 1 0 tdb 3 0K 0K 166960K 3 0 VM swap 8 62K 64K 166960K 10 0 UVM amap 278 173K 198K 166960K 6267 0 UVM aobj 13 2K 2K 166960K 15 0 pinsyscall 47 94K 110K 166960K 1655 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 ip6_options 0 0K 0K 166960K 23 0 NDP 11 0K 2K 166960K 27 0 temp 50 9121K 9136K 166960K 4776 0 kqueue 16 24K 28K 166960K 101 0 SYN cache 2 16K 16K 166960K 2 0 ddb{0}> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle plcache 128 28 0 0 1 0 1 1 0 8 0 rtpcb 120 64 0 60 1 0 1 1 0 8 0 rtentry 176 119 0 5 6 0 6 6 0 8 0 unpcb 144 272 0 254 4 0 4 4 0 8 3 syncache 336 13 0 13 1 0 1 1 0 8 1 tcpqe 32 1 0 1 1 0 1 1 0 8 1 tcpcb 736 193 0 183 5 0 5 5 0 8 3 arp 136 18 0 0 1 0 1 1 0 8 0 inpcb 328 532 0 508 5 0 5 5 0 8 2 ip6q 72 1 0 0 1 0 1 1 0 8 0 ip6af 40 1 0 0 1 0 1 1 0 8 0 nd6 152 32 0 4 2 0 2 2 0 8 0 kcovpl 48 8 0 0 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 528 0 45 32 0 32 32 0 8 0 art_table 40 529 0 45 6 0 6 6 0 8 0 art_node 32 119 0 15 1 0 1 1 0 8 0 sysvmsgpl 40 26 0 8 1 0 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 72 17 0 7 1 0 1 1 0 8 0 shmpl 112 12 0 2 1 0 1 1 0 8 0 dirhash 1024 19 0 2 3 0 3 3 0 8 0 dino2pl 256 2206 0 736 92 0 92 92 0 8 0 ffsino 296 2206 0 736 114 0 114 114 0 8 0 nchpl 144 2850 0 1156 63 0 63 63 0 8 0 vnodes 216 2287 0 0 128 0 128 128 0 8 0 namei 1024 9912 0 9912 2 1 1 2 0 8 1 percpumem 16 51 0 0 1 0 1 1 0 8 0 kstatmem 264 25 0 0 2 0 2 2 0 8 0 scxspl 216 9405 0 9405 4 3 1 3 1 8 1 plimitpl 152 152 0 127 2 0 2 2 0 8 1 sigapl 424 782 0 727 7 0 7 7 0 8 0 knotepl 120 285 0 0 9 0 9 9 0 8 0 kqueuepl 224 126 0 111 1 0 1 1 0 8 0 pipepl 344 164 0 137 3 0 3 3 0 8 0 fdescpl 528 766 0 728 3 0 3 3 0 8 0 filepl 160 4782 0 4546 19 2 17 19 0 8 6 lockfpl 104 109 0 104 1 0 1 1 0 8 0 lockfspl 48 46 0 42 1 0 1 1 0 8 0 sessionpl 144 121 0 104 1 0 1 1 0 8 0 pgrppl 48 136 0 111 1 0 1 1 0 8 0 ucredpl 104 1355 0 1336 1 0 1 1 0 8 0 zombiepl 144 728 0 727 1 0 1 1 0 8 0 processpl 1232 782 0 727 5 0 5 5 0 8 0 procpl 664 1365 0 1295 7 0 7 7 0 8 1 sosppl 176 2 0 0 1 0 1 1 0 8 0 sockpl 752 871 0 825 10 0 10 10 0 8 4 mcl64k 65536 4 0 0 1 0 1 1 0 8 0 mcl12k 12288 1 0 0 1 0 1 1 0 8 0 mcl9k128 9344 1 0 0 1 0 1 1 0 8 0 mcl8k 8192 2 0 0 1 0 1 1 0 8 0 mcl4k 4096 118 0 0 15 0 15 15 0 8 0 mcl2k 2048 21 0 0 3 0 3 3 0 8 0 mextrefs 64 18 0 0 1 0 1 1 0 8 0 mtagpl 96 4 0 0 1 0 1 1 0 8 0 mbufpl 256 1209 0 0 76 0 76 76 0 8 0 bufpl 272 3193 0 102 207 0 207 207 0 8 0 anonpl 32 9596 0 0 78 0 78 78 0 247 0 amapchunkpl 152 20409 0 19781 33 0 33 33 0 158 3 amappl16 200 2605 0 2581 18 7 11 15 0 8 8 amappl15 192 10 0 10 1 1 0 1 0 8 0 amappl14 184 415 0 414 1 0 1 1 0 8 0 amappl13 176 137 0 126 1 0 1 1 0 8 0 amappl12 168 1014 0 976 2 0 2 2 0 8 0 amappl11 160 11 0 11 3 2 1 1 0 8 1 amappl10 152 63 0 53 1 0 1 1 0 8 0 amappl9 144 288 0 288 1 1 0 1 0 8 0 amappl8 136 98 0 96 1 0 1 1 0 8 0 amappl7 128 161 0 146 1 0 1 1 0 8 0 amappl6 120 148 0 147 1 0 1 1 0 8 0 amappl5 112 132 0 125 1 0 1 1 0 8 0 amappl4 104 303 0 288 1 0 1 1 0 8 0 amappl3 96 3401 0 3280 5 1 4 4 0 8 0 amappl2 88 1009 0 924 3 0 3 3 0 8 0 amappl1 80 15549 0 14889 20 1 19 19 0 8 1 amappl 88 5410 0 5202 5 0 5 5 0 92 0 uvmvnodes 80 114 0 0 3 0 3 3 0 8 0 dma4096 4096 1 0 1 1 1 0 1 0 8 0 dma1024 1024 1 0 0 1 0 1 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 72 14 0 2 1 0 1 1 0 8 0 uaddrrnd 24 766 0 728 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 766 0 728 1 0 1 1 0 8 0 vmmpekpl 168 9552 0 9520 2 0 2 2 0 8 0 vmmpepl 168 63609 0 61355 116 0 116 116 0 357 11 vmsppl 488 765 0 727 7 1 6 6 0 8 0 rwobjpl 80 22432 0 21330 29 0 29 29 0 8 2 pdppl 4096 1539 0 1454 123 32 91 91 0 8 6 pvpl 32 17178 0 0 140 1 139 139 0 265 0 pmappl 256 765 0 727 4 1 3 3 0 8 0 extentpl 40 45 0 27 1 0 1 1 0 8 0 phpool 112 569 0 36 16 0 16 16 0 8 0 ddb{0}> machine ddbcpu 0 Invalid cpu 0 ddb{0}> trace db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff83520558) at panic+0x1e5 sys/kern/subr_prf.c:198 amap_pp_adjref(fffff6805fc06858,0,2,ffffffff) at amap_pp_adjref+0x74c sys/uvm/uvm_amap.c:880 amap_adjref_anons(fffff6805fc06858,0,2,ffffffff,0) at amap_adjref_anons+0x22d sys/uvm/uvm_amap.c:1298 uvm_unmap_detach(ffff80003c3faf20,0) at uvm_unmap_detach+0x8a sys/uvm/uvm_map.c:1359 uvm_map_teardown(fffff6806d05ed80) at uvm_map_teardown+0x360 sys/uvm/uvm_map.c:2536 exit1(ffff800045fee548,ff,0,1) at exit1+0x71b sys/kern/kern_exit.c:260 sys_exit(ffff800045fee548,ffff80003c3fb0f0,ffff80003c3fb040) at sys_exit+0x1a sys/kern/kern_exit.c:-1 syscall(ffff80003c3fb0f0) at syscall+0xb17 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff80003c3fb0f0) at syscall+0xb17 sys/arch/amd64/amd64/trap.c:783 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7670221526c0, count: -10 ddb{0}> machine ddbcpu 1