panic: amap_pp_adjref: negative reference count Stopped at db_enter+0x25: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND 139111 99364 0 0x14000 0x200 1 reaper db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff8351e9f8) at panic+0x1e5 sys/kern/subr_prf.c:198 amap_pp_adjref(fffff7806ce0a498,0,2,ffffffff) at amap_pp_adjref+0x74c sys/uvm/uvm_amap.c:881 amap_adjref_anons(fffff7806ce0a498,0,2,ffffffff,0) at amap_adjref_anons+0x22d sys/uvm/uvm_amap.c:1299 uvm_unmap_detach(ffff80003c4074a0,0) at uvm_unmap_detach+0x8a sys/uvm/uvm_map.c:1359 uvm_map_teardown(fffff7806d06ed80) at uvm_map_teardown+0x360 sys/uvm/uvm_map.c:2536 exit1(ffff80003c400a88,ff,0,1) at exit1+0x71b sys/kern/kern_exit.c:260 sys_exit(ffff80003c400a88,ffff80003c407670,ffff80003c4075c0) at sys_exit+0x1a sys/kern/kern_exit.c:-1 syscall(ffff80003c407670) at syscall+0xb17 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff80003c407670) at syscall+0xb17 sys/arch/amd64/amd64/trap.c:783 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x75263e5fca10, 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(ffffffff8351e9f8) at panic+0x1e5 sys/kern/subr_prf.c:198 amap_pp_adjref(fffff7806ce0a498,0,2,ffffffff) at amap_pp_adjref+0x74c sys/uvm/uvm_amap.c:881 amap_adjref_anons(fffff7806ce0a498,0,2,ffffffff,0) at amap_adjref_anons+0x22d sys/uvm/uvm_amap.c:1299 uvm_unmap_detach(ffff80003c4074a0,0) at uvm_unmap_detach+0x8a sys/uvm/uvm_map.c:1359 uvm_map_teardown(fffff7806d06ed80) at uvm_map_teardown+0x360 sys/uvm/uvm_map.c:2536 exit1(ffff80003c400a88,ff,0,1) at exit1+0x71b sys/kern/kern_exit.c:260 sys_exit(ffff80003c400a88,ffff80003c407670,ffff80003c4075c0) at sys_exit+0x1a sys/kern/kern_exit.c:-1 syscall(ffff80003c407670) at syscall+0xb17 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff80003c407670) at syscall+0xb17 sys/arch/amd64/amd64/trap.c:783 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x75263e5fca10, count: -10 ddb{0}> show registers rdi 0 rsi 0x1 rbp 0xffff80003c407240 rbx 0xffffffff8398ce07 cpu_info_full_primary+0x2e07 rdx 0 rcx 0xffff80003c400a88 rax 0xffffffff8398bff0 cpu_info_full_primary+0x1ff0 r8 0x101010101010101 r9 0x8080808080808080 r10 0x5b2baa36a7cfa4f4 r11 0xeca072f208f00aef r12 0xffffffff8398cc08 cpu_info_full_primary+0x2c08 r13 0 r14 0 r15 0x1 rip 0xffffffff832fc1c5 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff80003c407230 ss 0 db_enter+0x25: addq $0x8,%rsp ddb{0}> show proc PROC (sshd-auth) tid=266053 pid=8653 tcnt=0 stat=onproc flags process=110001a proc=2000 runpri=32, usrpri=52, slppri=32, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=1 forw=0xffffffffffffffff, list=0xffff80003c400fb8,0xffff800045fe6d28 process=0xffff80003a3cc9c0 user=0xffff80003c402000, vmspace=0xfffff7806d06ed80 estcpu=2, cpticks=5, pctcpu=0.0, user=0, sys=1, intr=0 ddb{0}> ps PID TID PPID UID S PRLAGS PFLAGS WAIT COMMAND 73219 332715 38366 32767 2 0x10 0 syz-executor 73219 384194 38366 32767 3 0x10 0x4000080 fsleep syz-executor 90993 137300 22162 0 3 0x2 0x80 wait sshd-session 11848 127164 16060 32767 2 0x10 0 syz-executor 11848 9676 16060 32767 3 0x10 0x4000080 fsleep syz-executor 84769 455843 44683 32767 3 0x10 0x80 nanoslp syz-executor 84769 311272 44683 32767 3 0x10 0x4000080 ttyout syz-executor 84769 408565 44683 32767 3 0x10 0x4000080 fsleep syz-executor 10041 501755 61505 32767 2 0x10 0 syz-executor 10041 56267 61505 32767 3 0x10 0x4000080 fsleep syz-executor 10041 393961 61505 32767 3 0x10 0x4000080 ttyin syz-executor 10041 263029 61505 32767 3 0x10 0x4000080 fsleep syz-executor 10041 471234 61505 32767 3 0x10 0x4000080 fsleep syz-executor 44683 116942 70305 32767 3 0x10 0x80 nanoslp syz-executor 61505 405655 21701 32767 2 0x10 0 syz-executor 16060 366291 26446 32767 3 0x10 0x80 nanoslp syz-executor 65346 222283 77131 32767 2 0x10000010 0x80 syz-executor 87036 136149 95681 32767 3 0x10 0x80 piperd syz-executor 57656 77641 54938 32767 3 0x10 0x80 wait syz-executor 38366 176981 91399 32767 3 0x10 0x80 nanoslp syz-executor 77131 382587 5210 0 3 0x2 0x80 wait syz-executor 95681 173531 5210 0 3 0x2 0x80 wait syz-executor 21701 332520 5210 0 3 0x2 0x80 wait syz-executor 91399 287214 5210 0 3 0x2 0x80 wait syz-executor 54938 465075 5210 0 3 0x2 0x80 wait syz-executor 70305 67752 5210 0 3 0x2 0x80 wait syz-executor 26446 49329 5210 0 3 0x2 0x80 wait syz-executor 5210 51701 55965 0 2 0x10000002 0 syz-executor 55965 274149 20387 0 3 0x100002 0x88 sigsusp ksh 20387 170964 22883 0 3 0x10 0x88 kqread sshd-session 22883 4979 22162 0 3 0x12 0x80 kqread sshd-session 18217 309255 1 0 3 0x100003 0x80 ttyin getty 22162 489055 1 0 3 0 0x88 kqread sshd 41162 359142 9052 73 2 0x1100010 0x80 syslogd 9052 231301 1 0 3 0x100002 0x80 sbwait syslogd 980 486152 1 0 3 0x100000 0x80 kqread resolvd 38720 87538 60 77 3 0x100012 0x80 kqread dhcpleased 2618 7182 60 77 3 0x100012 0x80 kqread dhcpleased 60 242086 1 0 3 0 0x80 kqread dhcpleased 75422 218514 0 0 3 0x14000 0x200 bored smr 9695 502591 0 0 2 0x14000 0x200 zerothread 72023 4289 0 0 3 0x14000 0x200 aiodoned aiodoned 68271 400025 0 0 3 0x14000 0x200 syncer update 2417 105003 0 0 3 0x14000 0x200 cleaner cleaner 99364 139111 0 0 7 0x14000 0x200 reaper 98300 186491 0 0 3 0x14000 0x200 pgdaemon pagedaemon 75258 238107 0 0 3 0x14000 0x200 bored viomb 10265 201924 0 0 3 0x14000 0x40000200 acpi0 acpi0 43575 141722 0 0 3 0x14000 0x40000200 idle1 80522 475550 0 0 3 0x14000 0x200 bored softnet1 28635 408555 0 0 3 0x14000 0x200 bored softnet0 60890 322309 0 0 3 0x14000 0x200 bored systqmp 89775 177634 0 0 3 0x14000 0x200 bored systq 6631 264828 0 0 3 0x14000 0x200 tmoslp softclockmp 28486 518328 0 0 3 0x14000 0x40000200 tmoslp softclock 1599 428325 0 0 3 0x14000 0x40000200 idle0 1 393316 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 11075 12020K 12034K 166960K 12171 0 pcb 17 12K 12K 166960K 17 0 rtable 223 6K 7K 166960K 403 0 pf 29 16K 16K 166960K 31 0 ifaddr 38 6K 7K 166960K 44 0 ifgroup 46 2K 2K 166960K 50 0 sysctl 3 1K 9K 166960K 8 0 counters 68 36K 37K 166960K 70 0 ioctlops 0 0K 2K 166960K 36 0 iov 0 0K 12K 166960K 18 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1288 81K 81K 166960K 1487 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 2 1K 5K 166960K 10 0 VM map 2 1K 1K 166960K 2 0 sem 12 0K 0K 166960K 25 0 dirhash 12 2K 2K 166960K 12 0 ACPI 1734 201K 291K 166960K 11964 0 file desc 21 77K 125K 166960K 454 0 sigio 0 0K 0K 166960K 11 0 proc 61 115K 163K 166960K 543 0 subproc 63 3K 4K 166960K 90 0 NFS srvsock 1 0K 0K 166960K 1 0 NFS daemon 1 16K 16K 166960K 1 0 ip_moptions 0 0K 0K 166960K 67 0 in_multi 88 6K 7K 166960K 117 0 ether_multi 1 0K 0K 166960K 5 0 mrt 2 0K 0K 166960K 15 0 ISOFS mount 1 32K 32K 166960K 1 0 MSDOSFS mount 1 16K 16K 166960K 1 0 ttys 229 1023K 1023K 166960K 229 0 exec 0 0K 1K 166960K 396 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 240 177K 194K 166960K 5653 0 UVM aobj 14 2K 2K 166960K 15 0 pinsyscall 44 88K 114K 166960K 1564 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 ip6_options 0 0K 0K 166960K 15 0 NDP 10 0K 2K 166960K 27 0 temp 37 9119K 9123K 166960K 4540 0 kqueue 14 22K 31K 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 88 0 85 2 0 2 2 0 8 1 rtentry 176 118 0 15 6 0 6 6 0 8 0 unpcb 144 648 0 629 6 0 6 6 0 8 5 syncache 336 12 0 12 1 0 1 1 0 8 1 tcpqe 32 3 0 3 1 0 1 1 0 8 1 tcpcb 736 114 0 107 2 0 2 2 0 8 1 arp 136 18 0 2 1 0 1 1 0 8 0 ipq 40 1 0 0 1 0 1 1 0 8 0 ipqe 40 1 0 0 1 0 1 1 0 8 0 inpcb 328 407 0 397 5 0 5 5 0 8 3 ip6q 72 1 0 0 1 0 1 1 0 8 0 ip6af 40 2 0 0 1 0 1 1 0 8 0 nd6 152 31 0 6 2 0 2 2 0 8 0 kcovpl 48 10 0 3 1 0 1 1 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 501 0 63 31 0 31 31 0 8 1 art_table 40 502 0 63 5 0 5 5 0 8 0 art_node 32 118 0 24 1 0 1 1 0 8 0 sysvmsgpl 40 4 0 3 1 0 1 1 0 8 0 semapl 72 18 0 8 1 0 1 1 0 8 0 shmpl 112 12 0 1 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 2076 0 603 93 0 93 93 0 8 0 ffsino 296 2076 0 603 114 0 114 114 0 8 0 nchpl 144 2710 0 1013 64 0 64 64 0 8 0 vnodes 216 2175 0 0 121 0 121 121 0 8 0 namei 1024 8362 0 8362 1 0 1 1 0 8 1 percpumem 16 51 0 1 1 0 1 1 0 8 0 kstatmem 264 25 0 2 2 0 2 2 0 8 0 scxspl 216 8765 0 8765 10 2 8 8 1 8 8 plimitpl 152 120 0 94 2 0 2 2 0 8 0 sigapl 424 747 0 694 7 0 7 7 0 8 0 knotepl 120 376 0 0 12 0 12 12 0 8 0 kqueuepl 224 129 0 118 2 0 2 2 0 8 1 pipepl 344 168 0 140 3 0 3 3 0 8 0 fdescpl 528 731 0 697 4 0 4 4 0 8 0 filepl 160 4042 0 3831 16 0 16 16 0 8 5 lockfpl 104 98 0 96 1 0 1 1 0 8 0 lockfspl 48 28 0 26 1 0 1 1 0 8 0 sessionpl 144 47 0 31 1 0 1 1 0 8 0 pgrppl 48 64 0 40 1 0 1 1 0 8 0 ucredpl 104 920 0 901 1 0 1 1 0 8 0 zombiepl 144 698 0 694 1 0 1 1 0 8 0 processpl 1232 747 0 694 5 0 5 5 0 8 0 procpl 664 1219 0 1158 6 0 6 6 0 8 0 sosppl 176 8 0 8 1 0 1 1 0 8 1 sockpl 752 1145 0 1112 18 4 14 17 0 8 9 mcl64k 65536 4 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 129 0 0 17 0 17 17 0 8 0 mcl2k2 2112 1 0 0 1 0 1 1 0 8 0 mcl2k 2048 20 0 0 3 0 3 3 0 8 0 mextrefs 64 19 0 0 1 0 1 1 0 8 0 mtagpl 96 2 0 0 1 0 1 1 0 8 0 mbufpl 256 1335 0 0 84 0 84 84 0 8 0 bufpl 272 2661 0 102 171 0 171 171 0 8 0 anonpl 32 10290 0 0 83 0 83 83 0 247 0 amapchunkpl 152 17431 0 16963 35 0 35 35 0 158 13 amappl16 200 1970 0 1953 20 6 14 17 0 8 11 amappl15 192 6 0 6 2 1 1 1 0 8 1 amappl14 184 406 0 405 1 0 1 1 0 8 0 amappl13 176 119 0 107 1 0 1 1 0 8 0 amappl12 168 978 0 945 2 0 2 2 0 8 0 amappl11 160 5 0 5 1 1 0 1 0 8 0 amappl10 152 83 0 73 1 0 1 1 0 8 0 amappl9 144 276 0 276 1 1 0 1 0 8 0 amappl8 136 124 0 123 1 0 1 1 0 8 0 amappl7 128 143 0 129 1 0 1 1 0 8 0 amappl6 120 177 0 176 1 0 1 1 0 8 0 amappl5 112 99 0 91 1 0 1 1 0 8 0 amappl4 104 276 0 259 1 0 1 1 0 8 0 amappl3 96 3421 0 3311 5 1 4 4 0 8 0 amappl2 88 574 0 509 2 0 2 2 0 8 0 amappl1 80 13166 0 12470 16 0 16 16 0 8 1 amappl 88 4886 0 4721 5 0 5 5 0 92 0 uvmvnodes 80 110 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 1 1 0 1 1 0 8 0 uaddrrnd 24 731 0 697 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 731 0 697 1 0 1 1 0 8 0 vmmpekpl 168 8267 0 8227 2 0 2 2 0 8 0 vmmpepl 168 56810 0 54731 112 0 112 112 0 357 13 vmsppl 488 730 0 696 7 1 6 6 0 8 1 rwobjpl 80 19000 0 17923 29 0 29 29 0 8 4 pdppl 4096 1469 0 1392 109 26 83 97 0 8 6 pvpl 32 17741 0 0 144 0 144 144 0 265 0 pmappl 256 730 0 696 4 1 3 3 0 8 0 extentpl 40 46 0 28 1 0 1 1 0 8 0 phpool 112 525 0 29 15 0 15 15 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(ffffffff8351e9f8) at panic+0x1e5 sys/kern/subr_prf.c:198 amap_pp_adjref(fffff7806ce0a498,0,2,ffffffff) at amap_pp_adjref+0x74c sys/uvm/uvm_amap.c:881 amap_adjref_anons(fffff7806ce0a498,0,2,ffffffff,0) at amap_adjref_anons+0x22d sys/uvm/uvm_amap.c:1299 uvm_unmap_detach(ffff80003c4074a0,0) at uvm_unmap_detach+0x8a sys/uvm/uvm_map.c:1359 uvm_map_teardown(fffff7806d06ed80) at uvm_map_teardown+0x360 sys/uvm/uvm_map.c:2536 exit1(ffff80003c400a88,ff,0,1) at exit1+0x71b sys/kern/kern_exit.c:260 sys_exit(ffff80003c400a88,ffff80003c407670,ffff80003c4075c0) at sys_exit+0x1a sys/kern/kern_exit.c:-1 syscall(ffff80003c407670) at syscall+0xb17 mi_syscall sys/sys/syscall_mi.h:176 [inline] syscall(ffff80003c407670) at syscall+0xb17 sys/arch/amd64/amd64/trap.c:783 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x75263e5fca10, count: -10 ddb{0}> machine ddbcpu 1