<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 gets abort or segv by udev rule with $devpath or %p"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=63189">63189</a>
          </td>
        </tr>

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

        <tr>
          <th>Summary</th>
          <td>systemd gets abort or segv by udev rule with $devpath or %p
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>muneda.takahiro@jp.fujitsu.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>Desription of Problem:
  systemd dies as abort or segv, then a command like reboot does not work.

  There are two behaviors of following command.

  1. A command returns immediately.

  # reboot
  Failed to open /dev/initctl: No such device or address
  Failed to talk to init daemon.
  #

  2. A command does not return forever.
  # reboot
  <does not return forever>

Versions:
  systemd-200-3.fc19.x86_64
  kernel-3.9.0-0.rc4.git0.1.fc19.x86_64

How reproducible:
  Always

Step to Reproduce:
  1. Place a udev rule file which have $devpath or %p
     The udev rule I used is following.

     localhost% cat /etc/udev/rules.d/muneda.rules
     #ACTION=="online|offline", TAG+="systemd",
ENV{SYSTEMD_WANTS}="muneda@$devpath.service"
     ACTION=="online|offline", TAG+="systemd",
ENV{SYSTEMD_WANTS}="muneda@%p.service"

     Note: ABRT happens with both $devpath and %p, but SEGV happens with
$devpath only so far.

  2. Generate a uevent to match the rule
     I used a following command.

     # echo online > /sys/bus/acpi/uevent

  3. systemd gets abort or segv

     abort:
     Apr  5 15:56:16 localhost systemd[1]: Failed to load device unit: Invalid
argument
     Apr  5 15:56:16 localhost systemd[1]: Assertion 'os <
_UNIT_ACTIVE_STATE_MAX' failed at src/core/unit.c:1323, function unit_notify().
Aborting.
     Apr  5 15:56:16 localhost systemd[1]: Caught <ABRT>, dumped core as pid
548.
     Apr  5 15:56:16 localhost systemd[1]: Freezing execution.
     Apr  5 15:56:22 localhost systemd-cgroups-agent[549]: Failed to get D-Bus
connection: Failed to connect to socket /org/freedesktop/systemd1/private:
Connection refused

     segv:
     Apr  5 15:39:08 localhost systemd[1]: Failed to load device unit: Invalid
argument
     Apr  5 15:39:08 localhost kernel: [  184.640812] systemd[1]: segfault at
7fc4ee0b58e0 ip 00007fc7aa321fa0 sp 00007fff5e3dff58 error 4 in
systemd[7fc7aa296000+f3000]
     Apr  5 15:39:08 localhost systemd[1]: Caught <SEGV>, dumped core as pid
633.
     Apr  5 15:39:08 localhost systemd[1]: Freezing execution.

Additional Info:
  When I tried following command, if returns successfully.

    # udevadm test --action=online /bus/acpi

  And the result contains following lines.

    read rules file: /etc/udev/rules.d/muneda.rules
    ...
    ACTION=online
    DEVPATH=/bus/acpi
    SUBSYSTEM=subsystem
    SYSTEMD_WANTS=muneda@/bus/acpi.service
    TAGS=:systemd:
    USEC_INITIALIZED=87854780
    unload module index
    [root@localhost ~]#

  So I suppose both reading a udev rule and replacing $devpath or %p work fine.
  The problem happens beyond those points.

Thanks,
Takahiro</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>