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(ffffffff834e357d) at panic+0x1cf sys/kern/subr_prf.c:198 amap_pp_adjref(fffff30066df3610,0,2,ffffffff) at amap_pp_adjref+0x74c sys/uvm/uvm_amap.c:880 amap_adjref_anons(fffff30066df3610,0,2,ffffffff,0) at amap_adjref_anons+0x22d sys/uvm/uvm_amap.c:1298 uvm_unmap_detach(ffff80002a7a4f70,0) at uvm_unmap_detach+0x8a sys/uvm/uvm_map.c:1359 uvm_map_teardown(fffff3006dafbb90) at uvm_map_teardown+0x357 sys/uvm/uvm_map.c:2536 exit1(ffff80002a736a68,0,0,1) at exit1+0x705 sys/kern/kern_exit.c:259 sys_exit(ffff80002a736a68,ffff80002a7a5130,ffff80002a7a5080) at sys_exit+0x1a sys/kern/kern_exit.c:-1 syscall(ffff80002a7a5130) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002a7a5130) at syscall+0x962 sys/arch/amd64/amd64/trap.c:783 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7be9c7822320, 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(ffffffff834e357d) at panic+0x1cf sys/kern/subr_prf.c:198 amap_pp_adjref(fffff30066df3610,0,2,ffffffff) at amap_pp_adjref+0x74c sys/uvm/uvm_amap.c:880 amap_adjref_anons(fffff30066df3610,0,2,ffffffff,0) at amap_adjref_anons+0x22d sys/uvm/uvm_amap.c:1298 uvm_unmap_detach(ffff80002a7a4f70,0) at uvm_unmap_detach+0x8a sys/uvm/uvm_map.c:1359 uvm_map_teardown(fffff3006dafbb90) at uvm_map_teardown+0x357 sys/uvm/uvm_map.c:2536 exit1(ffff80002a736a68,0,0,1) at exit1+0x705 sys/kern/kern_exit.c:259 sys_exit(ffff80002a736a68,ffff80002a7a5130,ffff80002a7a5080) at sys_exit+0x1a sys/kern/kern_exit.c:-1 syscall(ffff80002a7a5130) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002a7a5130) at syscall+0x962 sys/arch/amd64/amd64/trap.c:783 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7be9c7822320, count: -10 ddb> show registers rdi 0 rsi 0x1 rbp 0xffff80002a7a4d20 rbx 0xffff800000c57890 rdx 0 rcx 0 rax 0xffff80002a736a68 r8 0x101010101010101 r9 0x8080808080808080 r10 0x18dbf8b27a34ae7a r11 0xe15068d0531252c0 r12 0 r13 0x2 r14 0 r15 0x1 rip 0xffffffff82b35015 db_enter+0x25 cs 0x8 rflags 0x246 rsp 0xffff80002a7a4d10 ss 0x10 db_enter+0x25: addq $0x8,%rsp ddb> show proc PROC (ndp) tid=523009 pid=44261 tcnt=0 stat=onproc flags process=10000a proc=2000 runpri=66, usrpri=66, slppri=32, nice=20 wchan=0x0, wmesg=, ps_single=0x0 scnt=0 ecnt=1 forw=0xffffffffffffffff, list=0xffff80002a736538,0xffff80002a736d10 process=0xffff80002a747188 user=0xffff80002a7a0000, vmspace=0xfffff3006dafbb90 estcpu=36, cpticks=0, pctcpu=0.0, user=0, sys=0, intr=0 ddb> ps PID TID PPID UID S PRLAGS PFLAGS WAIT COMMAND 9848 61995 78452 0 2 0 0 syz-executor 9848 412535 78452 0 2 0 0x4000000 syz-executor 4083 330987 5010 0 3 0x100002 0x88 sigsusp sh 92567 178053 22605 0 2 0 0 syz-executor 92567 356555 22605 0 3 0 0x4000080 ttyin syz-executor 42483 402685 37716 0 2 0 0 syz-executor 19975 22569 18292 0 2 0 0 syz-executor 19975 167729 18292 0 3 0 0x4000080 fsleep syz-executor 53925 205814 58582 0 2 0 0 syz-executor 53925 266775 58582 0 3 0 0x4000080 fsleep syz-executor 56022 483948 28694 0 3 0 0x80 nanoslp syz-executor 56022 366085 28694 0 3 0 0x4000080 bell syz-executor 56022 521043 28694 0 3 0 0x4000080 kqpoll syz-executor 56022 185897 28694 0 3 0 0x4000080 fsleep syz-executor 33533 361193 5592 -1 3 0x10 0x80 nanoslp syz-executor 33533 224410 5592 -1 2 0x10 0x4000000 syz-executor 33533 342530 5592 -1 3 0x10 0x4000080 fsleep syz-executor 5010 194734 79836 0 3 0x2 0x80 wait syz-executor 4969 481432 1 0 3 0x100003 0x80 ttyin getty 74750 48610 0 0 3 0x14000 0x280 nfsidl nfsio 98001 107077 0 0 3 0x14000 0x280 nfsidl nfsio 74986 229394 0 0 3 0x14000 0x280 nfsidl nfsio 35459 403419 0 0 3 0x14000 0x280 nfsidl nfsio 5164 458082 0 0 3 0x14000 0x280 nfsidl nfsio 53996 380369 0 0 3 0x14000 0x280 nfsidl nfsio 33361 326971 0 0 3 0x14000 0x280 nfsidl nfsio 79041 228532 0 0 3 0x14000 0x280 nfsidl nfsio 78946 317091 0 0 3 0x14000 0x280 nfsidl nfsio 42355 447326 0 0 3 0x14000 0x280 nfsidl nfsio 63107 64929 0 0 3 0x14000 0x280 nfsidl nfsio 37990 70461 0 0 3 0x14000 0x280 nfsidl nfsio 88674 68216 0 0 3 0x14000 0x280 nfsidl nfsio 32875 311475 0 0 3 0x14000 0x280 nfsidl nfsio 4985 381232 0 0 3 0x14000 0x280 nfsidl nfsio 81777 73041 0 0 3 0x14000 0x280 nfsidl nfsio 51796 128647 0 0 3 0x14000 0x280 nfsidl nfsio 19436 325896 0 0 3 0x14000 0x280 nfsidl nfsio 89004 367539 0 0 3 0x14000 0x280 nfsidl nfsio 91253 436438 0 0 3 0x14000 0x280 nfsidl nfsio 22605 524052 79836 0 3 0x2 0x80 nanoslp syz-executor 78452 380583 79836 0 3 0x2 0x80 nanoslp syz-executor 37716 385875 79836 0 3 0x2 0x80 nanoslp syz-executor 18292 333022 79836 0 3 0x2 0x80 nanoslp syz-executor 28694 506133 79836 0 3 0x2 0x80 nanoslp syz-executor 58582 256637 79836 0 3 0x2 0x80 nanoslp syz-executor 5592 248353 79836 0 3 0x2 0x80 nanoslp syz-executor 79836 88690 1 0 3 0x2 0x80 kqread syz-executor 75592 283293 0 0 3 0x14000 0x200 bored smr 77960 322542 0 0 2 0x14000 0x200 zerothread 29231 493850 0 0 3 0x14000 0x200 aiodoned aiodoned 53128 4823 0 0 3 0x14000 0x200 syncer update 14330 460178 0 0 3 0x14000 0x200 cleaner cleaner 44061 204907 0 0 3 0x14000 0x200 reaper reaper 10238 32766 0 0 3 0x14000 0x200 pgdaemon pagedaemon 42815 185343 0 0 3 0x14000 0x200 bored viomb 86368 278185 0 0 3 0x14000 0x40000200 acpi0 acpi0 52249 442065 0 0 3 0x14000 0x200 bored softnet0 59174 51693 0 0 3 0x14000 0x200 smrbar systqmp 6778 214723 0 0 3 0x14000 0x200 bored systq 41299 201374 0 0 3 0x14000 0x40000200 tmoslp softclock 74120 344152 0 0 3 0x14000 0x40000200 idle0 1 73545 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 11072 12246K 12338K 166960K 12448 0 pcb 18 12K 12K 166960K 68 0 rtable 245 8K 11K 166960K 711 0 pf 32 13K 18K 166960K 108 0 ifaddr 41 7K 7K 166960K 92 0 ifgroup 50 2K 2K 166960K 115 0 sysctl 3 1K 9K 166960K 9 0 counters 33 17K 18K 166960K 60 0 ioctlops 0 0K 4K 166960K 117 0 iov 1 16K 16K 166960K 16 0 mount 1 1K 1K 166960K 1 0 log 0 0K 0K 166960K 4 0 vnodes 1304 82K 82K 166960K 1744 0 UFS quota 1 32K 32K 166960K 1 0 UFS mount 5 36K 36K 166960K 5 0 shm 2 1K 5K 166960K 6 0 VM map 2 1K 1K 166960K 2 0 sem 11 0K 0K 166960K 16 0 dirhash 12 2K 2K 166960K 15 0 ACPI 1734 201K 291K 166960K 11964 0 file desc 17 65K 102K 166960K 554 0 sigio 0 0K 0K 166960K 70 0 proc 20 25K 124K 166960K 798 0 subproc 72 4K 4K 166960K 155 0 NFS srvsock 1 0K 0K 166960K 1 0 NFS daemon 1 16K 16K 166960K 1 0 ip_moptions 0 0K 0K 166960K 16 0 in_multi 95 6K 6K 166960K 200 0 ether_multi 1 0K 0K 166960K 1 0 mrt 0 0K 0K 166960K 17 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 584 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 138 84K 164K 166960K 5918 0 UVM aobj 10 2K 4K 166960K 11 0 pinsyscall 20 40K 96K 166960K 1885 0 memdesc 1 4K 4K 166960K 1 0 crypto data 1 1K 1K 166960K 1 0 ip6_options 0 0K 0K 166960K 10 0 NDP 13 0K 2K 166960K 64 0 temp 76 9120K 9179K 166960K 8082 0 kqueue 2 4K 26K 166960K 80 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 74 0 74 1 0 1 1 0 8 1 rtentry 136 212 0 105 4 0 4 4 0 8 0 unpcb 144 323 0 319 6 0 6 6 0 8 5 syncache 336 6 0 6 1 0 1 1 0 8 1 tcpqe 32 2 0 2 1 0 1 1 0 8 1 tcpcb 736 73 0 68 1 0 1 1 0 8 0 arp 96 37 0 18 1 0 1 1 0 8 0 inpcb 328 341 0 332 4 0 4 4 0 8 2 nd6 112 51 0 29 1 0 1 1 0 8 0 pkpcb 40 3 0 3 1 0 1 1 0 8 1 kcovpl 48 17 0 9 1 0 1 1 0 8 0 ppxss 1072 15 0 15 1 0 1 1 0 8 1 pfstscr 40 10 0 4 1 0 1 1 0 8 0 pffrag 232 5 0 1 1 0 1 1 0 482 0 pffrnode 88 5 0 1 1 0 1 1 0 8 0 pffrent 40 6 0 2 1 0 1 1 0 8 0 pfrktable 1344 10 0 10 1 0 1 1 0 8 1 pfanchor 1288 4 0 4 1 0 1 1 0 8 1 pftag 88 3 0 0 1 0 1 1 0 8 0 pfstitem 24 8 0 2 1 0 1 1 0 8 0 pfstkey 128 9 0 4 1 0 1 1 0 8 0 pfstate 384 5 0 2 1 0 1 1 0 8 0 pfrule 1360 7 0 7 1 0 1 1 0 8 1 art_heap8 4096 2 0 0 2 0 2 2 0 8 0 art_heap4 256 869 0 430 29 0 29 29 0 8 1 art_table 40 871 0 430 5 0 5 5 0 8 0 art_node 32 212 0 113 1 0 1 1 0 8 0 sysvmsgpl 40 4 0 3 1 0 1 1 0 8 0 semapl 72 12 0 3 1 0 1 1 0 8 0 shmpl 112 8 0 1 1 0 1 1 0 8 0 dirhash 1024 19 0 2 3 0 3 3 0 8 0 dino2pl 256 2095 0 612 93 0 93 93 0 8 0 ffsino 256 2095 0 612 93 0 93 93 0 8 0 nchpl 144 2686 0 956 65 0 65 65 0 8 0 rtmask 32 4 0 4 1 0 1 1 0 8 1 vnodes 216 2448 0 0 136 0 136 136 0 8 0 namei 1024 9295 0 9295 2 0 2 2 0 8 2 pfiaddrpl 120 3 0 3 1 0 1 1 0 8 1 acpiwqpl 32 2 0 2 1 0 1 1 1 8 1 kstatmem 264 61 0 38 2 0 2 2 0 8 0 scxspl 216 12467 0 12467 8 0 8 8 1 8 8 plimitpl 152 177 0 166 1 0 1 1 0 8 0 sigapl 424 845 0 791 8 0 8 8 0 8 1 knotepl 120 11992 0 11970 9 0 9 9 0 8 7 kqueuepl 184 174 0 170 4 0 4 4 0 8 3 pipepl 304 174 0 147 3 0 3 3 0 8 0 fdescpl 448 812 0 792 5 0 5 5 0 8 1 filepl 120 3773 0 3598 11 0 11 11 0 8 4 lockfpl 104 78 0 77 1 0 1 1 0 8 0 lockfspl 48 34 0 33 1 0 1 1 0 8 0 sessionpl 144 113 0 110 1 0 1 1 0 8 0 pgrppl 48 132 0 121 1 0 1 1 0 8 0 ucredpl 104 638 0 633 1 0 1 1 0 8 0 zombiepl 144 792 0 791 1 0 1 1 0 8 0 processpl 1152 845 0 791 5 0 5 5 0 8 0 procpl 664 1241 0 1178 7 0 7 7 0 8 0 sosppl 176 2 0 2 1 0 1 1 0 8 1 sockpl 552 751 0 738 12 2 10 12 0 8 8 mcl64k 65536 19 0 19 1 0 1 1 0 8 1 mcl16k 16384 5 0 5 1 0 1 1 0 8 1 mcl12k 12288 1 0 1 1 0 1 1 0 8 1 mcl8k 8192 9 0 9 1 0 1 1 0 8 1 mcl4k 4096 2889 0 2834 14 0 14 14 0 8 5 mcl2k 2048 513 0 509 3 0 3 3 0 8 2 mextrefs 64 223 0 223 1 0 1 1 0 8 1 mtagpl 96 4 0 4 1 0 1 1 0 8 1 mbufpl 256 8281 0 8114 18 0 18 18 0 8 4 bufpl 272 5532 0 103 362 0 362 362 0 8 0 anonpl 24 130046 0 128421 42 0 42 42 0 187 20 amapchunkpl 152 18132 0 17766 28 0 28 28 0 158 13 amappl16 200 2049 0 2030 18 7 11 14 0 8 8 amappl15 192 26 0 26 1 0 1 1 0 8 1 amappl14 184 556 0 555 1 0 1 1 0 8 0 amappl13 176 134 0 132 1 0 1 1 0 8 0 amappl12 168 1082 0 1063 2 0 2 2 0 8 0 amappl11 160 3 0 3 1 0 1 1 0 8 1 amappl10 152 58 0 58 1 0 1 1 0 8 1 amappl9 144 274 0 274 1 0 1 1 0 8 1 amappl8 136 141 0 141 1 0 1 1 0 8 1 amappl7 128 161 0 157 1 0 1 1 0 8 0 amappl6 120 237 0 236 1 0 1 1 0 8 0 amappl5 112 91 0 91 1 0 1 1 0 8 1 amappl4 104 291 0 286 1 0 1 1 0 8 0 amappl3 96 3291 0 3223 3 0 3 3 0 8 0 amappl2 88 899 0 872 2 0 2 2 0 8 0 amappl1 80 12448 0 12305 13 0 13 13 0 8 7 amappl 88 4980 0 4862 4 0 4 4 0 92 0 uvmvnodes 80 109 0 0 3 0 3 3 0 8 0 dma16384 16384 1 0 1 1 0 1 1 0 8 1 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 19 0 18 1 0 1 1 0 8 0 aobjpl 72 10 0 1 1 0 1 1 0 8 0 uaddrrnd 24 812 0 792 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 812 0 792 1 0 1 1 0 8 0 vmmpekpl 168 7993 0 7957 3 0 3 3 0 8 0 vmmpepl 168 59669 0 58758 86 0 86 86 0 357 45 vmsppl 368 811 0 791 4 0 4 4 0 8 1 rwobjpl 40 18913 0 18438 12 0 12 12 0 8 0 pdppl 4096 1630 0 1582 102 54 48 82 0 8 0 pvpl 32 351028 0 346925 100 0 100 100 0 265 50 pmappl 216 811 0 791 3 0 3 3 0 8 1 extentpl 40 46 0 28 1 0 1 1 0 8 0 phpool 112 740 0 54 20 0 20 20 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(ffffffff834e357d) at panic+0x1cf sys/kern/subr_prf.c:198 amap_pp_adjref(fffff30066df3610,0,2,ffffffff) at amap_pp_adjref+0x74c sys/uvm/uvm_amap.c:880 amap_adjref_anons(fffff30066df3610,0,2,ffffffff,0) at amap_adjref_anons+0x22d sys/uvm/uvm_amap.c:1298 uvm_unmap_detach(ffff80002a7a4f70,0) at uvm_unmap_detach+0x8a sys/uvm/uvm_map.c:1359 uvm_map_teardown(fffff3006dafbb90) at uvm_map_teardown+0x357 sys/uvm/uvm_map.c:2536 exit1(ffff80002a736a68,0,0,1) at exit1+0x705 sys/kern/kern_exit.c:259 sys_exit(ffff80002a736a68,ffff80002a7a5130,ffff80002a7a5080) at sys_exit+0x1a sys/kern/kern_exit.c:-1 syscall(ffff80002a7a5130) at syscall+0x962 mi_syscall sys/sys/syscall_mi.h:-1 [inline] syscall(ffff80002a7a5130) at syscall+0x962 sys/arch/amd64/amd64/trap.c:783 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0x7be9c7822320, count: -10 ddb>