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(ffffffff834e658a) at panic+0x1cf sys/kern/subr_prf.c:198 amap_pp_adjref(fffff7806e645378,0,1,ffffffff) at amap_pp_adjref+0x74c sys/uvm/uvm_amap.c:883 amap_adjref_anons(fffff7806e645378,0,1,ffffffff,0) at amap_adjref_anons+0x22d sys/uvm/uvm_amap.c:1301 uvm_unmap_detach(ffff80002f0b1b60,0) at uvm_unmap_detach+0x8a sys/uvm/uvm_map.c:1359 uvm_map_teardown(fffff7806d19e5d0) at uvm_map_teardown+0x357 sys/uvm/uvm_map.c:2536 exit1(ffff80002a75aa78,0,0,1) at exit1+0x705 sys/kern/kern_exit.c:259 sys_exit(ffff80002a75aa78,ffff80002f0b1d20,ffff80002f0b1c70) at sys_exit+0x1a sys/kern/kern_exit.c:-1 syscall(ffff80002f0b1d20) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002f0b1d20) at syscall+0x962 sys/arch/amd64/amd64/trap.c:783 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7c76113fd610, 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> 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(ffffffff834e658a) at panic+0x1cf sys/kern/subr_prf.c:198 amap_pp_adjref(fffff7806e645378,0,1,ffffffff) at amap_pp_adjref+0x74c sys/uvm/uvm_amap.c:883 amap_adjref_anons(fffff7806e645378,0,1,ffffffff,0) at amap_adjref_anons+0x22d sys/uvm/uvm_amap.c:1301 uvm_unmap_detach(ffff80002f0b1b60,0) at uvm_unmap_detach+0x8a sys/uvm/uvm_map.c:1359 uvm_map_teardown(fffff7806d19e5d0) at uvm_map_teardown+0x357 sys/uvm/uvm_map.c:2536 exit1(ffff80002a75aa78,0,0,1) at exit1+0x705 sys/kern/kern_exit.c:259 sys_exit(ffff80002a75aa78,ffff80002f0b1d20,ffff80002f0b1c70) at sys_exit+0x1a sys/kern/kern_exit.c:-1 syscall(ffff80002f0b1d20) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002f0b1d20) at syscall+0x962 sys/arch/amd64/amd64/trap.c:783 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7c76113fd610, count: -10 ddb> show registers rdi 0 rsi 0x1 rbp 0xffff80002f0b1910 rbx 0xffff800000c57cc0 rdx 0 rcx 0 rax 0xffff80002a75aa78 r8 0x101010101010101 r9 0x8080808080808080 r10 0x2038b1730526348 r11 0xd27609db3b59357 r12 0 r13 0x1 r14 0 r15 0x1 rip 0xffffffff826251e5 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff80002f0b1900 ss 0x10 db_enter+0x25: addq $0x8,%rsp ddb> show proc PROC (ndp) tid=53882 pid=78108 tcnt=0 stat=onproc flags process=10000a proc=2000 runpri=52, usrpri=52, slppri=32, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=1 forw=0xffffffffffffffff, list=0xffff80002a75afa8,0xffff80002a75bcb0 process=0xffff800045ff9218 user=0xffff80002f0ac000, vmspace=0xfffff7806d19e5d0 estcpu=18, cpticks=1, pctcpu=0.0, user=0, sys=0, intr=0 ddb> ps PID TID PPID UID S PRLAGS PFLAGS WAIT COMMAND 68521 207674 57861 0 2 0 0 syz-executor 68521 488586 57861 0 3 0 0x4000080 fifor syz-executor 61083 320260 78556 0 2 0 0 syz-executor 61083 416822 78556 0 3 0 0x4000080 fsleep syz-executor 28144 250833 8331 0 3 0x100002 0x88 sigsusp sh 63214 384461 58120 0 2 0x2 0 sh 53752 62880 68391 0 2 0x2 0 arp 68391 442054 73883 0 3 0x100002 0x88 sigsusp sh 58120 181366 46241 0 3 0x2 0x80 wait syz-executor 78556 35729 46241 0 3 0x2 0x80 nanoslp syz-executor 57861 292139 46241 0 3 0x2 0x80 nanoslp syz-executor 41891 311428 46241 0 2 0x2 0 syz-executor 88029 179262 46241 0 2 0x2 0 syz-executor 67168 354786 46241 0 3 0x2 0x80 nanoslp syz-executor 8331 306501 46241 0 3 0x2 0x80 wait syz-executor 73883 285525 46241 0 3 0x2 0x80 wait syz-executor 46241 369219 77242 0 3 0x2 0x80 kqread syz-executor 77242 489625 76707 0 3 0x100002 0x88 sigsusp ksh 76707 277090 64415 0 3 0x10 0x88 kqread sshd-session 64415 7679 68682 0 3 0x12 0x80 kqread sshd-session 78660 232630 1 0 3 0x100003 0x80 ttyin getty 68682 11129 1 0 3 0 0x88 kqread sshd 29089 341211 63630 73 3 0x1100010 0x80 kqread syslogd 63630 490329 1 0 3 0x100002 0x80 sbwait syslogd 13961 172756 1 0 3 0x100000 0x80 kqread resolvd 9094 512838 92678 77 3 0x100012 0x80 kqread dhcpleased 28570 111003 92678 77 3 0x100012 0x80 kqread dhcpleased 92678 284641 1 0 3 0 0x80 kqread dhcpleased 90345 126525 0 0 3 0x14000 0x200 bored smr 34957 346618 0 0 2 0x14000 0x200 zerothread 86495 81967 0 0 3 0x14000 0x200 aiodoned aiodoned 46320 387451 0 0 3 0x14000 0x200 syncer update 48226 57105 0 0 3 0x14000 0x200 cleaner cleaner 55166 148955 0 0 3 0x14000 0x200 reaper reaper 22035 454432 0 0 3 0x14000 0x200 pgdaemon pagedaemon 41487 141458 0 0 3 0x14000 0x200 bored viomb 84993 338578 0 0 3 0x14000 0x40000200 acpi0 acpi0 88327 172785 0 0 2 0x14000 0x200 softnet0 30244 454605 0 0 3 0x14000 0x200 smrbar systqmp 98781 97724 0 0 3 0x14000 0x200 bored systq 89885 16102 0 0 3 0x14000 0x40000200 tmoslp softclock 53690 410297 0 0 3 0x14000 0x40000200 idle0 1 28267 0 0 3 0x2 0x80 wait 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 11035 12121K 12123K 166960K 12122 0 pcb 17 12K 12K 166960K 17 0 rtable 207 5K 5K 166960K 311 0 pf 30 12K 12K 166960K 30 0 ifaddr 38 6K 6K 166960K 40 0 ifgroup 50 2K 2K 166960K 50 0 sysctl 1 1K 9K 166960K 5 0 counters 33 17K 17K 166960K 33 0 ioctlops 0 0K 2K 166960K 29 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1292 81K 81K 166960K 1361 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 2 1K 5K 166960K 3 0 VM map 2 1K 1K 166960K 2 0 sem 2 0K 0K 166960K 2 0 dirhash 12 2K 2K 166960K 12 0 ACPI 1734 201K 291K 166960K 11964 0 file desc 17 61K 97K 166960K 132 0 proc 58 59K 116K 166960K 483 0 subproc 72 4K 4K 166960K 72 0 NFS srvsock 1 0K 0K 166960K 1 0 NFS daemon 1 16K 16K 166960K 1 0 in_multi 79 5K 5K 166960K 79 0 ether_multi 1 0K 0K 166960K 1 0 mrt 0 0K 0K 166960K 1 0 ISOFS mount 1 32K 32K 166960K 1 0 MSDOSFS mount 1 16K 16K 166960K 1 0 ttys 43 201K 201K 166960K 43 0 exec 0 0K 1K 166960K 358 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 207 157K 159K 166960K 2929 0 UVM aobj 4 2K 2K 166960K 4 0 pinsyscall 38 76K 96K 166960K 1215 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 NDP 23 1K 1K 166960K 23 0 temp 34 9106K 9112K 166960K 3518 0 kqueue 13 20K 20K 166960K 25 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 33 0 30 1 0 1 1 0 8 0 rtentry 136 96 0 1 4 0 4 4 0 8 0 unpcb 144 43 0 26 1 0 1 1 0 8 0 syncache 336 4 0 4 1 0 1 1 0 8 1 tcpcb 736 12 0 7 1 0 1 1 0 8 0 arp 96 17 0 0 1 0 1 1 0 8 0 inpcb 328 60 0 52 2 0 2 2 0 8 1 nd6 112 18 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 370 0 0 24 0 24 24 0 8 0 art_table 40 371 0 0 4 0 4 4 0 8 0 art_node 32 96 0 7 1 0 1 1 0 8 0 shmpl 112 1 0 0 1 0 1 1 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 1565 0 107 92 0 92 92 0 8 0 ffsino 256 1565 0 107 92 0 92 92 0 8 0 nchpl 144 1764 0 72 63 0 63 63 0 8 0 vnodes 216 1650 0 0 92 0 92 92 0 8 0 namei 1024 5144 0 5143 2 0 2 2 0 8 1 kstatmem 264 23 0 0 2 0 2 2 0 8 0 scxspl 216 5976 0 5976 5 0 5 5 1 8 5 plimitpl 152 29 0 13 1 0 1 1 0 8 0 sigapl 424 427 0 384 6 0 6 6 0 8 0 knotepl 120 2188 0 2141 2 0 2 2 0 8 0 kqueuepl 184 22 0 13 1 0 1 1 0 8 0 pipepl 304 122 0 95 3 0 3 3 0 8 0 fdescpl 448 414 0 385 5 0 5 5 0 8 1 filepl 120 1444 0 1235 7 0 7 7 0 8 0 lockfpl 104 10 0 8 1 0 1 1 0 8 0 lockfspl 48 5 0 3 1 0 1 1 0 8 0 sessionpl 144 23 0 15 1 0 1 1 0 8 0 pgrppl 48 31 0 15 1 0 1 1 0 8 0 ucredpl 104 89 0 78 1 0 1 1 0 8 0 zombiepl 144 386 0 384 1 0 1 1 0 8 0 processpl 1152 427 0 384 4 0 4 4 0 8 0 procpl 664 438 0 393 5 0 5 5 0 8 0 sockpl 552 136 0 108 3 0 3 3 0 8 0 mcl8k 8192 4 0 4 1 0 1 1 0 8 1 mcl4k 4096 2503 0 2450 14 0 14 14 0 8 6 mcl2k 2048 107 0 106 1 0 1 1 0 8 0 mextrefs 64 35 0 35 1 0 1 1 0 8 1 mtagpl 96 4 0 4 1 0 1 1 0 8 1 mbufpl 256 4103 0 3987 8 0 8 8 0 8 0 bufpl 272 2221 0 103 142 0 142 142 0 8 0 anonpl 24 91545 0 88562 22 0 22 22 0 187 2 amapchunkpl 152 7972 0 7583 17 0 17 17 0 158 0 amappl16 200 1668 0 1657 5 0 5 5 0 8 4 amappl15 192 5 0 5 1 0 1 1 0 8 1 amappl14 184 430 0 427 1 0 1 1 0 8 0 amappl13 176 112 0 101 1 0 1 1 0 8 0 amappl12 168 645 0 618 2 0 2 2 0 8 0 amappl11 160 4 0 4 1 0 1 1 0 8 1 amappl10 152 63 0 53 1 0 1 1 0 8 0 amappl9 144 289 0 289 1 0 1 1 0 8 1 amappl8 136 97 0 96 1 0 1 1 0 8 0 amappl7 128 138 0 126 1 0 1 1 0 8 0 amappl6 120 145 0 140 1 0 1 1 0 8 0 amappl5 112 92 0 85 1 0 1 1 0 8 0 amappl4 104 255 0 241 1 0 1 1 0 8 0 amappl3 96 1334 0 1257 3 0 3 3 0 8 0 amappl2 88 543 0 476 2 0 2 2 0 8 0 amappl1 80 9999 0 9422 14 0 14 14 0 8 1 amappl 88 2260 0 2124 4 0 4 4 0 92 0 uvmvnodes 80 96 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 253 0 253 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 3 0 0 1 0 1 1 0 8 0 uaddrrnd 24 414 0 385 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 414 0 385 1 0 1 1 0 8 0 vmmpekpl 168 5330 0 5291 2 0 2 2 0 8 0 vmmpepl 168 35941 0 34274 78 0 78 78 0 357 2 vmsppl 368 413 0 384 4 0 4 4 0 8 0 rwobjpl 40 13909 0 12954 11 0 11 11 0 8 0 pdppl 4096 834 0 768 96 14 82 82 0 8 16 pvpl 32 208827 0 201198 68 0 68 68 0 265 1 pmappl 216 413 0 384 3 0 3 3 0 8 0 extentpl 40 46 0 28 1 0 1 1 0 8 0 phpool 112 490 0 14 14 0 14 14 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(ffffffff834e658a) at panic+0x1cf sys/kern/subr_prf.c:198 amap_pp_adjref(fffff7806e645378,0,1,ffffffff) at amap_pp_adjref+0x74c sys/uvm/uvm_amap.c:883 amap_adjref_anons(fffff7806e645378,0,1,ffffffff,0) at amap_adjref_anons+0x22d sys/uvm/uvm_amap.c:1301 uvm_unmap_detach(ffff80002f0b1b60,0) at uvm_unmap_detach+0x8a sys/uvm/uvm_map.c:1359 uvm_map_teardown(fffff7806d19e5d0) at uvm_map_teardown+0x357 sys/uvm/uvm_map.c:2536 exit1(ffff80002a75aa78,0,0,1) at exit1+0x705 sys/kern/kern_exit.c:259 sys_exit(ffff80002a75aa78,ffff80002f0b1d20,ffff80002f0b1c70) at sys_exit+0x1a sys/kern/kern_exit.c:-1 syscall(ffff80002f0b1d20) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002f0b1d20) at syscall+0x962 sys/arch/amd64/amd64/trap.c:783 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7c76113fd610, count: -10 ddb> machine ddbcpu 1 No such command ddb> trace db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438 panic(ffffffff834e658a) at panic+0x1cf sys/kern/subr_prf.c:198 amap_pp_adjref(fffff7806e645378,0,1,ffffffff) at amap_pp_adjref+0x74c sys/uvm/uvm_amap.c:883 amap_adjref_anons(fffff7806e645378,0,1,ffffffff,0) at amap_adjref_anons+0x22d sys/uvm/uvm_amap.c:1301 uvm_unmap_detach(ffff80002f0b1b60,0) at uvm_unmap_detach+0x8a sys/uvm/uvm_map.c:1359 uvm_map_teardown(fffff7806d19e5d0) at uvm_map_teardown+0x357 sys/uvm/uvm_map.c:2536 exit1(ffff80002a75aa78,0,0,1) at exit1+0x705 sys/kern/kern_exit.c:259 sys_exit(ffff80002a75aa78,ffff80002f0b1d20,ffff80002f0b1c70) at sys_exit+0x1a sys/kern/kern_exit.c:-1 syscall(ffff80002f0b1d20) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002f0b1d20) at syscall+0x962 sys/arch/amd64/amd64/trap.c:783 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7c76113fd610, count: -10