[systemd-bugs] [Bug 67427] Crash on shutdown, Assertion 'a >= 0 && a < _JOB_TYPE_MAX_MERGING' failed

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Nov 12 22:10:48 PST 2014


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

--- Comment #21 from Steven Noonan <steven at uplinklabs.net> ---
Created attachment 109383
  --> https://bugs.freedesktop.org/attachment.cgi?id=109383&action=edit
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. :)

-- 
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/20141113/4aa606ed/attachment.html>


More information about the systemd-bugs mailing list