On Fri, 26 Jul 2024 02:28:12 +0200,
Kirill A. Korinsky <[email protected]> wrote:
>
> >Synopsis: swapctl -d crashes the system
> >Category: swap
> >Environment:
> System : OpenBSD 7.5
> Details : OpenBSD 7.5-current (DEBUG.MP) #5: Thu Jul 18 02:50:06
> WEST 2024
>
> [email protected]:/usr/src/sys/arch/amd64/compile/DEBUG.MP
>
> Architecture: OpenBSD.amd64
> Machine : amd64
> >Description:
> The system is running on a week-old snapshot with WITNESS enabled. The
> kernel was built from git commit
> 58b8553b11de927ce5c25f31489cec554cac10de, which matches the snapshot and
> includes a work-in-progress patch for perfpolicy which I'm testing.
>
> After approximately 5 days of uptime, the system begins to degrade and
> becomes less responsive. I've observed that it consistently uses a bit
> of swap. htop reports that out of 16GB of RAM, it uses 5-6GB, and
> between 500 and 600MB of swap.
>
> An attempt to remove the swap device using the command swapctl -d
> /dev/sd1b resulted in a crash with the following message:
>
> panic: kernel diagnostic assertion "pg->wire_count == 0"
> failed: file "/usr/src/sys/uvm/uvm_page.c", line 1277
>
> This is the same system where I previously encountered a deadlock inside
> mfs when it began using swap space. For reference, see:
> https://marc.info/?l=openbsd-bugs&m=171959901216119&w=2
> >How-To-Repeat:
> I never tried to remove swap, but this system start to degrade after a
> week of using. The next time I'll try to remove swap one more time.
> >Fix:
> No idea
>
Meanwhile, I had reproduced it on
OpenBSD 7.6-beta (GENERIC.MP) #303: Sun Sep 1 19:52:18 MDT 2024
unfortently, the way is stil unclear, but it was a few days of uptime, which
includes hibernate.
Anyway, this time I have ddb's stack trace (text is OCR from a picture):
panic: kernel diagnostic assertion "pg->wire_count == 0" failed: file
"/usr/src/sys/uvm/uvm_page.c", line 1227
Stopped at db_enter+0x14: popq %rbp
TID PID UID PRFLAGS PFLAGS CPU COMMAND
354154 43687 Q 0x3 0x1 1 swapctl
457283 84981 99 0x1100010 0x1 2 sndiod
371136 89678 @ 0x1400 0x40000200 @ softclock
db_enter() at db_enter+0x14
panic(0xffffff824283dc) at panic+0xdd
__assert(0xffffffff823e2dca, 0xffffffff823bd771, 0xffffffffffff82378c92) at
__assert+0x29
uvm_pagezero(0xfffffd81809ebea0) at uvm_pagezero
uao_pagein_page(0xfffffd814278e5f0, 1f2) at uao_pagein_page+0x134
uao_swap_off(0x1, 0x3fec2e) at uao_swap_off+0x150
swap_off(0xffff88084c5e0cd8, 0xffff880012898080) at swap_off+0xa6
sys_swapctl(0xffff88084c5e0cd8, 0xffff88084cb7b80) at sys_swapctl+0x271
syscall(0xffff88084cb7c18) at syscall+0x5e7
Xsyscall() at Xsyscall+0x128
end of kernel
end trace frame: 0x7b7d6dfbb30, 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}>
--
wbr, Kirill