panic: amap_pp_adjref: negative reference count Stopped at db_enter+0x25: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff834ed946) at panic+0x1cf sys/kern/subr_prf.c:198 amap_pp_adjref(fffff8800a1a1580,0,1,ffffffff) at amap_pp_adjref+0x74c sys/uvm/uvm_amap.c:883 amap_adjref_anons(fffff8800a1a1580,0,1,ffffffff,0) at amap_adjref_anons+0x22d sys/uvm/uvm_amap.c:1301 uvm_unmap_detach(ffff80002a7a59c0,0) at uvm_unmap_detach+0x8a sys/uvm/uvm_map.c:1359 uvm_map_teardown(fffff8806fd48178) at uvm_map_teardown+0x357 sys/uvm/uvm_map.c:2536 exit1(ffff80002a766010,0,1f,1) at exit1+0x705 sys/kern/kern_exit.c:259 sigexit(ffff80002a766010,1f) at sigexit+0x115 postsig(ffff80002a766010,1f,ffff80002a7a5be8) at postsig+0x686 sys/kern/kern_sig.c:1763 userret(ffff80002a766010) at userret+0x23e sys/kern/kern_sig.c:2207 syscall(ffff80002a7a5d10) at syscall+0xa56 mi_syscall_return sys/sys/syscall_mi.h:203 [inline] syscall(ffff80002a7a5d10) at syscall+0xa56 sys/arch/amd64/amd64/trap.c:812 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7480a33a4270, count: 3 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 *cpu0: amap_pp_adjref: negative reference count ddb> show kasan No such command ddb> trace db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff834ed946) at panic+0x1cf sys/kern/subr_prf.c:198 amap_pp_adjref(fffff8800a1a1580,0,1,ffffffff) at amap_pp_adjref+0x74c sys/uvm/uvm_amap.c:883 amap_adjref_anons(fffff8800a1a1580,0,1,ffffffff,0) at amap_adjref_anons+0x22d sys/uvm/uvm_amap.c:1301 uvm_unmap_detach(ffff80002a7a59c0,0) at uvm_unmap_detach+0x8a sys/uvm/uvm_map.c:1359 uvm_map_teardown(fffff8806fd48178) at uvm_map_teardown+0x357 sys/uvm/uvm_map.c:2536 exit1(ffff80002a766010,0,1f,1) at exit1+0x705 sys/kern/kern_exit.c:259 sigexit(ffff80002a766010,1f) at sigexit+0x115 postsig(ffff80002a766010,1f,ffff80002a7a5be8) at postsig+0x686 sys/kern/kern_sig.c:1763 userret(ffff80002a766010) at userret+0x23e sys/kern/kern_sig.c:2207 syscall(ffff80002a7a5d10) at syscall+0xa56 mi_syscall_return sys/sys/syscall_mi.h:203 [inline] syscall(ffff80002a7a5d10) at syscall+0xa56 sys/arch/amd64/amd64/trap.c:812 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7480a33a4270, count: -12 ddb> show registers rdi 0 rsi 0x1 rbp 0xffff80002a7a5770 rbx 0xffff800000c57fd0 rdx 0 rcx 0 rax 0xffff80002a766010 r8 0x101010101010101 r9 0x8080808080808080 r10 0x3bb896ad294674e2 r11 0xa0fef95cc127de08 r12 0 r13 0x78a0 __ALIGN_SIZE+0x68a0 r14 0 r15 0x1 rip 0xffffffff82136385 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff80002a7a5760 ss 0x10 db_enter+0x25: addq $0x8,%rsp ddb> show proc PROC (syslogd) tid=22344 pid=77393 tcnt=0 stat=onproc flags process=10000a proc=2000 runpri=24, usrpri=50, slppri=24, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=1 forw=0xffffffffffffffff, list=0xffff80002a767768,0xffff80002a766550 process=0xffff80002a747188 user=0xffff80002a7a0000, vmspace=0xfffff8806fd48178 estcpu=0, cpticks=2, pctcpu=0.0, user=0, sys=1, intr=0 ddb> ps PID TID PPID UID S PRLAGS PFLAGS WAIT COMMAND 18320 330608 64137 0 2 0 0 syz-executor 18320 152536 64137 0 3 0 0x4000080 fsleep syz-executor 56658 430988 92657 0 2 0x2000 0x80000 syz-executor 56658 205819 92657 0 3 0x2000 0x4000000 suspend syz-executor 55034 11386 17272 0 3 0x1 0x80 nanoslp syz-executor 55034 35376 17272 0 3 0x1 0x4000080 fifor syz-executor 55034 518386 17272 0 3 0x1 0x4000080 fsleep syz-executor 55034 469395 17272 0 3 0x1 0x4000080 fsleep syz-executor 21453 171859 81343 0 2 0x10 0 syz-executor 21453 302320 81343 0 2 0x10 0x4000000 syz-executor 38840 107952 37397 0 3 0 0x80 nanoslp syz-executor 38840 31395 37397 0 3 0 0x4000080 piperd syz-executor 38840 425998 37397 0 3 0 0x4000080 fsleep syz-executor 24450 473032 36025 0 2 0 0 syz-executor 24450 303014 36025 0 3 0 0x4000080 fsleep syz-executor 89896 396198 18842 0 2 0 0xc80 syz-executor 89896 427534 18842 0 3 0 0x4000080 sbwait syz-executor 89896 501176 18842 0 3 0 0x4000080 fsleep syz-executor 89896 98822 18842 0 3 0 0x4000080 fsleep syz-executor 10062 231002 84618 0 3 0 0x80 nanoslp syz-executor 10062 364152 84618 0 3 0 0x4000080 ttyout syz-executor 10062 11738 84618 0 3 0 0x4000080 fsleep syz-executor 81343 263139 77999 0 2 0x2 0xc80 syz-executor 64137 53173 77999 0 3 0x2 0x80 nanoslp syz-executor 36025 54849 77999 0 3 0x2 0x80 nanoslp syz-executor 18842 166208 77999 0 2 0x2 0xc80 syz-executor 17272 289311 77999 0 2 0x2 0xc80 syz-executor 92657 284894 77999 0 3 0x2 0x80 nanoslp syz-executor 37397 485344 77999 0 3 0x2 0x80 nanoslp syz-executor 84618 64688 77999 0 3 0x2 0x80 nanoslp syz-executor 77999 281007 51867 0 3 0x2 0x80 kqread syz-executor 51867 372730 1 0 2 0x100002 0x88 ksh 52400 228757 77393 73 3 0x1100010 0x80 kqread syslogd 7179 157649 1 0 2 0x100000 0x80 resolvd 95641 275960 44791 77 3 0x100012 0x80 kqread dhcpleased 2651 122189 44791 77 3 0x100012 0x80 kqread dhcpleased 44791 213235 1 0 2 0 0x80 dhcpleased 69152 347598 0 0 3 0x14000 0x200 bored smr 75123 212295 0 0 2 0x14000 0x200 zerothread 89055 409517 0 0 3 0x14000 0x200 aiodoned aiodoned 58676 250972 0 0 3 0x14000 0x200 syncer update 27396 24230 0 0 3 0x14000 0x200 cleaner cleaner 38914 505264 0 0 3 0x14000 0x200 reaper reaper 51659 425666 0 0 3 0x14000 0x200 pgdaemon pagedaemon 4905 91864 0 0 3 0x14000 0x200 bored viomb 60920 339666 0 0 3 0x14000 0x40000200 acpi0 acpi0 25348 6600 0 0 2 0x14000 0x200 softnet0 78836 454935 0 0 3 0x14000 0x200 bored systqmp 8086 290243 0 0 3 0x14000 0x200 bored systq 50657 8658 0 0 3 0x14000 0x40000200 tmoslp softclock 33890 151302 0 0 3 0x14000 0x40000200 idle0 1 229911 0 0 2 0x10000002 0x80 init 0 0 -1 0 3 0x10000 0x200 scheduler swapper ddb> show all locks No such command ddb> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 11067 12172K 12378K 166960K 12233 0 pcb 17 12K 12K 166960K 24 0 rtable 243 7K 7K 166960K 360 0 pf 30 12K 13K 166960K 32 0 ifaddr 42 7K 7K 166960K 45 0 ifgroup 50 2K 2K 166960K 52 0 sysctl 1 1K 9K 166960K 5 0 counters 33 17K 18K 166960K 36 0 ioctlops 0 0K 4K 166960K 38 0 iov 2 8K 8K 166960K 3 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1298 82K 82K 166960K 1426 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 2 1K 5K 166960K 4 0 VM map 2 1K 1K 166960K 2 0 sem 3 0K 0K 166960K 5 0 dirhash 12 2K 2K 166960K 15 0 ACPI 1734 201K 291K 166960K 11964 0 file desc 18 65K 97K 166960K 208 0 sigio 0 0K 0K 166960K 2 0 proc 24 41K 124K 166960K 501 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 9 0 in_multi 99 6K 6K 166960K 99 0 ether_multi 1 0K 0K 166960K 1 0 mrt 0 0K 0K 166960K 4 0 ISOFS mount 1 32K 32K 166960K 1 0 MSDOSFS mount 1 16K 16K 166960K 1 0 ttys 241 1076K 1076K 166960K 241 0 exec 0 0K 1K 166960K 369 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 208 122K 157K 166960K 3427 0 UVM aobj 5 2K 2K 166960K 5 0 pinsyscall 29 58K 96K 166960K 1308 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 11 0K 2K 166960K 28 0 temp 36 9106K 9122K 166960K 7863 0 kqueue 10 14K 26K 166960K 42 0 SYN cache 2 16K 16K 166960K 2 0 ddb> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle rtpcb 120 39 0 35 1 0 1 1 0 8 0 rtentry 136 112 0 1 4 0 4 4 0 8 0 unpcb 144 139 0 58 4 0 4 4 0 8 0 syncache 336 5 0 5 1 0 1 1 0 8 1 tcpcb 736 92 0 89 7 0 7 7 0 8 6 arp 96 18 0 0 1 0 1 1 0 8 0 ipq 40 3 0 0 1 0 1 1 0 8 0 ipqe 40 5 0 0 1 0 1 1 0 8 0 inpcb 328 204 0 198 10 0 10 10 0 8 9 nd6 112 25 0 0 1 0 1 1 0 8 0 pkpcb 40 3 0 2 1 0 1 1 0 8 0 kcovpl 48 8 0 0 1 0 1 1 0 8 0 ppxss 1072 3 0 3 1 0 1 1 0 8 1 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 454 0 0 29 0 29 29 0 8 0 art_table 40 455 0 0 5 0 5 5 0 8 0 art_node 32 112 0 11 1 0 1 1 0 8 0 sysvmsgpl 40 2 0 2 1 0 1 1 0 8 1 semapl 72 3 0 2 1 0 1 1 0 8 0 shmpl 112 2 0 0 1 0 1 1 0 8 0 dirhash 1024 19 0 2 3 0 3 3 0 8 0 dino2pl 256 1708 0 248 92 0 92 92 0 8 0 ffsino 256 1708 0 248 92 0 92 92 0 8 0 nchpl 144 2003 0 306 63 0 63 63 0 8 0 rtmask 32 1 0 1 1 0 1 1 0 8 1 vnodes 216 1825 0 0 102 0 102 102 0 8 0 namei 1024 6072 0 6072 2 0 2 2 0 8 2 kstatmem 264 25 0 2 2 0 2 2 0 8 0 scsiplug 72 1 0 1 1 0 1 1 0 8 1 scxspl 216 7079 0 7079 3 0 3 3 1 8 3 plimitpl 152 74 0 57 1 0 1 1 0 8 0 sigapl 424 503 0 460 6 0 6 6 0 8 1 knotepl 120 5368 0 5328 17 0 17 17 0 8 15 kqueuepl 184 46 0 38 1 0 1 1 0 8 0 pipepl 304 131 0 103 3 0 3 3 0 8 0 fdescpl 448 490 0 465 5 0 5 5 0 8 1 filepl 120 2105 0 1823 11 0 11 11 0 8 2 lockfpl 104 29 0 26 1 0 1 1 0 8 0 lockfspl 48 15 0 12 1 0 1 1 0 8 0 sessionpl 144 26 0 15 1 0 1 1 0 8 0 pgrppl 48 36 0 17 1 0 1 1 0 8 0 ucredpl 104 300 0 288 1 0 1 1 0 8 0 zombiepl 144 465 0 460 1 0 1 1 0 8 0 processpl 1152 503 0 460 4 0 4 4 0 8 0 procpl 664 607 0 550 5 0 5 5 0 8 0 sosppl 176 1 0 1 1 0 1 1 0 8 1 sockpl 552 387 0 294 10 0 10 10 0 8 2 mcl64k 65536 9 0 8 1 0 1 1 0 8 0 mcl16k 16384 9 0 9 1 0 1 1 0 8 1 mcl12k 12288 1 0 1 1 0 1 1 0 8 1 mcl9k128 9344 1 0 1 1 0 1 1 0 8 1 mcl8k 8192 5 0 5 1 0 1 1 0 8 1 mcl4k 4096 2606 0 2560 12 0 12 12 0 8 5 mcl2k 2048 168 0 152 3 0 3 3 0 8 0 mextrefs 64 89 0 73 1 0 1 1 0 8 0 mtagpl 96 5 0 5 1 0 1 1 0 8 1 mbufpl 256 4918 0 4733 13 0 13 13 0 8 0 bufpl 272 2634 0 102 169 0 169 169 0 8 0 anonpl 24 61084 0 58487 32 0 32 32 0 187 7 amapchunkpl 152 9643 0 9143 27 0 27 27 0 158 6 amappl16 200 310 0 284 5 0 5 5 0 8 1 amappl15 192 2 0 2 1 0 1 1 0 8 1 amappl14 184 406 0 405 1 0 1 1 0 8 0 amappl13 176 114 0 108 1 0 1 1 0 8 0 amappl12 168 725 0 700 2 0 2 2 0 8 0 amappl11 160 1 0 1 1 0 1 1 0 8 1 amappl10 152 56 0 46 1 0 1 1 0 8 0 amappl9 144 266 0 266 1 0 1 1 0 8 1 amappl8 136 106 0 105 1 0 1 1 0 8 0 amappl7 128 136 0 128 1 0 1 1 0 8 0 amappl6 120 145 0 144 1 0 1 1 0 8 0 amappl5 112 88 0 82 1 0 1 1 0 8 0 amappl4 104 257 0 248 1 0 1 1 0 8 0 amappl3 96 1739 0 1645 3 0 3 3 0 8 0 amappl2 88 603 0 551 2 0 2 2 0 8 0 amappl1 80 10459 0 10185 13 0 13 13 0 8 3 amappl 88 2737 0 2575 4 0 4 4 0 92 0 uvmvnodes 80 97 0 0 2 0 2 2 0 8 0 dma4096 4096 1 0 1 1 0 1 1 0 8 1 dma1024 1024 1 0 0 1 0 1 1 0 8 0 dma256 256 6 0 6 1 0 1 1 0 8 1 dma128 128 255 0 255 1 0 1 1 0 8 1 dma64 64 6 0 6 1 0 1 1 0 8 1 dma32 32 7 0 7 1 0 1 1 0 8 1 dma16 16 18 0 17 1 0 1 1 0 8 0 aobjpl 72 4 0 0 1 0 1 1 0 8 0 uaddrrnd 24 490 0 465 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 490 0 465 1 0 1 1 0 8 0 vmmpekpl 168 5797 0 5760 3 0 3 3 0 8 0 vmmpepl 168 38644 0 37320 82 0 82 82 0 357 12 vmsppl 368 489 0 464 4 0 4 4 0 8 1 rwobjpl 40 13268 0 12573 11 0 11 11 0 8 0 pdppl 4096 986 0 928 96 30 66 82 0 8 8 pvpl 32 202614 0 196298 97 0 97 97 0 265 23 pmappl 216 489 0 464 3 0 3 3 0 8 1 extentpl 40 46 0 28 1 0 1 1 0 8 0 phpool 112 535 0 30 15 0 15 15 0 8 0 ddb> machine ddbcpu 0 No such command ddb> trace db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff834ed946) at panic+0x1cf sys/kern/subr_prf.c:198 amap_pp_adjref(fffff8800a1a1580,0,1,ffffffff) at amap_pp_adjref+0x74c sys/uvm/uvm_amap.c:883 amap_adjref_anons(fffff8800a1a1580,0,1,ffffffff,0) at amap_adjref_anons+0x22d sys/uvm/uvm_amap.c:1301 uvm_unmap_detach(ffff80002a7a59c0,0) at uvm_unmap_detach+0x8a sys/uvm/uvm_map.c:1359 uvm_map_teardown(fffff8806fd48178) at uvm_map_teardown+0x357 sys/uvm/uvm_map.c:2536 exit1(ffff80002a766010,0,1f,1) at exit1+0x705 sys/kern/kern_exit.c:259 sigexit(ffff80002a766010,1f) at sigexit+0x115 postsig(ffff80002a766010,1f,ffff80002a7a5be8) at postsig+0x686 sys/kern/kern_sig.c:1763 userret(ffff80002a766010) at userret+0x23e sys/kern/kern_sig.c:2207 syscall(ffff80002a7a5d10) at syscall+0xa56 mi_syscall_return sys/sys/syscall_mi.h:203 [inline] syscall(ffff80002a7a5d10) at syscall+0xa56 sys/arch/amd64/amd64/trap.c:812 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7480a33a4270, count: -12 ddb> machine ddbcpu 1 No such command ddb> trace db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff834ed946) at panic+0x1cf sys/kern/subr_prf.c:198 amap_pp_adjref(fffff8800a1a1580,0,1,ffffffff) at amap_pp_adjref+0x74c sys/uvm/uvm_amap.c:883 amap_adjref_anons(fffff8800a1a1580,0,1,ffffffff,0) at amap_adjref_anons+0x22d sys/uvm/uvm_amap.c:1301 uvm_unmap_detach(ffff80002a7a59c0,0) at uvm_unmap_detach+0x8a sys/uvm/uvm_map.c:1359 uvm_map_teardown(fffff8806fd48178) at uvm_map_teardown+0x357 sys/uvm/uvm_map.c:2536 exit1(ffff80002a766010,0,1f,1) at exit1+0x705 sys/kern/kern_exit.c:259 sigexit(ffff80002a766010,1f) at sigexit+0x115 postsig(ffff80002a766010,1f,ffff80002a7a5be8) at postsig+0x686 sys/kern/kern_sig.c:1763 userret(ffff80002a766010) at userret+0x23e sys/kern/kern_sig.c:2207 syscall(ffff80002a7a5d10) at syscall+0xa56 mi_syscall_return sys/sys/syscall_mi.h:203 [inline] syscall(ffff80002a7a5d10) at syscall+0xa56 sys/arch/amd64/amd64/trap.c:812 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7480a33a4270, count: -12