[systemd-bugs] [Bug 62043] New: systemd-coredump "Invalid number of arguments passed from kernel." when executable has spaces in its name.

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Mar 8 19:20:46 PST 2013


https://bugs.freedesktop.org/show_bug.cgi?id=62043

          Priority: medium
            Bug ID: 62043
          Assignee: systemd-bugs at lists.freedesktop.org
           Summary: systemd-coredump "Invalid number of arguments passed
                    from kernel." when executable has spaces in its name.
        QA Contact: systemd-bugs at lists.freedesktop.org
          Severity: minor
    Classification: Unclassified
                OS: Linux (All)
          Reporter: samuel at dionne-riel.com
          Hardware: Other
            Status: NEW
           Version: unspecified
         Component: general
           Product: systemd

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

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-bugs/attachments/20130309/c61dcef2/attachment.html>


More information about the systemd-bugs mailing list