Bug 62043 - systemd-coredump "Invalid number of arguments passed from kernel." when executable has spaces in its name.
Summary: systemd-coredump "Invalid number of arguments passed from kernel." when execu...
Status: RESOLVED FIXED
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other Linux (All)
: medium minor
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-09 03:20 UTC by Samuel Dionne-Riel
Modified: 2014-06-24 03:23 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Samuel Dionne-Riel 2013-03-09 03:20:46 UTC
Coredumps will not dump to the journal when the executable has spaces in its filename. Do note that spaces in the folder containing the executable do not cause any problems though.

I tried different core_patterns to try to escape the filename, but was unsuccessful.

The problem seems to originate from the core_pattern as manually invoking systemd-coredump with a properly escaped filename (even while fake) will work properly.

Hope this helps!

=============================================================================
Steps to reproduce:
# Verify that cores are dumped to systemd
$ cat /proc/sys/kernel/core_pattern
|/usr/lib/systemd/systemd-coredump %p %u %g %s %t %e

$ cat > coredump.c
#include <signal.h>

void main() {
        raise (6);
}
^D

$ gcc -o do_core coredump.c

$ ./do_core
[1]    29820 abort (core dumped)  ./do_core

$ ./do\ core 
[1]    29944 abort (core dumped)  ./do\ core

$ journalctl -b --since="2012-03-08"
...
Mar 08 22:03:35 CLETUS systemd-coredump[29821]: Process 29820 ('do_core') dumped core.
Mar 08 22:03:55 CLETUS systemd-coredump[29945]: Invalid number of arguments passed from kernel.

$ systemd-coredumpctl | tail -n 2
              Fri 2013-03-08 21:43:48 EST  22429  1000   100   6 /home/samuel/[redacted and irrelevant]
              Fri 2013-03-08 22:03:35 EST  29820  1000   100   6 /home/samuel/tmp/coredump/do_core

# And now with a simulated coredump
$ /usr/lib/systemd/systemd-coredump 999999 $UID $GID 5 today fake-coredump  < /dev/null

$ /usr/lib/systemd/systemd-coredump 999999 $UID $GID 5 today "fake coredump"  < /dev/null

$ /usr/lib/systemd/systemd-coredump 999999 $UID $GID 5 today fake coredump  < /dev/null

$ journalctl -b --since="2012-03-08" | tail -n 3
Mar 08 22:15:53 CLETUS systemd-coredump[2091]: Process 999999 (fake-coredump) dumped core.
Mar 08 22:16:00 CLETUS systemd-coredump[2134]: Process 999999 (fake coredump) dumped core.
Mar 08 22:16:06 CLETUS systemd-coredump[2175]: Invalid number of arguments passed from kernel.

$ systemd-coredumpctl| tail -n 3
              Fri 2013-03-08 22:03:35 EST  29820  1000   100   6 /home/samuel/tmp/coredump/do_core
              Fri 2013-03-08 22:15:53 EST 999999  1000   100   5 fake-coredump
              Fri 2013-03-08 22:16:00 EST 999999  1000   100   5 fake coredump

=============================================================================
Information about the environment

$ cat /proc/sys/kernel/core_pattern
|/usr/lib/systemd/systemd-coredump %p %u %g %s %t '%e'

$ systemd --version
systemd 197
+PAM -LIBWRAP -AUDIT -SELINUX -IMA -SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ

$ grep -RI coredump /usr/lib/sysctl.d
/usr/lib/sysctl.d/coredump.conf:kernel.core_pattern=|/usr/lib/systemd/systemd-coredump %p %u %g %s %t %e
Comment 1 Zbigniew Jedrzejewski-Szmek 2014-06-24 03:23:55 UTC
Fixed in http://cgit.freedesktop.org/systemd/systemd/commit/?id=1eef15b1.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.