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(ffffffff83513e16) at panic+0x1cf sys/kern/subr_prf.c:198
amap_pp_adjref(fffff9800a1c3898,0,1,ffffffff) at amap_pp_adjref+0x74c sys/uvm/uvm_amap.c:883
amap_adjref_anons(fffff9800a1c3898,0,1,ffffffff,0) at amap_adjref_anons+0x22d sys/uvm/uvm_amap.c:1301
uvm_unmap_detach(ffff80002a768ef0,0) at uvm_unmap_detach+0x8a sys/uvm/uvm_map.c:1359
uvm_map_teardown(fffff9807f21b2e0) at uvm_map_teardown+0x357 sys/uvm/uvm_map.c:2536
exit1(ffff80002a7267d0,0,e,1) at exit1+0x705 sys/kern/kern_exit.c:259
sigexit(ffff80002a7267d0,e) at sigexit+0x115
postsig(ffff80002a7267d0,e,ffff80002a769118) at postsig+0x686 sys/kern/kern_sig.c:1764
userret(ffff80002a7267d0) at userret+0x23e sys/kern/kern_sig.c:2208
syscall(ffff80002a769240) at syscall+0xa56 mi_syscall_return sys/sys/syscall_mi.h:203 [inline]
syscall(ffff80002a769240) at syscall+0xa56 sys/arch/amd64/amd64/trap.c:812
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0x7b333cd0fa10, 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(ffffffff83513e16) at panic+0x1cf sys/kern/subr_prf.c:198
amap_pp_adjref(fffff9800a1c3898,0,1,ffffffff) at amap_pp_adjref+0x74c sys/uvm/uvm_amap.c:883
amap_adjref_anons(fffff9800a1c3898,0,1,ffffffff,0) at amap_adjref_anons+0x22d sys/uvm/uvm_amap.c:1301
uvm_unmap_detach(ffff80002a768ef0,0) at uvm_unmap_detach+0x8a sys/uvm/uvm_map.c:1359
uvm_map_teardown(fffff9807f21b2e0) at uvm_map_teardown+0x357 sys/uvm/uvm_map.c:2536
exit1(ffff80002a7267d0,0,e,1) at exit1+0x705 sys/kern/kern_exit.c:259
sigexit(ffff80002a7267d0,e) at sigexit+0x115
postsig(ffff80002a7267d0,e,ffff80002a769118) at postsig+0x686 sys/kern/kern_sig.c:1764
userret(ffff80002a7267d0) at userret+0x23e sys/kern/kern_sig.c:2208
syscall(ffff80002a769240) at syscall+0xa56 mi_syscall_return sys/sys/syscall_mi.h:203 [inline]
syscall(ffff80002a769240) at syscall+0xa56 sys/arch/amd64/amd64/trap.c:812
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0x7b333cd0fa10, count: -12
ddb> show registers
rdi 0
rsi 0x1
rbp 0xffff80002a768ca0
rbx 0xffff800000c557f0
rdx 0
rcx 0
rax 0xffff80002a7267d0
r8 0x101010101010101
r9 0x8080808080808080
r10 0x9ccfe0452d576734
r11 0x1dd9b3c3716801cd
r12 0
r13 0x1
r14 0
r15 0x1
rip 0xffffffff8243ba85 db_enter+0x25
cs 0x8
rflags 0x246
rsp 0xffff80002a768c90
ss 0x10
db_enter+0x25: addq $0x8,%rsp
ddb> show proc
PROC (dhcpleased) tid=435339 pid=79395 tcnt=0 stat=onproc
flags process=10001a<EXEC,EXITING,SUGID,PLEDGE> proc=2000<WEXIT>
runpri=24, usrpri=50, slppri=24, nice=20
wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=1
forw=0xffffffffffffffff, list=0xffff80002a726f98,0xffff80002a7514e0
process=0xffff80002a735fc0 user=0xffff80002a764000, vmspace=0xfffff9807f21b2e0
estcpu=0, cpticks=0, pctcpu=0.0, user=0, sys=0, intr=0
ddb> ps
PID TID PPID UID S PRLAGS PFLAGS WAIT COMMAND
84858 282285 13350 0 3 0x2 0 clonelk ifconfig
13350 307752 89118 0 3 0x100002 0x88 sigsusp sh
90520 275479 79053 0 2 0 0 syz-executor
90520 335493 79053 0 3 0 0x4000080 bell syz-executor
73114 271589 75916 0 2 0 0 syz-executor
73114 280854 75916 0 2 0 0x4000000 syz-executor
73114 298906 75916 0 3 0 0x4000080 fsleep syz-executor
89118 301476 37962 0 3 0x2 0x80 wait syz-executor
64630 50572 7723 0 3 0x2 0 clonelk ifconfig
7723 179650 38123 0 3 0x100002 0x88 sigsusp sh
38123 376060 37962 0 3 0x2 0x80 wait syz-executor
27680 64384 37962 0 3 0x2 0 clonelk syz-executor
75916 342294 37962 0 2 0x2 0xc80 syz-executor
7199 237502 37962 0 3 0x2 0x80 piperd syz-executor
96655 499077 0 0 3 0x14000 0x280 nfsidl nfsio
90120 383208 0 0 3 0x14000 0x280 nfsidl nfsio
36997 469938 0 0 3 0x14000 0x280 nfsidl nfsio
64133 197464 0 0 3 0x14000 0x280 nfsidl nfsio
21270 337166 0 0 3 0x14000 0x280 nfsidl nfsio
450 213988 0 0 3 0x14000 0x280 nfsidl nfsio
50491 385223 0 0 3 0x14000 0x280 nfsidl nfsio
9258 260049 0 0 3 0x14000 0x280 nfsidl nfsio
93042 389106 0 0 3 0x14000 0x280 nfsidl nfsio
78168 313659 0 0 3 0x14000 0x280 nfsidl nfsio
79936 130799 0 0 3 0x14000 0x280 nfsidl nfsio
68528 507876 0 0 3 0x14000 0x280 nfsidl nfsio
57024 516158 0 0 3 0x14000 0x280 nfsidl nfsio
57901 257919 0 0 3 0x14000 0x280 nfsidl nfsio
69481 353432 0 0 3 0x14000 0x280 nfsidl nfsio
54183 338793 0 0 3 0x14000 0x280 nfsidl nfsio
99096 116666 0 0 3 0x14000 0x280 nfsidl nfsio
69549 277006 0 0 3 0x14000 0x280 nfsidl nfsio
54881 177714 0 0 3 0x14000 0x280 nfsidl nfsio
6481 259187 0 0 3 0x14000 0x280 nfsidl nfsio
79053 493507 37962 0 2 0x2 0xc80 syz-executor
37962 513492 64170 0 3 0x2 0x80 nanoslp syz-executor
64170 129569 1 0 2 0x100002 0x88 ksh
40998 143234 1 0 2 0x10000000 0x80 dhcpleased
99182 253626 0 0 3 0x14000 0x200 bored smr
79200 118676 0 0 2 0x14000 0x200 zerothread
80853 303507 0 0 3 0x14000 0x200 aiodoned aiodoned
48745 259512 0 0 3 0x14000 0x200 syncer update
67990 25610 0 0 3 0x14000 0x200 cleaner cleaner
47345 330557 0 0 3 0x14000 0x200 reaper reaper
26194 215825 0 0 3 0x14000 0x200 pgdaemon pagedaemon
80614 177147 0 0 3 0x14000 0x200 bored viomb
35473 55264 0 0 3 0x14000 0x40000200 acpi0 acpi0
82274 283591 0 0 2 0x14000 0x200 softnet0
21634 326386 0 0 3 0x14000 0x200 smrbar systqmp
92507 377846 0 0 3 0x14000 0x200 bored systq
57235 251794 0 0 3 0x14000 0x40000200 tmoslp softclock
51651 442506 0 0 3 0x14000 0x40000200 idle0
1 321951 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 11022 12104K 12257K 166960K 12470 0
pcb 17 13K 13K 166960K 77 0
rtable 161 5K 7K 166960K 2130 0
pf 22 11K 19K 166960K 242 0
ifaddr 26 5K 7K 166960K 287 0
ifgroup 34 1K 2K 166960K 298 0
sysctl 1 1K 9K 166960K 6 0
counters 29 17K 17K 166960K 96 0
ioctlops 0 0K 4K 166960K 190 0
iov 0 0K 12K 166960K 10 0
mount 1 1K 1K 166960K 1 0
log 0 0K 0K 166960K 4 0
vnodes 1324 83K 83K 166960K 2141 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 17 1K 1K 166960K 20 0
dirhash 15 2K 2K 166960K 24 0
ACPI 1692 195K 286K 166960K 12470 0
file desc 14 53K 89K 166960K 1297 0
sigio 0 0K 0K 166960K 2 0
proc 31 42K 92K 166960K 2179 0
subproc 63 3K 4K 166960K 621 0
NFS srvsock 1 0K 0K 166960K 1 0
NFS daemon 1 16K 16K 166960K 1 0
ip_moptions 0 0K 0K 166960K 15 0
in_multi 55 3K 6K 166960K 741 0
ether_multi 1 0K 0K 166960K 1 0
mrt 0 0K 0K 166960K 21 0
ISOFS mount 1 32K 32K 166960K 1 0
MSDOSFS mount 1 16K 16K 166960K 1 0
ttys 61 281K 281K 166960K 61 0
exec 0 0K 1K 166960K 1174 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 108 96K 174K 166960K 10081 0
UVM aobj 5 2K 2K 166960K 8 0
pinsyscall 18 36K 92K 166960K 3927 0
memdesc 1 4K 4K 166960K 1 0
crypto data 1 1K 1K 166960K 1 0
ip6_options 0 0K 0K 166960K 7 0
NDP 7 0K 2K 166960K 206 0
temp 30 9114K 9178K 166960K 23071 0
kqueue 3 4K 28K 166960K 57 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 164 0 163 1 0 1 1 0 8 0
rtentry 136 751 0 685 4 0 4 4 0 8 0
unpcb 144 157 0 155 1 0 1 1 0 8 0
syncache 336 5 0 5 1 0 1 1 0 8 1
tcpcb 736 87 0 85 4 0 4 4 0 8 3
arp 96 134 0 124 1 0 1 1 0 8 0
inpcb 328 668 0 663 12 3 9 12 0 8 8
ip6q 80 1 0 0 1 0 1 1 0 8 0
ip6af 40 1 0 0 1 0 1 1 0 8 0
nd6 112 200 0 188 1 0 1 1 0 8 0
pkpcb 40 2 0 2 1 0 1 1 0 8 1
kcovpl 48 69 0 62 1 0 1 1 0 8 0
ppxss 1072 3 0 3 1 0 1 1 0 8 1
pfanchor 1288 4 0 0 1 0 1 1 0 8 0
pfrule 1360 33 0 33 1 0 1 1 0 8 1
art_heap8 4096 1 0 0 1 0 1 1 0 8 0
art_heap4 256 3053 0 2726 34 5 29 32 0 8 5
art_table 40 3054 0 2726 6 0 6 6 0 8 1
art_node 32 751 0 691 1 0 1 1 0 8 0
semupl 112 1 0 1 1 0 1 1 0 8 1
semapl 72 17 0 2 1 0 1 1 0 8 0
shmpl 120 4 0 2 1 0 1 1 0 8 0
dirhash 1024 25 0 6 3 0 3 3 0 8 0
dino2pl 256 2179 0 578 101 0 101 101 0 8 0
ffsino 256 2179 0 578 101 0 101 101 0 8 0
nchpl 144 2756 0 820 72 0 72 72 0 8 0
vnodes 216 2924 0 0 163 0 163 163 0 8 0
namei 1024 16820 0 16820 3 0 3 3 0 8 3
vcpupl 3968 16 0 16 2 0 2 2 0 8 2
vmpool 808 1 0 1 1 0 1 1 0 8 1
kstatmem 264 149 0 134 2 0 2 2 0 8 0
scsiplug 72 1 0 1 1 0 1 1 0 8 1
scxspl 216 9360 0 9360 8 0 8 8 1 8 8
plimitpl 152 124 0 109 1 0 1 1 0 8 0
sigapl 424 1493 0 1433 8 0 8 8 0 8 0
knotepl 120 11882 0 11860 10 0 10 10 0 8 6
kqueuepl 184 142 0 140 4 0 4 4 0 8 3
pipepl 304 321 0 294 3 0 3 3 0 8 0
fdescpl 448 1460 0 1442 5 0 5 5 0 8 1
filepl 120 5643 0 5465 11 0 11 11 0 8 4
lockfpl 104 136 0 135 1 0 1 1 0 8 0
lockfspl 48 62 0 61 1 0 1 1 0 8 0
sessionpl 144 98 0 90 1 0 1 1 0 8 0
pgrppl 48 171 0 156 1 0 1 1 0 8 0
ucredpl 104 386 0 375 1 0 1 1 0 8 0
zombiepl 144 1443 0 1433 1 0 1 1 0 8 0
processpl 1160 1493 0 1433 5 0 5 5 0 8 0
procpl 664 2004 0 1941 7 0 7 7 0 8 1
sockpl 552 997 0 989 12 2 10 12 0 8 8
mcl64k 65536 15 0 14 1 0 1 1 0 8 0
mcl16k 16384 3 0 3 1 0 1 1 0 8 1
mcl12k 12288 7 0 7 1 0 1 1 0 8 1
mcl9k128 9344 5 0 5 1 0 1 1 0 8 1
mcl8k 8192 9 0 9 1 0 1 1 0 8 1
mcl4k 4096 2834 0 2770 15 0 15 15 0 8 6
mcl2k 2048 1346 0 1345 2 0 2 2 0 8 1
mextrefs 64 289 0 289 1 0 1 1 0 8 1
mtagpl 96 4 0 4 1 0 1 1 0 8 1
mbufpl 256 10928 0 10817 12 0 12 12 0 8 1
bufpl 272 2983 0 104 192 0 192 192 0 8 0
anonpl 24 198491 0 196957 37 0 37 37 0 187 17
amapchunkpl 152 29628 0 29370 31 0 31 31 0 158 17
amappl16 200 1778 0 1768 5 0 5 5 0 8 4
amappl15 192 4 0 4 1 0 1 1 0 8 1
amappl14 184 1114 0 1111 1 0 1 1 0 8 0
amappl13 176 240 0 238 1 0 1 1 0 8 0
amappl12 168 2009 0 1993 2 0 2 2 0 8 0
amappl11 160 44 0 44 1 0 1 1 0 8 1
amappl10 152 62 0 58 1 0 1 1 0 8 0
amappl9 144 275 0 275 1 0 1 1 0 8 1
amappl8 136 329 0 327 1 0 1 1 0 8 0
amappl7 128 259 0 256 1 0 1 1 0 8 0
amappl6 120 734 0 729 1 0 1 1 0 8 0
amappl5 112 103 0 101 1 0 1 1 0 8 0
amappl4 104 431 0 429 1 0 1 1 0 8 0
amappl3 96 5234 0 5185 3 0 3 3 0 8 1
amappl2 88 1349 0 1324 2 0 2 2 0 8 0
amappl1 80 18831 0 18686 13 0 13 13 0 8 7
amappl 88 8360 0 8275 5 0 5 5 0 92 1
uvmvnodes 80 104 0 0 3 0 3 3 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 7 0 3 1 0 1 1 0 8 0
uaddrrnd 24 1460 0 1442 1 0 1 1 0 8 0
uaddrbest 32 2 0 0 1 0 1 1 0 8 0
uaddr 24 1460 0 1442 1 0 1 1 0 8 0
vmmpekpl 168 12627 0 12575 3 0 3 3 0 8 0
vmmpepl 168 100668 0 99951 82 0 82 82 0 357 35
vmsppl 368 1459 0 1441 4 0 4 4 0 8 1
rwobjpl 40 29585 0 29134 11 0 11 11 0 8 0
pdppl 4096 2928 0 2884 160 100 60 78 0 8 16
pvpl 32 555153 0 551739 96 0 96 96 0 265 45
pmappl 216 1460 0 1442 2 0 2 2 0 8 0
extentpl 40 45 0 27 1 0 1 1 0 8 0
phpool 112 646 0 105 16 0 16 16 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(ffffffff83513e16) at panic+0x1cf sys/kern/subr_prf.c:198
amap_pp_adjref(fffff9800a1c3898,0,1,ffffffff) at amap_pp_adjref+0x74c sys/uvm/uvm_amap.c:883
amap_adjref_anons(fffff9800a1c3898,0,1,ffffffff,0) at amap_adjref_anons+0x22d sys/uvm/uvm_amap.c:1301
uvm_unmap_detach(ffff80002a768ef0,0) at uvm_unmap_detach+0x8a sys/uvm/uvm_map.c:1359
uvm_map_teardown(fffff9807f21b2e0) at uvm_map_teardown+0x357 sys/uvm/uvm_map.c:2536
exit1(ffff80002a7267d0,0,e,1) at exit1+0x705 sys/kern/kern_exit.c:259
sigexit(ffff80002a7267d0,e) at sigexit+0x115
postsig(ffff80002a7267d0,e,ffff80002a769118) at postsig+0x686 sys/kern/kern_sig.c:1764
userret(ffff80002a7267d0) at userret+0x23e sys/kern/kern_sig.c:2208
syscall(ffff80002a769240) at syscall+0xa56 mi_syscall_return sys/sys/syscall_mi.h:203 [inline]
syscall(ffff80002a769240) at syscall+0xa56 sys/arch/amd64/amd64/trap.c:812
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0x7b333cd0fa10, 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(ffffffff83513e16) at panic+0x1cf sys/kern/subr_prf.c:198
amap_pp_adjref(fffff9800a1c3898,0,1,ffffffff) at amap_pp_adjref+0x74c sys/uvm/uvm_amap.c:883
amap_adjref_anons(fffff9800a1c3898,0,1,ffffffff,0) at amap_adjref_anons+0x22d sys/uvm/uvm_amap.c:1301
uvm_unmap_detach(ffff80002a768ef0,0) at uvm_unmap_detach+0x8a sys/uvm/uvm_map.c:1359
uvm_map_teardown(fffff9807f21b2e0) at uvm_map_teardown+0x357 sys/uvm/uvm_map.c:2536
exit1(ffff80002a7267d0,0,e,1) at exit1+0x705 sys/kern/kern_exit.c:259
sigexit(ffff80002a7267d0,e) at sigexit+0x115
postsig(ffff80002a7267d0,e,ffff80002a769118) at postsig+0x686 sys/kern/kern_sig.c:1764
userret(ffff80002a7267d0) at userret+0x23e sys/kern/kern_sig.c:2208
syscall(ffff80002a769240) at syscall+0xa56 mi_syscall_return sys/sys/syscall_mi.h:203 [inline]
syscall(ffff80002a769240) at syscall+0xa56 sys/arch/amd64/amd64/trap.c:812
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0x7b333cd0fa10, count: -12