<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED - Crash on shutdown, Assertion 'a >= 0 && a < _JOB_TYPE_MAX_MERGING' failed"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=67427#c21">Comment # 21</a>
              on <a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED - Crash on shutdown, Assertion 'a >= 0 && a < _JOB_TYPE_MAX_MERGING' failed"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=67427">bug 67427</a>
              from <span class="vcard"><a class="email" href="mailto:steven@uplinklabs.net" title="Steven Noonan <steven@uplinklabs.net>"> <span class="fn">Steven Noonan</span></a>
</span></b>
        <pre>Created <span class=""><a href="attachment.cgi?id=109383" name="attach_109383" title="patch: don't try to merge a JOB_NOP">attachment 109383</a> <a href="attachment.cgi?id=109383&action=edit" title="patch: don't try to merge a JOB_NOP">[details]</a></span> <a href='page.cgi?id=splinter.html&bug=67427&attachment=109383'>[review]</a>
patch: don't try to merge a JOB_NOP

>From my read of the code, here's what happens. The stack traces are slightly
obfuscated by the fact we have duplicate values in the JobType enum, so
mentally translate these when reading through it:

  _JOB_TYPE_MAX_IN_TRANSACTION is JOB_TRY_RESTART
  _JOB_TYPE_MAX_MERGING is JOB_NOP

The transaction arrives as a JOB_TRY_RESTART, but between the entry of
manager_add_job and when it calls transaction_activate, the type changes to
JOB_NOP. This appears to happen because of job_type_collapse, which notices the
unit is already deactivating or inactive and modifies the passed JobType in
place to be a JOB_NOP.

Deeper down the stack, transaction_is_destructive tries to use
job_type_is_superset on the JOB_NOP, which will fail since it's not a mergeable
job type. Skip the job_type_is_superset on a JOB_NOP and we should be good.

Possible patch attached. Not sure if it's the right approach, though. Still
reading through the code to try to understand the transaction/merging
semantics. :)</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>