panic: amap_pp_adjref: negative reference count Stopped at db_enter+0x25: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 445534 58893 32767 0x10 0x4000000 1 syz-executor db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff8351dae9) at panic+0x1e5 sys/kern/subr_prf.c:198 amap_pp_adjref(fffff9805f662488,0,1,ffffffff) at amap_pp_adjref+0x74c sys/uvm/uvm_amap.c:883 amap_adjref_anons(fffff9805f662488,0,1,ffffffff,0) at amap_adjref_anons+0x22d sys/uvm/uvm_amap.c:1301 uvm_unmap_detach(ffff80003c4242e0,0) at uvm_unmap_detach+0x8a sys/uvm/uvm_map.c:1359 uvm_map_teardown(fffff98073ca73f0) at uvm_map_teardown+0x360 sys/uvm/uvm_map.c:2536 exit1(ffff800032f962b8,ff,0,1) at exit1+0x71b sys/kern/kern_exit.c:260 sys_exit(ffff800032f962b8,ffff80003c4244b0,ffff80003c424400) at sys_exit+0x1a sys/kern/kern_exit.c:-1 syscall(ffff80003c4244b0) at syscall+0xb17 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff80003c4244b0) at syscall+0xb17 sys/arch/amd64/amd64/trap.c:791 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x71c025c86780, 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(ffffffff8351dae9) at panic+0x1e5 sys/kern/subr_prf.c:198 amap_pp_adjref(fffff9805f662488,0,1,ffffffff) at amap_pp_adjref+0x74c sys/uvm/uvm_amap.c:883 amap_adjref_anons(fffff9805f662488,0,1,ffffffff,0) at amap_adjref_anons+0x22d sys/uvm/uvm_amap.c:1301 uvm_unmap_detach(ffff80003c4242e0,0) at uvm_unmap_detach+0x8a sys/uvm/uvm_map.c:1359 uvm_map_teardown(fffff98073ca73f0) at uvm_map_teardown+0x360 sys/uvm/uvm_map.c:2536 exit1(ffff800032f962b8,ff,0,1) at exit1+0x71b sys/kern/kern_exit.c:260 sys_exit(ffff800032f962b8,ffff80003c4244b0,ffff80003c424400) at sys_exit+0x1a sys/kern/kern_exit.c:-1 syscall(ffff80003c4244b0) at syscall+0xb17 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff80003c4244b0) at syscall+0xb17 sys/arch/amd64/amd64/trap.c:791 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x71c025c86780, count: -10 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff80003c424080 rbx 0xffffffff838d9e07 cpu_info_full_primary+0x2e07 rdx 0 rcx 0xffff800032f962b8 rax 0xffffffff838d8ff0 cpu_info_full_primary+0x1ff0 r8 0x101010101010101 r9 0x8080808080808080 r10 0x861fa8184c85dbe2 r11 0x3114527dbd50abaf r12 0xffffffff838d9c08 cpu_info_full_primary+0x2c08 r13 0 r14 0 r15 0x1 rip 0xffffffff81dd8715 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff80003c424070 ss 0x10 db_enter+0x25: addq $0x8,%rsp ddb{0}> show proc PROC (sshd-auth) tid=78824 pid=59704 tcnt=0 stat=onproc flags process=110001a proc=2000 runpri=62, usrpri=62, slppri=36, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=1 forw=0xffffffffffffffff, list=0xffff800032f96d18,0xffff800032f96a90 process=0xffff800045fe5360 user=0xffff80003c41f000, vmspace=0xfffff98073ca73f0 estcpu=12, cpticks=4, pctcpu=0.1, user=0, sys=1, intr=0 ddb{0}> ps PID TID PPID UID S PRLAGS PFLAGS WAIT COMMAND 58893 184500 14498 32767 2 0x10 0 syz-executor 58893 445534 14498 32767 7 0x10 0x4000000 syz-executor 58893 174026 14498 32767 3 0x10 0x4000080 fsleep syz-executor 75280 41842 9470 27 2 0x1100012 0 sshd-auth 7020 127863 40883 32767 2 0x10 0 syz-executor 7020 312098 40883 32767 3 0x10 0x4000080 fsleep syz-executor 7020 193501 40883 32767 2 0x10 0x4000000 syz-executor 57909 426558 91561 0 2 0x2 0 sshd-session 93483 434607 98754 32767 2 0x10 0 syz-executor 93483 405936 98754 32767 3 0x10 0x4000080 fsleep syz-executor 1720 486042 27413 32767 2 0x10 0 syz-executor 9470 322488 91561 0 2 0x2 0 sshd-session 75703 74179 66395 32767 2 0x10 0 syz-executor 75703 503580 66395 32767 3 0x10 0x4000080 fsleep syz-executor 75703 335512 66395 32767 2 0x10 0x4000000 syz-executor 79293 377410 89330 32767 2 0x10 0 syz-executor 79293 437100 89330 32767 3 0x10 0x4000080 fsleep syz-executor 94815 132529 85849 32767 2 0x10 0 syz-executor 94815 313464 85849 32767 3 0x10 0x4000080 piperd syz-executor 45178 255184 4419 32767 2 0x10 0 syz-executor 98754 455559 17980 32767 2 0x10 0 syz-executor 14498 514953 48658 32767 3 0x10 0x80 nanoslp syz-executor 40883 504052 5142 32767 3 0x10 0x80 nanoslp syz-executor 27413 49780 65408 32767 3 0x10 0x80 nanoslp syz-executor 66395 72828 6173 32767 3 0x10 0x80 nanoslp syz-executor 85849 100265 99575 32767 3 0x10 0x80 nanoslp syz-executor 4419 494379 5493 32767 2 0x10 0 syz-executor 89330 421685 49461 32767 2 0x10 0 syz-executor 48658 161035 63819 0 3 0x2 0x80 wait syz-executor 17980 433588 63819 0 3 0x2 0x80 wait syz-executor 5142 350657 63819 0 3 0x2 0x80 wait syz-executor 6173 422715 63819 0 3 0x2 0x80 wait syz-executor 65408 73046 63819 0 3 0x2 0x80 wait syz-executor 99575 58252 63819 0 3 0x2 0x80 wait syz-executor 49461 5954 63819 0 3 0x2 0x80 wait syz-executor 5493 95926 63819 0 3 0x2 0x80 wait syz-executor 63819 46583 54713 0 3 0x2 0x80 kqread syz-executor 54713 471859 70033 0 3 0x100002 0x88 sigsusp ksh 70033 386769 35809 0 3 0x10 0x88 kqread sshd-session 35809 248198 91561 0 3 0x12 0x80 kqread sshd-session 95203 201766 1 0 3 0x100003 0x80 ttyin getty 91561 361060 1 0 3 0 0x88 kqread sshd 42179 498996 41542 73 3 0x1100010 0x80 kqread syslogd 41542 455648 1 0 3 0x100002 0x80 sbwait syslogd 25597 382909 1 0 3 0x100000 0x80 kqread resolvd 30033 359373 51366 77 3 0x100012 0x80 kqread dhcpleased 1978 406047 51366 77 3 0x100012 0x80 kqread dhcpleased 51366 512776 1 0 3 0 0x80 kqread dhcpleased 16004 108561 0 0 3 0x14000 0x200 bored smr 42551 324170 0 0 2 0x14000 0x200 zerothread 67544 187925 0 0 3 0x14000 0x200 aiodoned aiodoned 78005 203862 0 0 3 0x14000 0x200 syncer update 66686 18889 0 0 3 0x14000 0x200 cleaner cleaner 49287 124183 0 0 3 0x14000 0x200 reaper reaper 76015 312378 0 0 3 0x14000 0x200 pgdaemon pagedaemon 44693 187948 0 0 3 0x14000 0x200 bored viomb 6950 32467 0 0 3 0x14000 0x40000200 acpi0 acpi0 22928 409797 0 0 3 0x14000 0x40000200 idle1 95443 228430 0 0 3 0x14000 0x200 bored softnet1 60660 51398 0 0 3 0x14000 0x200 bored softnet0 53887 128693 0 0 3 0x14000 0x200 bored systqmp 10847 448023 0 0 3 0x14000 0x200 bored systq 84414 13253 0 0 3 0x14000 0x200 tmoslp softclockmp 39974 287567 0 0 2 0x14000 0x40000200 softclock 22765 395602 0 0 3 0x14000 0x40000200 idle0 1 9694 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 11053 12018K 12034K 166960K 12144 0 pcb 17 12K 12K 166960K 17 0 rtable 239 6K 7K 166960K 359 0 pf 31 16K 16K 166960K 31 0 ifaddr 42 7K 7K 166960K 44 0 ifgroup 50 2K 2K 166960K 50 0 sysctl 1 1K 9K 166960K 5 0 counters 70 37K 37K 166960K 70 0 ioctlops 0 0K 4K 166960K 31 0 iov 1 1K 1K 166960K 1 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1287 81K 81K 166960K 1385 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 3 5K 5K 166960K 3 0 VM map 2 1K 1K 166960K 2 0 sem 4 0K 0K 166960K 5 0 dirhash 12 2K 2K 166960K 15 0 ACPI 1734 201K 291K 166960K 11964 0 file desc 26 97K 117K 166960K 178 0 sigio 0 0K 0K 166960K 3 0 proc 58 99K 131K 166960K 497 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 0 0K 0K 166960K 1 0 in_multi 99 6K 6K 166960K 99 0 ether_multi 1 0K 0K 166960K 1 0 mrt 0 0K 0K 166960K 2 0 ISOFS mount 1 32K 32K 166960K 1 0 MSDOSFS mount 1 16K 16K 166960K 1 0 ttys 79 360K 360K 166960K 79 0 exec 0 0K 1K 166960K 442 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 286 202K 202K 166960K 3412 0 UVM aobj 4 2K 2K 166960K 4 0 pinsyscall 53 106K 110K 166960K 1328 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 ip6_options 0 0K 0K 166960K 1 0 NDP 18 1K 2K 166960K 27 0 temp 34 9118K 9124K 166960K 3947 0 kqueue 15 24K 28K 166960K 37 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 40 0 37 1 0 1 1 0 8 0 rtentry 176 112 0 1 6 0 6 6 0 8 0 unpcb 144 77 0 55 1 0 1 1 0 8 0 syncache 336 8 0 8 1 0 1 1 0 8 1 tcpqe 32 1 0 1 1 0 1 1 0 8 1 tcpcb 736 27 0 21 1 0 1 1 0 8 0 arp 136 18 0 0 1 0 1 1 0 8 0 ipq 40 1 0 0 1 0 1 1 0 8 0 ipqe 40 2 0 0 1 0 1 1 0 8 0 inpcb 328 99 0 90 2 0 2 2 0 8 0 nd6 152 25 0 0 1 0 1 1 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 465 0 0 30 0 30 30 0 8 0 art_table 40 466 0 0 5 0 5 5 0 8 0 art_node 32 112 0 11 1 0 1 1 0 8 0 semupl 112 1 0 1 1 0 1 1 0 8 1 semapl 72 3 0 1 1 0 1 1 0 8 0 shmpl 112 1 0 0 1 0 1 1 0 8 0 dirhash 1024 19 0 2 3 0 3 3 0 8 0 dino2pl 256 1635 0 173 92 0 92 92 0 8 0 ffsino 296 1635 0 173 113 0 113 113 0 8 0 nchpl 144 1876 0 185 63 0 63 63 0 8 0 vnodes 216 1716 0 0 96 0 96 96 0 8 0 namei 1024 5743 0 5743 2 0 2 2 0 8 2 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 6526 0 6526 4 3 1 3 1 8 1 plimitpl 152 46 0 21 2 0 2 2 0 8 1 sigapl 424 487 0 429 7 0 7 7 0 8 0 knotepl 120 147 0 0 5 0 5 5 0 8 0 kqueuepl 224 37 0 24 2 0 2 2 0 8 0 pipepl 344 133 0 103 3 0 3 3 0 8 0 fdescpl 528 471 0 430 3 0 3 3 0 8 0 filepl 160 1813 0 1583 12 0 12 12 0 8 2 lockfpl 104 10 0 8 1 0 1 1 0 8 0 lockfspl 48 6 0 4 1 0 1 1 0 8 0 sessionpl 144 27 0 9 1 0 1 1 0 8 0 pgrppl 48 36 0 10 1 0 1 1 0 8 0 ucredpl 104 257 0 236 1 0 1 1 0 8 0 zombiepl 144 430 0 429 1 0 1 1 0 8 0 processpl 1232 487 0 429 5 0 5 5 0 8 0 procpl 664 550 0 483 6 0 6 6 0 8 0 sockpl 752 217 0 181 5 0 5 5 0 8 0 mcl64k 65536 2 0 0 1 0 1 1 0 8 0 mcl16k 16384 3 0 0 1 0 1 1 0 8 0 mcl8k 8192 1 0 0 1 0 1 1 0 8 0 mcl4k 4096 124 0 0 16 0 16 16 0 8 0 mcl2k 2048 16 0 0 2 0 2 2 0 8 0 mextrefs 64 21 0 0 1 0 1 1 0 8 0 mtagpl 96 4 0 0 1 0 1 1 0 8 0 mbufpl 256 236 0 0 15 0 15 15 0 8 0 bufpl 272 2411 0 102 154 0 154 154 0 8 0 anonpl 32 4229 0 0 35 0 35 35 0 247 0 amapchunkpl 152 9056 0 8471 24 0 24 24 0 158 1 amappl16 200 1336 0 1299 4 0 4 4 0 8 2 amappl15 192 2 0 2 1 0 1 1 0 8 1 amappl14 184 427 0 426 1 0 1 1 0 8 0 amappl13 176 126 0 111 1 0 1 1 0 8 0 amappl12 168 710 0 670 2 0 2 2 0 8 0 amappl11 160 11 0 11 1 0 1 1 0 8 1 amappl10 152 60 0 50 1 0 1 1 0 8 0 amappl9 144 266 0 266 1 0 1 1 0 8 1 amappl8 136 97 0 96 1 0 1 1 0 8 0 amappl7 128 147 0 132 1 0 1 1 0 8 0 amappl6 120 146 0 145 1 0 1 1 0 8 0 amappl5 112 112 0 101 1 0 1 1 0 8 0 amappl4 104 287 0 272 1 0 1 1 0 8 0 amappl3 96 1574 0 1461 4 1 3 3 0 8 0 amappl2 88 646 0 545 3 0 3 3 0 8 0 amappl1 80 12256 0 11356 19 0 19 19 0 8 0 amappl 88 2659 0 2462 5 0 5 5 0 92 0 uvmvnodes 80 97 0 0 2 0 2 2 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 3 0 0 1 0 1 1 0 8 0 uaddrrnd 24 471 0 430 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 471 0 430 1 0 1 1 0 8 0 vmmpekpl 168 6476 0 6439 2 0 2 2 0 8 0 vmmpepl 168 42055 0 39444 115 0 115 115 0 357 0 vmsppl 488 470 0 429 7 1 6 6 0 8 0 rwobjpl 80 15823 0 14489 28 0 28 28 0 8 0 pdppl 4096 949 0 858 107 14 93 93 0 8 2 pvpl 32 13177 0 0 107 0 107 107 0 265 0 pmappl 256 470 0 429 4 1 3 3 0 8 0 extentpl 40 46 0 28 1 0 1 1 0 8 0 phpool 112 434 0 17 12 0 12 12 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(ffffffff8351dae9) at panic+0x1e5 sys/kern/subr_prf.c:198 amap_pp_adjref(fffff9805f662488,0,1,ffffffff) at amap_pp_adjref+0x74c sys/uvm/uvm_amap.c:883 amap_adjref_anons(fffff9805f662488,0,1,ffffffff,0) at amap_adjref_anons+0x22d sys/uvm/uvm_amap.c:1301 uvm_unmap_detach(ffff80003c4242e0,0) at uvm_unmap_detach+0x8a sys/uvm/uvm_map.c:1359 uvm_map_teardown(fffff98073ca73f0) at uvm_map_teardown+0x360 sys/uvm/uvm_map.c:2536 exit1(ffff800032f962b8,ff,0,1) at exit1+0x71b sys/kern/kern_exit.c:260 sys_exit(ffff800032f962b8,ffff80003c4244b0,ffff80003c424400) at sys_exit+0x1a sys/kern/kern_exit.c:-1 syscall(ffff80003c4244b0) at syscall+0xb17 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff80003c4244b0) at syscall+0xb17 sys/arch/amd64/amd64/trap.c:791 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x71c025c86780, count: -10 ddb{0}> machine ddbcpu 1 Stopped at x86_ipi_db+0x27: addq $0x8,%rsp x86_ipi_db(ffff80002999dff0) at x86_ipi_db+0x27 sys/arch/amd64/amd64/db_interface.c:394 x86_ipi_handler() at x86_ipi_handler+0xd9 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x27 __mp_lock(ffffffff839f3740) at __mp_lock+0x192 __mp_lock_spin sys/kern/kern_lock.c:142 [inline] __mp_lock(ffffffff839f3740) at __mp_lock+0x192 sys/kern/kern_lock.c:173 syscall(ffff80003c43e460) at syscall+0xaf4 mi_syscall sys/sys/syscall_mi.h:175 [inline] syscall(ffff80003c43e460) at syscall+0xaf4 sys/arch/amd64/amd64/trap.c:791 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa56a4e606f0, count: 9 ddb{1}> trace x86_ipi_db(ffff80002999dff0) at x86_ipi_db+0x27 sys/arch/amd64/amd64/db_interface.c:394 x86_ipi_handler() at x86_ipi_handler+0xd9 sys/arch/amd64/amd64/ipi.c:106 Xresume_lapic_ipi() at Xresume_lapic_ipi+0x27 __mp_lock(ffffffff839f3740) at __mp_lock+0x192 __mp_lock_spin sys/kern/kern_lock.c:142 [inline] __mp_lock(ffffffff839f3740) at __mp_lock+0x192 sys/kern/kern_lock.c:173 syscall(ffff80003c43e460) at syscall+0xaf4 mi_syscall sys/sys/syscall_mi.h:175 [inline] syscall(ffff80003c43e460) at syscall+0xaf4 sys/arch/amd64/amd64/trap.c:791 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xa56a4e606f0, count: -6