This is what I did:
ulimit -S -c unlimited
sudo sysctl -w kernel.core_pattern=core
took me a while to figure this out, HTH
Re:Debugging with GDB
by mark_undoio on Wednesday March 23, 2022 @10:48AM
(#30779004)
Thanks! I also see there's a `/proc/sys/kernel/core_uses_pid` that will make you get `core.PID` files, without having to mess around with core patterns - seems useful.
I've previously configured `/proc/sys/kernel/core_pattern` to generate core dumps by default (and not pipe them to a core dump collection program, which may be useful for error reporting but is rarely what I want).
There's also `gcore` for doing on-demand core dumps.
I wish it were possible to configure core dump behaviour per-process (or something similar).