Re: curious crashes when under memory pressure

From: Peter 'PMc' Much <pmc_at_citylink.dinoex.sub.org>
Date: Sat, 04 Jan 2025 14:57:21 UTC
On 2025-01-04, Chris Torek <chris.torek@gmail.com> wrote:
> I have my (amd64, -current) box set up to build a lot of ports in
> parallel with a fairly high `make -j` value as well. This will
> sometimes try to build llvm versions 15, 16, and 17 and maybe a gcc or
> two and/or rustc and/or firefox etc and push the load over 100 and run
> me out of real memory (currently only 64 GB). When this happens, it's
> not unusual to get:

"only"... ? *shrug*

Similar config here, 20 core, 80 GB, 4 domains, builds run within
temporary bhyves, a couple in parallel. Had a lot fun getting llvm
builds to run along w/o mem exhaustion.

>     pid <pid> (c++) ... exited on signal 4 (core dumped)
>
> messages on the console, occasional uprintf() messages, and a build

Haven't seen exactly that one yet.

> failure -- which goes away when retrying. It's not a parallel make
> jobs issue. It *appears* to have something to do with the copyout()
> calls for signal handlers failing, and it invariably coincides with
> increasing swap usage. I'm swapping to a zfs mirror

Well, You shouldn't do that. Swapping back onto ZFS does usually work
for some individual process that needs a lot of memory, for some
in-memory array or such - i.e. for desktop uses.
I never expected it to work when the entire system runs from paging.
In any case, looping back the swap onto ZFS is logically bogus.

So, get one or two decent SSD, put the swap onto raw partitions, and
test with that, to see if the issue reproduces. Only then I would try
and search further for the actual cause.