[systemd-devel] job_type_lookup_merge assertion failure in systemd

Steven Noonan steven at uplinklabs.net
Wed Dec 3 08:23:18 PST 2014


On Tue, Dec 2, 2014 at 5:34 PM, Lennart Poettering
<lennart at poettering.net> wrote:
> On Wed, 12.11.14 09:57, Steven Noonan (steven at uplinklabs.net) wrote:
>
>> Hi all,
>>
>> I've been seeing this happen every now and then on a couple machines.
>> When I wake up in the morning and go to log in, I find X11 stopped,
>> and when I try to log in to the VT it hangs when trying to create a
>> session. I am forced to reset the box and then dig through logs on the
>> next boot. This is the cause:
>
> We fixed a couple of bugs recently in the code involving job
> handling. Any chance you can check if you can reproduce the issue with
> current git of systemd?
>

I haven't been able to reproduce it with some quick testing. I suspect
this commit fixed it, since job_type_is_conflicting checks whether
either job is a NOP before checking if it's mergeable:

commit c21b92ffe7ef939dd32502ac912cf8ad1c5638fd
Author: Michal Schmidt <mschmidt at redhat.com>
Date:   Thu Nov 27 15:23:58 2014 +0100

    core: fix transaction destructiveness check once more

    The previous fix e0312f4db "core: fix check for transaction
    destructiveness" broke test-engine (noticed by Zbyszek).
    Apparently I had a wrong idea of the intended semantics of --fail.

    The manpage says the operation should fail if it "conflicts with a
    pending job (more specifically: causes an already pending start job to
    be reversed into a stop job or vice versa)".

    So let's check job_type_is_conflicting, instead of !is_superset.

    This makes both test-engine and TEST-03-JOBS pass again.

diff --git a/src/core/transaction.c b/src/core/transaction.c
index b992edd..6ad11b2 100644
--- a/src/core/transaction.c
+++ b/src/core/transaction.c
@@ -511,7 +511,7 @@ static int transaction_is_destructive(Transaction
*tr, JobMode mode, sd_bus_erro
                 assert(!j->transaction_next);

                 if (j->unit->job && (mode == JOB_FAIL ||
j->unit->job->irreversible) &&
-                    !job_type_is_superset(j->unit->job->type, j->type))
+                    job_type_is_conflicting(j->unit->job->type, j->type))
                         return sd_bus_error_setf(e,
BUS_ERROR_TRANSACTION_IS_DESTRUCTIVE,
                                                  "Transaction is
destructive.");
         }


More information about the systemd-devel mailing list