panic: amap_pp_adjref: negative reference count Stopped at db_enter+0x25: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 179787 90650 32767 0x10 0 0 syz-executor db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff83529389) at panic+0x1e5 sys/kern/subr_prf.c:198 amap_pp_adjref(fffffa007bddbcc8,0,1,ffffffff) at amap_pp_adjref+0x74c sys/uvm/uvm_amap.c:883 amap_adjref_anons(fffffa007bddbcc8,0,1,ffffffff,0) at amap_adjref_anons+0x22d sys/uvm/uvm_amap.c:1301 uvm_unmap_detach(ffff80002a367fa0,0) at uvm_unmap_detach+0x8a sys/uvm/uvm_map.c:1359 uvm_map_teardown(fffffa006d04cd80) at uvm_map_teardown+0x360 sys/uvm/uvm_map.c:2536 exit1(ffff800045fe9a10,0,0,1) at exit1+0x71b sys/kern/kern_exit.c:260 sys_exit(ffff800045fe9a10,ffff80002a368170,ffff80002a3680c0) at sys_exit+0x1a sys/kern/kern_exit.c:-1 syscall(ffff80002a368170) at syscall+0xb17 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff80002a368170) at syscall+0xb17 sys/arch/amd64/amd64/trap.c:791 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x72db1f255810, 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{1}> ddb{1}> set $lines = 0 ddb{1}> set $maxwidth = 0 ddb{1}> show panic *cpu1: amap_pp_adjref: negative reference count ddb{1}> show kasan No such command ddb{1}> trace db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff83529389) at panic+0x1e5 sys/kern/subr_prf.c:198 amap_pp_adjref(fffffa007bddbcc8,0,1,ffffffff) at amap_pp_adjref+0x74c sys/uvm/uvm_amap.c:883 amap_adjref_anons(fffffa007bddbcc8,0,1,ffffffff,0) at amap_adjref_anons+0x22d sys/uvm/uvm_amap.c:1301 uvm_unmap_detach(ffff80002a367fa0,0) at uvm_unmap_detach+0x8a sys/uvm/uvm_map.c:1359 uvm_map_teardown(fffffa006d04cd80) at uvm_map_teardown+0x360 sys/uvm/uvm_map.c:2536 exit1(ffff800045fe9a10,0,0,1) at exit1+0x71b sys/kern/kern_exit.c:260 sys_exit(ffff800045fe9a10,ffff80002a368170,ffff80002a3680c0) at sys_exit+0x1a sys/kern/kern_exit.c:-1 syscall(ffff80002a368170) at syscall+0xb17 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff80002a368170) at syscall+0xb17 sys/arch/amd64/amd64/trap.c:791 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x72db1f255810, count: -10 ddb{1}> show registers rdi 0 rsi 0x1 rbp 0xffff80002a367d40 rbx 0xffff80002999ee0f rdx 0 rcx 0xffff800045fe9a10 rax 0xffff80002999dff0 r8 0x101010101010101 r9 0x8080808080808080 r10 0x76bedee7a3432770 r11 0xe903be652bad1779 r12 0xffff80002999ec10 r13 0 r14 0 r15 0x1 rip 0xffffffff82b92cc5 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff80002a367d30 ss 0x10 db_enter+0x25: addq $0x8,%rsp ddb{1}> show proc PROC (ndp) tid=491867 pid=20747 tcnt=0 stat=onproc flags process=10000a proc=2000 runpri=86, usrpri=86, slppri=32, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=1 forw=0xffffffffffffffff, list=0xffff800045fe9ca8,0xffff800045fe9258 process=0xffff800045fec9b8 user=0xffff80002a363000, vmspace=0xfffffa006d04cd80 estcpu=36, cpticks=1, pctcpu=0.0, user=0, sys=0, intr=0 ddb{1}> ps PID TID PPID UID S PRLAGS PFLAGS WAIT COMMAND 90650 179787 85580 32767 7 0x10 0 syz-executor 90650 142790 85580 32767 2 0x10 0x4000000 syz-executor 2981 490458 11992 32767 2 0x10 0 syz-executor 50194 498579 60234 0 3 0x100002 0x88 sigsusp sh 96441 379347 42910 0 3 0x2 0 clonelk ifconfig 42910 378042 15348 0 3 0x100002 0x88 sigsusp sh 15348 490553 28285 0 3 0 0x80 wait syz-executor 28285 224022 69762 0 3 0x2 0x80 wait syz-executor 70844 487942 20841 0 3 0 0 clonelk syz-executor 20841 465863 69762 0 3 0x2 0x80 wait syz-executor 31632 169104 7128 0 3 0 0 clonelk syz-executor 7128 79818 69762 0 3 0x2 0x80 wait syz-executor 60234 176708 73746 0 3 0 0x80 wait syz-executor 73746 30508 69762 0 3 0x2 0x80 wait syz-executor 78487 393257 91825 32767 2 0x10 0 syz-executor 91825 479922 69762 0 3 0x2 0x80 wait syz-executor 96875 281626 69762 0 3 0x2 0x80 wait syz-executor 11992 362921 16619 32767 3 0x10 0x80 nanoslp syz-executor 16619 348833 69762 0 3 0x2 0x80 wait syz-executor 85580 382157 91697 32767 3 0x10 0x80 nanoslp syz-executor 91697 304899 69762 0 3 0x2 0x80 wait syz-executor 69762 123383 97207 0 3 0x2 0x80 kqread syz-executor 97207 277780 68916 0 3 0x100002 0x88 sigsusp ksh 68916 434122 10388 0 3 0x10 0x88 kqread sshd-session 10388 385669 15270 0 3 0x12 0x80 kqread sshd-session 23036 488802 1 0 3 0x100003 0x80 ttyin getty 15270 88732 1 0 3 0 0x88 kqread sshd 10444 376661 74812 73 3 0x1100010 0x80 kqread syslogd 74812 506844 1 0 3 0x100002 0x80 sbwait syslogd 32515 477687 1 0 3 0x100000 0x80 kqread resolvd 49322 61730 9686 77 3 0x100012 0x80 kqread dhcpleased 49133 7208 9686 77 3 0x100012 0x80 kqread dhcpleased 9686 162375 1 0 3 0 0x80 kqread dhcpleased 78795 116356 0 0 3 0x14000 0x200 bored smr 81458 505593 0 0 2 0x14000 0x200 zerothread 86282 458404 0 0 3 0x14000 0x200 aiodoned aiodoned 8449 48083 0 0 3 0x14000 0x200 syncer update 73410 96100 0 0 3 0x14000 0x200 cleaner cleaner 99226 61385 0 0 3 0x14000 0x200 reaper reaper 23039 30575 0 0 3 0x14000 0x200 pgdaemon pagedaemon 43478 377677 0 0 3 0x14000 0x200 bored viomb 66777 411820 0 0 3 0x14000 0x40000200 acpi0 acpi0 27281 170438 0 0 3 0x14000 0x40000200 idle1 91923 253245 0 0 3 0x14000 0x200 bored softnet1 23191 216604 0 0 3 0x14000 0x200 bored softnet0 81453 489830 0 0 3 0x14000 0x200 smrbar systqmp 60303 241520 0 0 3 0x14000 0x200 bored systq 3360 34566 0 0 3 0x14000 0x200 tmoslp softclockmp 83495 414807 0 0 3 0x14000 0x40000200 tmoslp softclock 6742 313747 0 0 3 0x14000 0x40000200 idle0 1 397088 0 0 3 0x2 0x80 wait init 0 0 -1 0 3 0x10000 0x200 scheduler swapper ddb{1}> show all locks Process 78487 (syz-executor) thread 0xffff800045fe87e8 (393257) exclusive rrwlock inode r = 0 (0xfffffa000e029580) #0 witness_lock+0x5f1 stacktrace_save sys/sys/stacktrace.h:37 [inline] #0 witness_lock+0x5f1 sys/kern/subr_witness.c:1160 #1 rw_do_enter_write+0x419 sys/kern/kern_rwlock.c:320 #2 rrw_enter+0xc6 sys/kern/kern_rwlock.c:621 #3 VOP_LOCK+0xbd sys/kern/vfs_vops.c:527 #4 vn_lock+0xa4 sys/kern/vfs_vnops.c:576 #5 vget+0x2a2 sys/kern/vfs_subr.c:692 #6 ufs_ihashget+0x185 sys/ufs/ufs/ufs_ihash.c:98 #7 ffs_vget+0x8c sys/ufs/ffs/ffs_vfsops.c:1203 #8 ufs_lookup+0x1a36 sys/ufs/ufs/ufs_lookup.c:478 #9 VOP_LOOKUP+0x6e sys/kern/vfs_vops.c:85 #10 vfs_lookup+0x9e3 sys/kern/vfs_lookup.c:585 #11 namei+0x7c1 sys/kern/vfs_lookup.c:250 #12 dounlinkat+0xc1 sys/kern/vfs_syscalls.c:1807 #13 syscall+0xb17 mi_syscall sys/sys/syscall_mi.h:176 [inline] #13 syscall+0xb17 sys/arch/amd64/amd64/trap.c:791 #14 Xsyscall+0x128 exclusive rrwlock inode r = 0 (0xfffffa006a13aed0) #0 witness_lock+0x5f1 stacktrace_save sys/sys/stacktrace.h:37 [inline] #0 witness_lock+0x5f1 sys/kern/subr_witness.c:1160 #1 rw_do_enter_write+0x419 sys/kern/kern_rwlock.c:320 #2 rrw_enter+0xc6 sys/kern/kern_rwlock.c:621 #3 VOP_LOCK+0xbd sys/kern/vfs_vops.c:527 #4 vn_lock+0xa4 sys/kern/vfs_vnops.c:576 #5 vfs_lookup+0x12b sys/kern/vfs_lookup.c:431 #6 namei+0x7c1 sys/kern/vfs_lookup.c:250 #7 dounlinkat+0xc1 sys/kern/vfs_syscalls.c:1807 #8 syscall+0xb17 mi_syscall sys/sys/syscall_mi.h:176 [inline] #8 syscall+0xb17 sys/arch/amd64/amd64/trap.c:791 #9 Xsyscall+0x128 Process 81453 (systqmp) thread 0xffff800045ffe000 (489830) shared rwlock systqmp r = 0 (0xffffffff8392e138) #0 witness_lock+0x5f1 stacktrace_save sys/sys/stacktrace.h:37 [inline] #0 witness_lock+0x5f1 sys/kern/subr_witness.c:1160 #1 taskq_thread+0x12a sys/kern/kern_task.c:442 #2 proc_trampoline+0x10 ddb{1}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 11045 12012K 12034K 166960K 12232 0 pcb 17 12K 12K 166960K 17 0 rtable 173 5K 7K 166960K 1242 0 pf 25 16K 16K 166960K 89 0 ifaddr 30 5K 7K 166960K 164 0 ifgroup 38 1K 2K 166960K 166 0 sysctl 3 1K 9K 166960K 8 0 counters 64 36K 37K 166960K 128 0 ioctlops 0 0K 4K 166960K 69 0 iov 0 0K 14K 166960K 18 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1288 81K 81K 166960K 1726 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 2 1K 5K 166960K 12 0 VM map 2 1K 1K 166960K 2 0 sem 27 2K 3K 166960K 39 0 dirhash 12 2K 2K 166960K 15 0 ACPI 1692 195K 286K 166960K 12470 0 file desc 23 85K 121K 166960K 961 0 sigio 0 0K 0K 166960K 10 0 proc 65 115K 163K 166960K 1377 0 subproc 72 4K 4K 166960K 360 0 NFS srvsock 1 0K 0K 166960K 1 0 NFS daemon 1 16K 16K 166960K 1 0 ip_moptions 0 0K 0K 166960K 139 0 in_multi 66 4K 6K 166960K 430 0 ether_multi 1 0K 0K 166960K 4 0 mrt 1 0K 0K 166960K 14 0 ISOFS mount 1 32K 32K 166960K 1 0 MSDOSFS mount 1 16K 16K 166960K 1 0 ttys 85 387K 387K 166960K 85 0 exec 0 0K 1K 166960K 812 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 200 161K 197K 166960K 8900 0 UVM aobj 81 3K 3K 166960K 82 0 pinsyscall 44 88K 111K 166960K 2897 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 ip6_options 0 0K 0K 166960K 26 0 NDP 18 1K 2K 166960K 114 0 temp 75 9128K 9184K 166960K 8015 0 kqueue 13 20K 30K 166960K 123 0 SYN cache 2 16K 16K 166960K 2 0 ddb{1}> 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 120 0 117 1 0 1 1 0 8 0 rtentry 176 432 0 354 6 0 6 6 0 8 2 unpcb 144 560 0 545 6 0 6 6 0 8 5 syncache 336 11 0 11 1 0 1 1 0 8 1 tcpqe 32 3 0 3 1 0 1 1 0 8 1 tcpcb 736 162 0 156 4 0 4 4 0 8 3 arp 136 76 0 64 1 0 1 1 0 8 0 ipq 40 3 0 0 1 0 1 1 0 8 0 ipqe 40 6 0 0 1 0 1 1 0 8 0 inpcb 328 671 0 661 7 1 6 7 0 8 4 nd6 152 113 0 97 1 0 1 1 0 8 0 kcovpl 48 40 0 32 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 1747 0 1364 32 2 30 32 0 8 5 art_table 40 1748 0 1364 6 0 6 6 0 8 1 art_node 32 432 0 348 1 0 1 1 0 8 0 sysvmsgpl 40 5 0 3 1 0 1 1 0 8 0 semupl 112 1 0 1 1 1 0 1 0 8 0 semapl 72 34 0 9 1 0 1 1 0 8 0 shmpl 120 79 0 1 3 0 3 3 0 8 0 dirhash 1024 19 0 2 3 0 3 3 0 8 0 dino2pl 256 2151 0 608 97 0 97 97 0 8 0 ffsino 296 2151 0 608 119 0 119 119 0 8 0 nchpl 144 2839 0 1055 67 0 67 67 0 8 0 vnodes 216 2520 0 0 140 0 140 140 0 8 0 namei 1024 14019 0 14019 3 2 1 2 0 8 1 percpumem 16 80 0 32 1 0 1 1 0 8 0 kstatmem 264 83 0 64 2 0 2 2 0 8 0 scxspl 216 9761 0 9761 4 3 1 3 1 8 1 plimitpl 152 288 0 264 2 0 2 2 0 8 0 sigapl 424 1210 0 1158 7 0 7 7 0 8 0 knotepl 120 292 0 0 9 0 9 9 0 8 0 kqueuepl 224 122 0 113 1 0 1 1 0 8 0 pipepl 344 251 0 224 3 0 3 3 0 8 0 fdescpl 528 1194 0 1159 3 0 3 3 0 8 0 filepl 160 5209 0 5006 15 0 15 15 0 8 5 lockfpl 104 151 0 149 1 0 1 1 0 8 0 lockfspl 48 34 0 32 1 0 1 1 0 8 0 sessionpl 144 77 0 61 1 0 1 1 0 8 0 pgrppl 48 120 0 96 1 0 1 1 0 8 0 ucredpl 104 833 0 818 1 0 1 1 0 8 0 zombiepl 144 1160 0 1158 1 0 1 1 0 8 0 processpl 1232 1210 0 1158 5 0 5 5 0 8 0 procpl 664 1826 0 1773 7 0 7 7 0 8 1 sosppl 176 6 0 6 2 1 1 1 0 8 1 sockpl 752 1353 0 1325 18 6 12 17 0 8 8 mcl64k 65536 6 0 0 1 0 1 1 0 8 0 mcl16k 16384 2 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 125 0 0 16 0 16 16 0 8 0 mcl2k 2048 20 0 0 3 0 3 3 0 8 0 mextrefs 64 18 0 0 1 0 1 1 0 8 0 mtagpl 96 3 0 0 1 0 1 1 0 8 0 mbufpl 256 1190 0 0 75 0 75 75 0 8 0 bufpl 272 3060 0 102 198 0 198 198 0 8 0 anonpl 32 5574 0 0 45 0 45 45 0 247 0 amapchunkpl 152 26351 0 25979 35 0 35 35 0 158 17 amappl16 200 1928 0 1918 6 2 4 5 0 8 3 amappl15 192 4 0 4 1 1 0 1 0 8 0 amappl14 184 771 0 768 1 0 1 1 0 8 0 amappl13 176 193 0 182 1 0 1 1 0 8 0 amappl12 168 1555 0 1526 2 0 2 2 0 8 0 amappl11 160 5 0 5 1 1 0 1 0 8 0 amappl10 152 61 0 51 1 0 1 1 0 8 0 amappl9 144 303 0 302 1 0 1 1 0 8 0 amappl8 136 214 0 212 1 0 1 1 0 8 0 amappl7 128 227 0 214 1 0 1 1 0 8 0 amappl6 120 466 0 461 1 0 1 1 0 8 0 amappl5 112 111 0 104 1 0 1 1 0 8 0 amappl4 104 381 0 365 1 0 1 1 0 8 0 amappl3 96 4665 0 4591 5 1 4 4 0 8 0 amappl2 88 1283 0 1211 3 0 3 3 0 8 0 amappl1 80 18351 0 17762 16 0 16 16 0 8 0 amappl 88 7565 0 7435 5 0 5 5 0 92 1 uvmvnodes 80 111 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 81 0 1 2 0 2 2 0 8 0 uaddrrnd 24 1194 0 1159 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 1194 0 1159 1 0 1 1 0 8 0 vmmpekpl 168 11710 0 11647 4 0 4 4 0 8 0 vmmpepl 168 87511 0 85632 102 0 102 102 0 357 9 vmsppl 488 1193 0 1158 7 1 6 6 0 8 0 rwobjpl 80 27283 0 26250 26 0 26 26 0 8 1 pdppl 4096 2395 0 2316 137 46 91 95 0 8 12 pvpl 32 14638 0 0 121 2 119 119 0 265 0 pmappl 256 1193 0 1158 4 1 3 3 0 8 0 extentpl 40 45 0 27 1 0 1 1 0 8 0 phpool 112 580 0 53 16 0 16 16 0 8 0 ddb{1}> machine ddbcpu 0 Stopped at x86_ipi_db+0x27: addq $0x8,%rsp x86_ipi_db(ffffffff83999ff0) 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 end of kernel end trace frame: 0x7ca6f96c2140, count: 12 ddb{0}> trace x86_ipi_db(ffffffff83999ff0) 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 end of kernel end trace frame: 0x7ca6f96c2140, count: -3 ddb{0}> machine ddbcpu 1 Stopped at db_enter+0x25: addq $0x8,%rsp db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff83529389) at panic+0x1e5 sys/kern/subr_prf.c:198 amap_pp_adjref(fffffa007bddbcc8,0,1,ffffffff) at amap_pp_adjref+0x74c sys/uvm/uvm_amap.c:883 amap_adjref_anons(fffffa007bddbcc8,0,1,ffffffff,0) at amap_adjref_anons+0x22d sys/uvm/uvm_amap.c:1301 uvm_unmap_detach(ffff80002a367fa0,0) at uvm_unmap_detach+0x8a sys/uvm/uvm_map.c:1359 uvm_map_teardown(fffffa006d04cd80) at uvm_map_teardown+0x360 sys/uvm/uvm_map.c:2536 exit1(ffff800045fe9a10,0,0,1) at exit1+0x71b sys/kern/kern_exit.c:260 sys_exit(ffff800045fe9a10,ffff80002a368170,ffff80002a3680c0) at sys_exit+0x1a sys/kern/kern_exit.c:-1 syscall(ffff80002a368170) at syscall+0xb17 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff80002a368170) at syscall+0xb17 sys/arch/amd64/amd64/trap.c:791 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x72db1f255810, count: 5 ddb{1}> trace db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff83529389) at panic+0x1e5 sys/kern/subr_prf.c:198 amap_pp_adjref(fffffa007bddbcc8,0,1,ffffffff) at amap_pp_adjref+0x74c sys/uvm/uvm_amap.c:883 amap_adjref_anons(fffffa007bddbcc8,0,1,ffffffff,0) at amap_adjref_anons+0x22d sys/uvm/uvm_amap.c:1301 uvm_unmap_detach(ffff80002a367fa0,0) at uvm_unmap_detach+0x8a sys/uvm/uvm_map.c:1359 uvm_map_teardown(fffffa006d04cd80) at uvm_map_teardown+0x360 sys/uvm/uvm_map.c:2536 exit1(ffff800045fe9a10,0,0,1) at exit1+0x71b sys/kern/kern_exit.c:260 sys_exit(ffff800045fe9a10,ffff80002a368170,ffff80002a3680c0) at sys_exit+0x1a sys/kern/kern_exit.c:-1 syscall(ffff80002a368170) at syscall+0xb17 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff80002a368170) at syscall+0xb17 sys/arch/amd64/amd64/trap.c:791 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x72db1f255810, count: -10