You are not logged in.

#1 2024-07-31 10:33:29

zse
Member
Registered: 2024-05-28
Posts: 13

[SOLVED] Systemd-coredump does not create any dumps

I have not changed any system settings from the defaults regarding core dumps, and the wiki suggests per default core files should be generated.

However, when I run a (self written) test app that I intentionally let crash (SIGABRT via assert), it shows up under coredumpctl with "COREFILE none". And with "coredumpctl info" it says "Storage: none". Furthermore,  /etc/systemd/coredump.conf only contains commented out settings, so is essentially empty.

Anyone got an idea what the problem is?

EDIT: I now also noticed in journalctl it says "Resource limits disable core dumping for process ...", but "ulimit -c" does say unlimited, so I am still confused.

Last edited by zse (2024-08-01 11:16:54)

Offline

#2 2024-07-31 15:03:22

seth
Member
Registered: 2012-09-03
Posts: 58,667

Re: [SOLVED] Systemd-coredump does not create any dumps

sysctl -a 2>/dev/null | grep kernel.core

https://wiki.archlinux.org/title/Core_dump#Using_ulimit - ulimit should™ be irrelevant when using systemd-coredump

Any drop-ins in /etc/systemd/coredump.conf.d/ ?

You could set "kernel.core_pattern = /var/cache/coredumps/core_%e.%p" if you just need to get some coredump asap.

Online

#3 2024-07-31 15:38:46

zse
Member
Registered: 2024-05-28
Posts: 13

Re: [SOLVED] Systemd-coredump does not create any dumps

/etc/systemd/coredump.conf.d/ does not exist here.

I am looking to configure the system more permanently for this, so I'd hope to not have to fully bypass systemd-coredump...

The only other thing I've seen related to this is /etc/security/limits.conf, but that too does only contain commented out settings. I tried adding

*               soft    core            10000

in there, but that didn't help either.

Edit: Oh, and here's the output as requested:

$ sysctl -a 2>/dev/null | grep kernel.core
kernel.core_file_note_size_limit = 4194304
kernel.core_pattern = |/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h
kernel.core_pipe_limit = 16
kernel.core_uses_pid = 1

Last edited by zse (2024-07-31 15:54:08)

Offline

#4 2024-07-31 20:49:36

seth
Member
Registered: 2012-09-03
Posts: 58,667

Re: [SOLVED] Systemd-coredump does not create any dumps

Looks fine, the core limits shoudl™ be ignored anyway because of the pipe.
Does it at least work if you set "kernel.core_pattern = /var/cache/coredumps/core_%e.%p" or do you get the same or a different error?
Are you running out of space on /var/lib/systemd/coredump

findmnt -T /var/lib/systemd/coredump; df -h

Online

#5 2024-08-01 11:14:47

zse
Member
Registered: 2024-05-28
Posts: 13

Re: [SOLVED] Systemd-coredump does not create any dumps

Sigh, ok I think I figured it out.

So you and the wiki say the core limits should be ignored - I believe because, according to the kernel doc, the kernel will ignore that when piping the dump (to quote: "However, RLIMIT_CORE will be ignored if the system is configured to pipe core dumps to a program").

But apparently systemd-coredump will still inspect this value to determine whether to store the core dump; I noticed that in my app the core soft limit was set to 0, even though it was not in the terminal that started it. After some tracing it turns out that the gcc sanitizers that I enabled reset that to 0 for some reason. Once I disabled the sanitizers, the core dumps were generated properly.

Offline

Board footer

Powered by FluxBB