panic: amap_pp_adjref: negative reference count Stopped at db_enter+0x25: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 285610 72910 32767 0x10 0 1 syz-executor db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff8351e727) at panic+0x1e5 sys/kern/subr_prf.c:198 amap_pp_adjref(fffffd80610a4918,0,2,ffffffff) at amap_pp_adjref+0x74c sys/uvm/uvm_amap.c:883 amap_adjref_anons(fffffd80610a4918,0,2,ffffffff,0) at amap_adjref_anons+0x22d sys/uvm/uvm_amap.c:1301 uvm_unmap_detach(ffff800039faa8a0,0) at uvm_unmap_detach+0x8a sys/uvm/uvm_map.c:1359 uvm_map_teardown(fffffd800b1cb1e8) at uvm_map_teardown+0x360 sys/uvm/uvm_map.c:2536 exit1(ffff80003c3fe558,0,0,1) at exit1+0x71b sys/kern/kern_exit.c:260 sys_exit(ffff80003c3fe558,ffff800039faaa70,ffff800039faa9c0) at sys_exit+0x1a sys/kern/kern_exit.c:-1 syscall(ffff800039faaa70) at syscall+0xb17 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff800039faaa70) at syscall+0xb17 sys/arch/amd64/amd64/trap.c:791 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7c5c2dcd88d0, 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(ffffffff8351e727) at panic+0x1e5 sys/kern/subr_prf.c:198 amap_pp_adjref(fffffd80610a4918,0,2,ffffffff) at amap_pp_adjref+0x74c sys/uvm/uvm_amap.c:883 amap_adjref_anons(fffffd80610a4918,0,2,ffffffff,0) at amap_adjref_anons+0x22d sys/uvm/uvm_amap.c:1301 uvm_unmap_detach(ffff800039faa8a0,0) at uvm_unmap_detach+0x8a sys/uvm/uvm_map.c:1359 uvm_map_teardown(fffffd800b1cb1e8) at uvm_map_teardown+0x360 sys/uvm/uvm_map.c:2536 exit1(ffff80003c3fe558,0,0,1) at exit1+0x71b sys/kern/kern_exit.c:260 sys_exit(ffff80003c3fe558,ffff800039faaa70,ffff800039faa9c0) at sys_exit+0x1a sys/kern/kern_exit.c:-1 syscall(ffff800039faaa70) at syscall+0xb17 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff800039faaa70) at syscall+0xb17 sys/arch/amd64/amd64/trap.c:791 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7c5c2dcd88d0, count: -10 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff800039faa640 rbx 0xffffffff83934e07 cpu_info_full_primary+0x2e07 rdx 0 rcx 0xffff80003c3fe558 rax 0xffffffff83933ff0 cpu_info_full_primary+0x1ff0 r8 0x101010101010101 r9 0x8080808080808080 r10 0x39c80e56184af180 r11 0xc0b243b6444a0509 r12 0xffffffff83934c08 cpu_info_full_primary+0x2c08 r13 0 r14 0 r15 0x1 rip 0xffffffff814c8705 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff800039faa630 ss 0x10 db_enter+0x25: addq $0x8,%rsp ddb{0}> show proc PROC (ndp) tid=30841 pid=44032 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=0xffff80003c3ff4e8,0xffff80003c3fe038 process=0xffff80003bbd09c0 user=0xffff800039fa5000, vmspace=0xfffffd800b1cb1e8 estcpu=36, cpticks=2, pctcpu=0.0, user=0, sys=0, intr=0 ddb{0}> ps PID TID PPID UID S PRLAGS PFLAGS WAIT COMMAND 33993 494882 36977 32767 2 0x10 0 syz-executor 72910 285610 69255 32767 7 0x10 0 syz-executor 72910 335705 69255 32767 2 0x10 0x4000080 syz-executor 29522 302441 55639 32767 3 0x10 0x80 nanoslp syz-executor 29522 269648 55639 32767 3 0x10 0x4000088 kqsel syz-executor 29522 436085 55639 32767 3 0x10 0x4000080 fsleep syz-executor 29065 249830 91238 0 2 0x2 0 ndp 20602 499483 86188 0 3 0x100002 0x88 sigsusp sh 91238 83818 77822 0 3 0x100002 0x88 sigsusp sh 36977 401361 29198 32767 3 0x10 0x80 nanoslp syz-executor 29198 221586 67301 0 3 0x2 0x80 wait syz-executor 86188 354263 43495 0 3 0 0x80 wait syz-executor 43495 354610 67301 0 3 0x2 0x80 wait syz-executor 77822 514269 44629 0 3 0 0x80 wait syz-executor 44629 138588 67301 0 3 0x2 0x80 wait syz-executor 55639 370564 86460 32767 3 0x10 0x80 nanoslp syz-executor 86460 451380 67301 0 3 0x2 0x80 wait syz-executor 5844 199019 67301 0 3 0x2 0x80 wait syz-executor 57981 443333 91247 32767 3 0x10 0x80 nanoslp syz-executor 91247 320996 67301 0 3 0x2 0x80 wait syz-executor 69255 280326 92559 32767 3 0x10 0x80 nanoslp syz-executor 4941 443421 67301 0 3 0x2 0x80 wait syz-executor 92559 80585 67301 0 3 0x2 0x80 wait syz-executor 67301 126100 41729 0 3 0x2 0x80 kqread syz-executor 41729 417969 59726 0 3 0x100002 0x88 sigsusp ksh 59726 79600 75467 0 3 0x10 0x88 kqread sshd-session 75467 494721 63096 0 3 0x12 0x80 kqread sshd-session 67712 343915 1 0 3 0x100003 0x80 ttyin getty 63096 140245 1 0 3 0 0x88 kqread sshd 98912 225446 84343 73 3 0x1100010 0x80 kqread syslogd 84343 508355 1 0 3 0x100002 0x80 sbwait syslogd 45962 99898 1 0 3 0x100000 0x80 kqread resolvd 70327 447103 52474 77 3 0x100012 0x80 kqread dhcpleased 52311 407070 52474 77 3 0x100012 0x80 kqread dhcpleased 52474 183217 1 0 3 0 0x80 kqread dhcpleased 75999 143187 0 0 3 0x14000 0x200 bored smr 33448 147060 0 0 2 0x14000 0x200 zerothread 85296 390631 0 0 3 0x14000 0x200 aiodoned aiodoned 45563 210844 0 0 3 0x14000 0x200 syncer update 62675 463900 0 0 3 0x14000 0x200 cleaner cleaner 22723 273348 0 0 3 0x14000 0x200 reaper reaper 48327 109293 0 0 3 0x14000 0x200 pgdaemon pagedaemon 79684 224299 0 0 3 0x14000 0x200 bored viomb 40946 441916 0 0 3 0x14000 0x40000200 acpi0 acpi0 51873 520301 0 0 3 0x14000 0x40000200 idle1 25546 67096 0 0 3 0x14000 0x200 bored softnet1 12975 47505 0 0 3 0x14000 0x200 bored softnet0 54819 5235 0 0 3 0x14000 0x200 smrbar systqmp 18953 378327 0 0 3 0x14000 0x200 bored systq 87178 160706 0 0 3 0x14000 0x200 tmoslp softclockmp 95866 342678 0 0 3 0x14000 0x40000200 tmoslp softclock 69543 106156 0 0 3 0x14000 0x40000200 idle0 1 99562 0 0 3 0x2 0x80 wait init 0 0 -1 0 3 0x10000 0x200 scheduler swapper ddb{0}> show all locks Process 54819 (systqmp) thread 0xffff800045ffe530 (5235) shared rwlock systqmp r = 0 (0xffffffff8399a6f8) #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{0}> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 11052 12018K 12034K 166960K 12185 0 pcb 17 12K 12K 166960K 17 0 rtable 235 6K 7K 166960K 767 0 pf 31 16K 16K 166960K 59 0 ifaddr 42 7K 7K 166960K 102 0 ifgroup 50 2K 2K 166960K 106 0 sysctl 3 1K 9K 166960K 8 0 counters 70 37K 37K 166960K 98 0 ioctlops 0 0K 4K 166960K 47 0 iov 0 0K 14K 166960K 12 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1287 81K 81K 166960K 1524 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 2 1K 5K 166960K 5 0 VM map 2 1K 1K 166960K 2 0 sem 20 2K 2K 166960K 24 0 dirhash 12 2K 2K 166960K 15 0 ACPI 1692 195K 286K 166960K 12470 0 file desc 25 93K 125K 166960K 514 0 sigio 0 0K 0K 166960K 3 0 proc 58 99K 163K 166960K 920 0 subproc 72 4K 4K 166960K 198 0 NFS srvsock 1 0K 0K 166960K 1 0 NFS daemon 1 16K 16K 166960K 1 0 ip_moptions 0 0K 0K 166960K 75 0 in_multi 99 6K 6K 166960K 254 0 ether_multi 1 0K 0K 166960K 1 0 mrt 0 0K 0K 166960K 8 0 ISOFS mount 1 32K 32K 166960K 1 0 MSDOSFS mount 1 16K 16K 166960K 1 0 ttys 73 334K 334K 166960K 73 0 exec 0 0K 1K 166960K 608 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 235 171K 179K 166960K 5442 0 UVM aobj 8 2K 2K 166960K 9 0 pinsyscall 46 92K 110K 166960K 1947 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 ip6_options 2 0K 0K 166960K 15 0 NDP 19 1K 2K 166960K 69 0 temp 39 9119K 9139K 166960K 5953 0 kqueue 13 20K 28K 166960K 60 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 74 0 71 1 0 1 1 0 8 0 rtentry 176 265 0 156 6 0 6 6 0 8 0 unpcb 144 119 0 104 1 0 1 1 0 8 0 syncache 336 5 0 5 1 0 1 1 0 8 1 tcpcb 736 103 0 99 4 0 4 4 0 8 3 arp 136 46 0 28 1 0 1 1 0 8 0 ipq 40 4 0 1 1 0 1 1 0 8 0 ipqe 40 5 0 2 1 0 1 1 0 8 0 inpcb 328 383 0 375 7 0 7 7 0 8 6 nd6 152 66 0 43 1 0 1 1 0 8 0 kcovpl 48 22 0 14 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 1072 0 618 32 0 32 32 0 8 0 art_table 40 1073 0 618 6 0 6 6 0 8 0 art_node 32 265 0 163 1 0 1 1 0 8 0 sysvmsgpl 40 1 0 1 1 0 1 1 0 8 1 semupl 112 4 0 4 1 0 1 1 0 8 1 semapl 72 20 0 2 1 0 1 1 0 8 0 shmpl 112 6 0 1 1 0 1 1 0 8 0 dirhash 1024 19 0 2 3 0 3 3 0 8 0 dino2pl 256 1825 0 327 94 0 94 94 0 8 0 ffsino 296 1825 0 327 116 0 116 116 0 8 0 nchpl 144 2225 0 496 65 0 65 65 0 8 0 vnodes 216 2032 0 0 113 0 113 113 0 8 0 namei 1024 9581 0 9581 3 0 3 3 0 8 3 percpumem 16 65 0 14 1 0 1 1 0 8 0 kstatmem 264 53 0 28 2 0 2 2 0 8 0 scxspl 216 7541 0 7541 6 2 4 4 1 8 4 plimitpl 152 159 0 133 2 0 2 2 0 8 0 sigapl 424 775 0 721 7 0 7 7 0 8 0 knotepl 120 104 0 0 4 0 4 4 0 8 0 kqueuepl 224 161 0 150 5 0 5 5 0 8 4 pipepl 344 173 0 146 3 0 3 3 0 8 0 fdescpl 528 759 0 722 4 0 4 4 0 8 0 filepl 160 3079 0 2872 13 0 13 13 0 8 2 lockfpl 104 51 0 49 1 0 1 1 0 8 0 lockfspl 48 20 0 18 1 0 1 1 0 8 0 sessionpl 144 47 0 31 1 0 1 1 0 8 0 pgrppl 48 70 0 46 1 0 1 1 0 8 0 ucredpl 104 461 0 444 1 0 1 1 0 8 0 zombiepl 144 725 0 721 1 0 1 1 0 8 0 processpl 1232 775 0 721 5 0 5 5 0 8 0 procpl 664 1051 0 994 7 0 7 7 0 8 0 sosppl 176 2 0 2 1 0 1 1 0 8 1 sockpl 752 579 0 553 10 0 10 10 0 8 6 mcl64k 65536 3 0 0 1 0 1 1 0 8 0 mcl16k 16384 2 0 0 1 0 1 1 0 8 0 mcl8k 8192 2 0 0 1 0 1 1 0 8 0 mcl4k 4096 126 0 0 16 0 16 16 0 8 0 mcl2k2 2112 1 0 0 1 0 1 1 0 8 0 mcl2k 2048 28 0 0 4 0 4 4 0 8 0 mextrefs 64 25 0 0 1 0 1 1 0 8 0 mtagpl 96 3 0 0 1 0 1 1 0 8 0 mbufpl 256 261 0 0 17 0 17 17 0 8 0 bufpl 272 2558 0 102 164 0 164 164 0 8 0 anonpl 32 5395 0 0 44 0 44 44 0 247 0 amapchunkpl 152 15375 0 14907 28 0 28 28 0 158 7 amappl16 200 1927 0 1911 5 2 3 5 0 8 1 amappl15 192 4 0 4 1 1 0 1 0 8 0 amappl14 184 573 0 570 1 0 1 1 0 8 0 amappl13 176 139 0 128 1 0 1 1 0 8 0 amappl12 168 1045 0 1013 2 0 2 2 0 8 0 amappl11 160 69 0 69 1 1 0 1 0 8 0 amappl10 152 61 0 51 1 0 1 1 0 8 0 amappl9 144 275 0 275 1 1 0 1 0 8 0 amappl8 136 145 0 144 1 0 1 1 0 8 0 amappl7 128 163 0 150 1 0 1 1 0 8 0 amappl6 120 286 0 283 1 0 1 1 0 8 0 amappl5 112 99 0 91 1 0 1 1 0 8 0 amappl4 104 293 0 278 1 0 1 1 0 8 0 amappl3 96 2799 0 2708 5 1 4 4 0 8 1 amappl2 88 815 0 738 2 0 2 2 0 8 0 amappl1 80 12548 0 11953 14 0 14 14 0 8 1 amappl 88 4509 0 4345 5 0 5 5 0 92 0 uvmvnodes 80 104 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 8 0 1 1 0 1 1 0 8 0 uaddrrnd 24 759 0 722 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 759 0 722 1 0 1 1 0 8 0 vmmpekpl 168 7644 0 7593 3 0 3 3 0 8 0 vmmpepl 168 56720 0 54723 95 0 95 95 0 357 5 vmsppl 488 758 0 721 7 1 6 6 0 8 0 rwobjpl 80 18743 0 17761 23 1 22 22 0 8 0 pdppl 4096 1525 0 1442 117 28 89 97 0 8 6 pvpl 32 13081 0 0 106 0 106 106 0 265 0 pmappl 256 758 0 721 4 1 3 3 0 8 0 extentpl 40 45 0 27 1 0 1 1 0 8 0 phpool 112 466 0 31 13 0 13 13 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(ffffffff8351e727) at panic+0x1e5 sys/kern/subr_prf.c:198 amap_pp_adjref(fffffd80610a4918,0,2,ffffffff) at amap_pp_adjref+0x74c sys/uvm/uvm_amap.c:883 amap_adjref_anons(fffffd80610a4918,0,2,ffffffff,0) at amap_adjref_anons+0x22d sys/uvm/uvm_amap.c:1301 uvm_unmap_detach(ffff800039faa8a0,0) at uvm_unmap_detach+0x8a sys/uvm/uvm_map.c:1359 uvm_map_teardown(fffffd800b1cb1e8) at uvm_map_teardown+0x360 sys/uvm/uvm_map.c:2536 exit1(ffff80003c3fe558,0,0,1) at exit1+0x71b sys/kern/kern_exit.c:260 sys_exit(ffff80003c3fe558,ffff800039faaa70,ffff800039faa9c0) at sys_exit+0x1a sys/kern/kern_exit.c:-1 syscall(ffff800039faaa70) at syscall+0xb17 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff800039faaa70) at syscall+0xb17 sys/arch/amd64/amd64/trap.c:791 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7c5c2dcd88d0, 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 end of kernel end trace frame: 0x7381b5adfa30, count: 12 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 end of kernel end trace frame: 0x7381b5adfa30, count: -3