Commit 90a095e1 authored by Ray Strode's avatar Ray Strode

gdm-x-session: kill subprocesses on sigterm

<dsd> Jasper: can you explain the logic bug? just curious
<Jasper> dsd, GCancellable is a way of cancelling an ongoing operation.
<Jasper> dsd, so we start up a wait_async, which says "call this
         callback when the subprocess exits". And then when we get a
         SIGTERM, we fire off the cancellable, saying "no no, don't
         actually wait for to finish, let's just cancel that now"
<Jasper> dsd, the callback is called, but wait_finish returns FALSE,
         meaning that the wait was cancelled. And then the callback says
         "oh, cool, we're done here" and clears the x_session object.
<Jasper> dsd, I'd have to inspect closer to determine a proper fix
         should we still cancel the wait but not actually clear the
         object, so we wait synchronously in cleanup?)
<Jasper> Depends on what else uses the cancellable.
<dsd> ahh
<dsd> got it
<Jasper> dsd, the other thing that should fix it would be moving the
         g_clear_object above the "out" label here:
         https://git.gnome.org/browse/gdm/tree/daemon/gdm-x-session.c?h=gnome-3-16#n185
<Jasper> And doing that for all of session / bus / x subprocesses.
<Jasper> Maybe that's the cleaner fix.

Based on a patch by João Paulo Rechi Vita <jprvita@endlessm.com>

[endlessm/eos-shell#4921]

https://bugzilla.gnome.org/show_bug.cgi?id=752388
parent 18718022
......@@ -183,8 +183,8 @@ on_x_server_finished (GSubprocess *subprocess,
g_debug ("X server was killed with status %d", signal_number);
}
out:
g_clear_object (&state->x_subprocess);
out:
g_main_loop_quit (state->main_loop);
}
......@@ -352,8 +352,8 @@ on_bus_finished (GSubprocess *subprocess,
g_debug ("message bus was killed with status %d", signal_number);
}
out:
g_clear_object (&state->bus_subprocess);
out:
g_main_loop_quit (state->main_loop);
}
......@@ -489,8 +489,8 @@ on_session_finished (GSubprocess *subprocess,
g_debug ("session was killed with status %d", signal_number);
}
out:
g_clear_object (&state->session_subprocess);
out:
g_main_loop_quit (state->main_loop);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment