From 90a095e1a3ef26391da835ebe155deae26eeac5f Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Thu, 9 Jul 2015 13:40:59 -0400 Subject: gdm-x-session: kill subprocesses on sigterm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Jasper: can you explain the logic bug? just curious dsd, GCancellable is a way of cancelling an ongoing operation. 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" 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. 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?) Depends on what else uses the cancellable. ahh got it 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 And doing that for all of session / bus / x subprocesses. Maybe that's the cleaner fix. Based on a patch by João Paulo Rechi Vita [endlessm/eos-shell#4921] https://bugzilla.gnome.org/show_bug.cgi?id=752388 --- daemon/gdm-x-session.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'daemon/gdm-x-session.c') diff --git a/daemon/gdm-x-session.c b/daemon/gdm-x-session.c index bcb884ce..f8eeb45c 100644 --- a/daemon/gdm-x-session.c +++ b/daemon/gdm-x-session.c @@ -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); } -- cgit v1.2.1