panic: amap_pp_adjref: negative reference count
Stopped at db_enter+0x25: addq $0x8,%rsp
TID PID UID PRFLAGS PFLAGS CPU COMMAND
211577 81569 0 0x40 0 0 syz-executor
db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438
panic(ffffffff835269cc) at panic+0x1e5 sys/kern/subr_prf.c:198
amap_pp_adjref(fffff6806499b620,0,2,ffffffff) at amap_pp_adjref+0x74c sys/uvm/uvm_amap.c:883
amap_adjref_anons(fffff6806499b620,0,2,ffffffff,0) at amap_adjref_anons+0x22d sys/uvm/uvm_amap.c:1301
uvm_unmap_detach(ffff8000317ae0f0,0) at uvm_unmap_detach+0x8a sys/uvm/uvm_map.c:1359
uvm_map_teardown(fffff680788083e8) at uvm_map_teardown+0x360 sys/uvm/uvm_map.c:2536
exit1(ffff80002a22c2a8,0,0,1) at exit1+0x71b sys/kern/kern_exit.c:260
sys_exit(ffff80002a22c2a8,ffff8000317ae2c0,ffff8000317ae210) at sys_exit+0x1a sys/kern/kern_exit.c:-1
syscall(ffff8000317ae2c0) at syscall+0xb17 mi_syscall sys/sys/syscall_mi.h:176 [inline]
syscall(ffff8000317ae2c0) at syscall+0xb17 sys/arch/amd64/amd64/trap.c:791
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0x7a23e7418520, 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{1}>
ddb{1}> set $lines = 0
ddb{1}> set $maxwidth = 0
ddb{1}> show panic
*cpu1: amap_pp_adjref: negative reference count
ddb{1}> show kasan
No such command
ddb{1}> trace
db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438
panic(ffffffff835269cc) at panic+0x1e5 sys/kern/subr_prf.c:198
amap_pp_adjref(fffff6806499b620,0,2,ffffffff) at amap_pp_adjref+0x74c sys/uvm/uvm_amap.c:883
amap_adjref_anons(fffff6806499b620,0,2,ffffffff,0) at amap_adjref_anons+0x22d sys/uvm/uvm_amap.c:1301
uvm_unmap_detach(ffff8000317ae0f0,0) at uvm_unmap_detach+0x8a sys/uvm/uvm_map.c:1359
uvm_map_teardown(fffff680788083e8) at uvm_map_teardown+0x360 sys/uvm/uvm_map.c:2536
exit1(ffff80002a22c2a8,0,0,1) at exit1+0x71b sys/kern/kern_exit.c:260
sys_exit(ffff80002a22c2a8,ffff8000317ae2c0,ffff8000317ae210) at sys_exit+0x1a sys/kern/kern_exit.c:-1
syscall(ffff8000317ae2c0) at syscall+0xb17 mi_syscall sys/sys/syscall_mi.h:176 [inline]
syscall(ffff8000317ae2c0) at syscall+0xb17 sys/arch/amd64/amd64/trap.c:791
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0x7a23e7418520, count: -10
ddb{1}> show registers
rdi 0
rsi 0x1
rbp 0xffff8000317ade90
rbx 0xffff80002999ee0f
rdx 0
rcx 0xffff80002a22c2a8
rax 0xffff80002999dff0
r8 0x101010101010101
r9 0x8080808080808080
r10 0x9f645b60c1f9d44b
r11 0xea0ce0e936c9d743
r12 0xffff80002999ec10
r13 0
r14 0
r15 0x1
rip 0xffffffff81af5f75 db_enter+0x25
cs 0x8
rflags 0x246
rsp 0xffff8000317ade80
ss 0x10
db_enter+0x25: addq $0x8,%rsp
ddb{1}> show proc
PROC (ndp) tid=169844 pid=14320 tcnt=0 stat=onproc
flags process=10000a<EXEC,EXITING,PLEDGE> proc=2000<WEXIT>
runpri=78, usrpri=78, slppri=32, nice=20
wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=1
forw=0xffffffffffffffff, list=0xffff8000363a7788,0xffff80002a22c550
process=0xffff800045fe4ea8 user=0xffff8000317a9000, vmspace=0xfffff680788083e8
estcpu=36, cpticks=1, pctcpu=0.0, user=0, sys=0, intr=0
ddb{1}> ps
PID TID PPID UID S PRLAGS PFLAGS WAIT COMMAND
81569 211577 18285 0 7 0x40 0 syz-executor
88869 136496 91372 32767 2 0x10 0 syz-executor
88869 465699 91372 32767 3 0x10 0x4000080 fsleep syz-executor
76977 231055 62068 32767 2 0x10 0 syz-executor
76977 107912 62068 32767 3 0x10 0x4000080 fsleep syz-executor
76295 368102 99952 0 3 0x100002 0x88 sigsusp sh
99069 480092 74132 32767 2 0x10 0 syz-executor
99069 143673 74132 32767 3 0x10 0x4000080 kqsel syz-executor
18285 296899 56868 0 3 0x80 0 ppwait syz-executor
93895 173574 69437 32767 2 0x10 0 syz-executor
93895 362677 69437 32767 3 0x10 0x4000080 kqread syz-executor
93895 325973 69437 32767 3 0x10 0x4000080 fsleep syz-executor
93895 323582 69437 32767 3 0x10 0x4000080 fsleep syz-executor
93895 248075 69437 32767 2 0x10 0x4000000 syz-executor
56868 482742 85966 0 3 0x2 0x80 wait syz-executor
20582 234020 14920 32767 3 0x10 0x80 nanoslp syz-executor
20582 258647 14920 32767 3 0x10 0x4000080 sbwait syz-executor
20582 271343 14920 32767 3 0x10 0x4000080 fsleep syz-executor
99952 437625 42117 0 3 0 0x80 wait syz-executor
42117 39032 85966 0 3 0x2 0x80 wait syz-executor
4106 461945 55869 32767 2 0x10 0 syz-executor
69437 403337 98544 32767 2 0x10 0 syz-executor
98544 320279 85966 0 3 0x2 0x80 wait syz-executor
55869 506131 85966 0 3 0x2 0x80 wait syz-executor
14920 67102 4947 32767 3 0x10 0x80 nanoslp syz-executor
4947 359057 85966 0 3 0x2 0x80 wait syz-executor
91372 417712 32157 32767 3 0x10 0x80 nanoslp syz-executor
32157 172858 85966 0 3 0x2 0x80 wait syz-executor
62068 387769 54418 32767 3 0x10 0x80 nanoslp syz-executor
54418 327620 85966 0 3 0x2 0x80 wait syz-executor
74132 190875 12166 32767 3 0x10 0x80 nanoslp syz-executor
12166 379016 85966 0 3 0x2 0x80 wait syz-executor
85966 140965 20399 0 3 0x2 0x80 kqread syz-executor
20399 454644 67330 0 3 0x100002 0x88 sigsusp ksh
67330 276411 39497 0 3 0x10 0x88 kqread sshd-session
39497 277785 61427 0 3 0x12 0x80 kqread sshd-session
18831 480109 1 0 3 0x100003 0x80 ttyin getty
61427 412427 1 0 3 0 0x88 kqread sshd
63178 163502 11435 73 3 0x1100010 0x80 kqread syslogd
11435 298900 1 0 3 0x100002 0x80 sbwait syslogd
92087 489135 1 0 3 0x100000 0x80 kqread resolvd
97193 366408 36190 77 3 0x100012 0x80 kqread dhcpleased
82251 87608 36190 77 3 0x100012 0x80 kqread dhcpleased
36190 188985 1 0 3 0 0x80 kqread dhcpleased
25693 187897 0 0 3 0x14000 0x200 bored smr
48275 81976 0 0 2 0x14000 0x200 zerothread
78301 430866 0 0 3 0x14000 0x200 aiodoned aiodoned
14740 319984 0 0 3 0x14000 0x200 syncer update
32498 278153 0 0 3 0x14000 0x200 cleaner cleaner
69372 103829 0 0 2 0x14000 0x200 reaper
89681 471831 0 0 3 0x14000 0x200 pgdaemon pagedaemon
26037 147807 0 0 3 0x14000 0x200 bored viomb
90420 9758 0 0 3 0x14000 0x40000200 acpi0 acpi0
70820 48999 0 0 3 0x14000 0x40000200 idle1
70538 208765 0 0 3 0x14000 0x200 bored softnet1
67309 113687 0 0 3 0x14000 0x200 bored softnet0
7812 269368 0 0 3 0x14000 0x200 smrbar systqmp
87928 468928 0 0 3 0x14000 0x200 bored systq
99729 96170 0 0 3 0x14000 0x200 tmoslp softclockmp
94063 127859 0 0 3 0x14000 0x40000200 tmoslp softclock
87747 175254 0 0 3 0x14000 0x40000200 idle0
1 89957 0 0 3 0x2 0x80 wait init
0 0 -1 0 3 0x10000 0x200 scheduler swapper
ddb{1}> show all locks
Process 7812 (systqmp) thread 0xffff800045ffe7c8 (269368)
shared rwlock systqmp r = 0 (0xffffffff8391ed28)
#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{1}> show malloc
Type InUse MemUse HighUse Limit Requests Type Lim
devbuf 11052 12018K 12034K 166960K 12233 0
pcb 17 12K 12K 166960K 17 0
rtable 215 6K 7K 166960K 1235 0
pf 31 16K 16K 166960K 91 0
ifaddr 39 7K 7K 166960K 165 0
ifgroup 50 2K 2K 166960K 170 0
sysctl 1 1K 9K 166960K 6 0
counters 70 37K 37K 166960K 130 0
ioctlops 0 0K 4K 166960K 67 0
iov 0 0K 12K 166960K 15 0
mount 1 1K 1K 166960K 1 0
log 0 0K 0K 166960K 4 0
vnodes 1288 81K 81K 166960K 1637 0
UFS quota 1 32K 32K 166960K 1 0
UFS mount 5 36K 36K 166960K 5 0
shm 2 1K 9K 166960K 8 0
VM map 2 1K 1K 166960K 2 0
sem 15 1K 1K 166960K 17 0
dirhash 18 3K 3K 166960K 24 0
ACPI 1692 195K 286K 166960K 12470 0
file desc 25 93K 121K 166960K 823 0
sigio 0 0K 0K 166960K 1 0
proc 58 99K 163K 166960K 1357 0
subproc 72 4K 4K 166960K 342 0
NFS srvsock 1 0K 0K 166960K 1 0
NFS daemon 1 16K 16K 166960K 1 0
ip_moptions 0 0K 0K 166960K 21 0
in_multi 88 5K 6K 166960K 422 0
ether_multi 1 0K 0K 166960K 2 0
mrt 1 0K 0K 166960K 17 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 762 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 252 186K 199K 166960K 7607 0
UVM aobj 11 2K 2K 166960K 11 0
pinsyscall 46 92K 114K 166960K 2705 0
memdesc 1 4K 4K 166960K 1 0
crypto data 1 1K 1K 166960K 1 0
ip6_options 0 0K 0K 166960K 8 0
NDP 23 1K 2K 166960K 115 0
temp 41 9119K 9182K 166960K 7451 0
kqueue 14 20K 27K 166960K 63 0
SYN cache 2 16K 16K 166960K 2 0
ddb{1}> 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 116 0 113 1 0 1 1 0 8 0
rtentry 176 431 0 332 6 1 5 6 0 8 0
unpcb 144 284 0 263 3 0 3 3 0 8 2
syncache 336 6 0 6 2 1 1 1 0 8 1
tcpqe 32 3 0 3 2 1 1 1 0 8 1
tcpcb 736 216 0 209 7 2 5 7 0 8 4
arp 136 76 0 60 1 0 1 1 0 8 0
inpcb 328 643 0 630 7 0 7 7 0 8 5
ip6q 80 2 0 1 1 0 1 1 0 8 0
ip6af 40 4 0 3 1 0 1 1 0 8 0
nd6 152 112 0 91 1 0 1 1 0 8 0
kcovpl 48 38 0 30 1 0 1 1 0 8 0
art_heap8 4096 1 0 0 1 0 1 1 0 8 0
art_heap4 256 1750 0 1338 31 2 29 30 0 8 1
art_table 40 1751 0 1338 5 0 5 5 0 8 0
art_node 32 431 0 331 1 0 1 1 0 8 0
sysvmsgpl 40 5 0 2 1 0 1 1 0 8 0
semupl 112 1 0 1 1 0 1 1 0 8 1
semapl 72 14 0 1 1 0 1 1 0 8 0
shmpl 120 8 0 0 1 0 1 1 0 8 0
dirhash 1024 25 0 4 3 0 3 3 0 8 0
dino2pl 256 1900 0 355 97 0 97 97 0 8 0
ffsino 296 1900 0 355 119 0 119 119 0 8 0
nchpl 144 2379 0 594 67 0 67 67 0 8 0
vnodes 216 2251 0 0 126 0 126 126 0 8 0
namei 1024 12331 0 12331 4 3 1 2 0 8 1
percpumem 16 81 0 30 1 0 1 1 0 8 0
kstatmem 264 85 0 60 2 0 2 2 0 8 0
scxspl 216 8072 0 8072 4 3 1 3 1 8 1
plimitpl 152 284 0 257 2 0 2 2 0 8 0
sigapl 424 1065 0 1010 7 0 7 7 0 8 0
knotepl 120 108 0 0 4 0 4 4 0 8 0
kqueuepl 224 75 0 63 1 0 1 1 0 8 0
pipepl 344 240 0 213 4 1 3 4 0 8 0
fdescpl 528 1049 0 1012 3 0 3 3 0 8 0
filepl 160 4525 0 4296 15 0 15 15 0 8 5
lockfpl 104 125 0 122 1 0 1 1 0 8 0
lockfspl 48 28 0 25 1 0 1 1 0 8 0
sessionpl 144 63 0 46 1 0 1 1 0 8 0
pgrppl 48 106 0 81 1 0 1 1 0 8 0
ucredpl 104 437 0 420 1 0 1 1 0 8 0
zombiepl 144 1012 0 1010 1 0 1 1 0 8 0
processpl 1240 1065 0 1010 5 0 5 5 0 8 0
procpl 664 1475 0 1411 7 1 6 7 0 8 0
sosppl 176 1 0 1 1 0 1 1 0 8 1
sockpl 752 1043 0 1006 16 4 12 16 0 8 8
mcl64k 65536 4 0 0 1 0 1 1 0 8 0
mcl16k 16384 1 0 0 1 0 1 1 0 8 0
mcl8k 8192 2 0 0 1 0 1 1 0 8 0
mcl4k 4096 123 0 0 16 0 16 16 0 8 0
mcl2k2 2112 1 0 0 1 0 1 1 0 8 0
mcl2k 2048 38 0 0 5 0 5 5 0 8 0
mextrefs 64 35 0 0 1 0 1 1 0 8 0
mtagpl 96 4 0 0 1 0 1 1 0 8 0
mbufpl 256 326 0 0 21 0 21 21 0 8 0
bufpl 272 2722 0 102 175 0 175 175 0 8 0
anonpl 32 7362 0 0 60 0 60 60 0 247 0
amapchunkpl 152 22203 0 21686 36 3 33 36 0 158 11
amappl16 200 1768 0 1751 14 4 10 14 0 8 8
amappl15 192 3 0 3 1 1 0 1 0 8 0
amappl14 184 762 0 760 1 0 1 1 0 8 0
amappl13 176 176 0 165 1 0 1 1 0 8 0
amappl12 168 1402 0 1368 2 0 2 2 0 8 0
amappl11 160 3 0 3 1 1 0 1 0 8 0
amappl10 152 59 0 48 1 0 1 1 0 8 0
amappl9 144 290 0 290 1 1 0 1 0 8 0
amappl8 136 213 0 212 1 0 1 1 0 8 0
amappl7 128 202 0 189 1 0 1 1 0 8 0
amappl6 120 445 0 442 1 0 1 1 0 8 0
amappl5 112 106 0 98 1 0 1 1 0 8 0
amappl4 104 361 0 343 1 0 1 1 0 8 0
amappl3 96 3854 0 3756 5 1 4 4 0 8 1
amappl2 88 1077 0 1000 3 0 3 3 0 8 1
amappl1 80 15801 0 15217 19 2 17 17 0 8 2
amappl 88 6358 0 6179 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 10 0 0 1 0 1 1 0 8 0
uaddrrnd 24 1049 0 1012 1 0 1 1 0 8 0
uaddrbest 32 2 0 0 1 0 1 1 0 8 0
uaddr 24 1049 0 1012 1 0 1 1 0 8 0
vmmpekpl 168 10101 0 10034 4 0 4 4 0 8 0
vmmpepl 168 75611 0 73546 106 2 104 104 0 357 11
vmsppl 488 1048 0 1010 7 1 6 6 0 8 0
rwobjpl 80 23715 0 22728 27 1 26 27 0 8 2
pdppl 4096 2105 0 2020 137 44 93 95 0 8 8
pvpl 32 15292 0 0 124 0 124 124 0 265 0
pmappl 256 1048 0 1010 4 1 3 3 0 8 0
extentpl 40 45 0 27 1 0 1 1 0 8 0
phpool 112 509 0 55 13 0 13 13 0 8 0
ddb{1}> machine ddbcpu 0
Stopped at x86_ipi_db+0x27: addq $0x8,%rsp
x86_ipi_db(ffffffff839dfff0) 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
__mp_lock(ffffffff83adbb00) at __mp_lock+0x192 __mp_lock_spin sys/kern/kern_lock.c:142 [inline]
__mp_lock(ffffffff83adbb00) at __mp_lock+0x192 sys/kern/kern_lock.c:173
syscall(ffff80002ef78e80) at syscall+0xaf4 mi_syscall sys/sys/syscall_mi.h:175 [inline]
syscall(ffff80002ef78e80) at syscall+0xaf4 sys/arch/amd64/amd64/trap.c:791
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0x7cbc8fe567a0, count: 9
ddb{0}> trace
x86_ipi_db(ffffffff839dfff0) 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
__mp_lock(ffffffff83adbb00) at __mp_lock+0x192 __mp_lock_spin sys/kern/kern_lock.c:142 [inline]
__mp_lock(ffffffff83adbb00) at __mp_lock+0x192 sys/kern/kern_lock.c:173
syscall(ffff80002ef78e80) at syscall+0xaf4 mi_syscall sys/sys/syscall_mi.h:175 [inline]
syscall(ffff80002ef78e80) at syscall+0xaf4 sys/arch/amd64/amd64/trap.c:791
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0x7cbc8fe567a0, count: -6
ddb{0}> machine ddbcpu 1
Stopped at db_enter+0x25: addq $0x8,%rsp
db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438
panic(ffffffff835269cc) at panic+0x1e5 sys/kern/subr_prf.c:198
amap_pp_adjref(fffff6806499b620,0,2,ffffffff) at amap_pp_adjref+0x74c sys/uvm/uvm_amap.c:883
amap_adjref_anons(fffff6806499b620,0,2,ffffffff,0) at amap_adjref_anons+0x22d sys/uvm/uvm_amap.c:1301
uvm_unmap_detach(ffff8000317ae0f0,0) at uvm_unmap_detach+0x8a sys/uvm/uvm_map.c:1359
uvm_map_teardown(fffff680788083e8) at uvm_map_teardown+0x360 sys/uvm/uvm_map.c:2536
exit1(ffff80002a22c2a8,0,0,1) at exit1+0x71b sys/kern/kern_exit.c:260
sys_exit(ffff80002a22c2a8,ffff8000317ae2c0,ffff8000317ae210) at sys_exit+0x1a sys/kern/kern_exit.c:-1
syscall(ffff8000317ae2c0) at syscall+0xb17 mi_syscall sys/sys/syscall_mi.h:176 [inline]
syscall(ffff8000317ae2c0) at syscall+0xb17 sys/arch/amd64/amd64/trap.c:791
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0x7a23e7418520, count: 5
ddb{1}> trace
db_enter() at db_enter+0x25 sys/arch/amd64/amd64/db_interface.c:438
panic(ffffffff835269cc) at panic+0x1e5 sys/kern/subr_prf.c:198
amap_pp_adjref(fffff6806499b620,0,2,ffffffff) at amap_pp_adjref+0x74c sys/uvm/uvm_amap.c:883
amap_adjref_anons(fffff6806499b620,0,2,ffffffff,0) at amap_adjref_anons+0x22d sys/uvm/uvm_amap.c:1301
uvm_unmap_detach(ffff8000317ae0f0,0) at uvm_unmap_detach+0x8a sys/uvm/uvm_map.c:1359
uvm_map_teardown(fffff680788083e8) at uvm_map_teardown+0x360 sys/uvm/uvm_map.c:2536
exit1(ffff80002a22c2a8,0,0,1) at exit1+0x71b sys/kern/kern_exit.c:260
sys_exit(ffff80002a22c2a8,ffff8000317ae2c0,ffff8000317ae210) at sys_exit+0x1a sys/kern/kern_exit.c:-1
syscall(ffff8000317ae2c0) at syscall+0xb17 mi_syscall sys/sys/syscall_mi.h:176 [inline]
syscall(ffff8000317ae2c0) at syscall+0xb17 sys/arch/amd64/amd64/trap.c:791
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0x7a23e7418520, count: -10