<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - systemd-coredump "Invalid number of arguments passed from kernel." when executable has spaces in its name."
   href="https://bugs.freedesktop.org/show_bug.cgi?id=62043">62043</a>
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>systemd-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>systemd-coredump "Invalid number of arguments passed from kernel." when executable has spaces in its name.
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>systemd-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>minor
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (All)
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>samuel@dionne-riel.com
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>general
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>systemd
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>