GNOME Bugzilla – Bug 750508
Logout is broken (a) when session inhibitor is active and (b) after logout is canceled once
Last modified: 2016-07-19 12:06:08 UTC
I am using gnome-session 3.16 on Fedora 22 with gnome-shell 3.18. Steps to reproduce: 1. run `gnome-session-quit` 2. abort dialog 3. run `gnome-session-quit` again What happens: 1. dialog does not show up again. Instead if I force it to run again (`gnome-session-quit --no-prompt` I often get an error message: ** (gnome-session-quit:29795): WARNING **: Failed to call logout: GDBus.Error:org.gnome.SessionManager.NotInRunning: Logout interface is only available during the Running phase 2. timer is not stopped so although I did not confirm the dialog gnome session logs out or even shuts down. in syslog I see these error messages: Jun 07 03:58:01 hostname gnome-session[8294]: gnome-session[8294]: GLib-GObject-CRITICAL: g_object_unref: assertion 'G_IS_OBJECT (object)' failed Jun 07 03:58:01 hostname gnome-session[8294]: GLib-GObject-CRITICAL: g_object_unref: assertion 'G_IS_OBJECT (object)' failed Jun 07 03:58:01 hostname gnome-session[8294]: gnome-session[8294]: GLib-GObject-CRITICAL: g_object_unref: assertion 'G_IS_OBJECT (object)' failed Jun 07 03:58:01 hostname gnome-session[8294]: GLib-GObject-CRITICAL: g_object_unref: assertion 'G_IS_OBJECT (object)' failed Jun 07 03:58:01 hostname gnome-session[8294]: GLib-GObject-CRITICAL: g_object_unref: assertion 'G_IS_OBJECT (object)' failed Jun 07 03:58:01 hostname gnome-session[8294]: gnome-session[8294]: GLib-GObject-CRITICAL: g_object_unref: assertion 'G_IS_OBJECT (object)' failed Jun 07 03:58:01 hostname gnome-session[8294]: GLib-GObject-CRITICAL: g_object_unref: assertion 'G_IS_OBJECT (object)' failed Jun 07 03:58:01 hostname gnome-session[8294]: gnome-session[8294]: GLib-GObject-CRITICAL: g_object_unref: assertion 'G_IS_OBJECT (object)' failed Jun 07 03:58:01 hostname gnome-session[8294]: Window manager warning: Invalid WM_TRANSIENT_FOR window 0x1c00006 specified for 0x1c00205 (quiterss). Jun 07 03:58:04 hostname gnome-session[8294]: Entering running state This bug is not always behaving the same. Sometimes the dialog does not show up at all, sometimes it shows up for the second (but not the third) time. Sometimes the timer is stopped. The error messages vary a bit too. And they are also visible when doing a regular shutdown or logout (not aborting it). See also bug #699795, bug #733051, bug #731735
I confirm this bug on Arch Linux. It's really annoying that gnome-session hangs randomly and won't accept further requests after abort.
I recently noticed that in this broken state, starting any dbus-activated applications is impossible. All Qt and Gtk2-based applications are unaffected, but some Gtk3 applications are affected.
https://bugzilla.gnome.org/show_bug.cgi?id=699795 and https://bugzilla.gnome.org/show_bug.cgi?id=733051 could be related.
*** Bug 731735 has been marked as a duplicate of this bug. ***
*** Bug 699795 has been marked as a duplicate of this bug. ***
*** Bug 733051 has been marked as a duplicate of this bug. ***
I duped a bunch of other logout bugs against this one simply because your bug shows the same g_object_unref journal errors I'm seeing when I try to log out. In my case, though, canceling logout works fine. It's when I do try to log out that I see the errors. I built gnome-session to crash on the first critical. I lost the full backtrace, but it wasn't useful, so no matter. The truncated backtrace is unfortunately: Stack trace of thread 2219: #0 0x00007fa1c6f8e81b _g_log_abort (libglib-2.0.so.0) #1 0x00007fa1c6f8e98f g_log (libglib-2.0.so.0) #2 0x00007fa1c6f84938 g_source_callback_unref (libglib-2.0.so.0 #3 0x00007fa1c6f860f6 g_source_destroy_internal (libglib-2.0.so #4 0x00007fa1c6f87ed0 g_main_dispatch (libglib-2.0.so.0) #5 0x00007fa1c6f881d0 g_main_context_iterate (libglib-2.0.so.0) #6 0x00007fa1c6f884f2 g_main_loop_run (libglib-2.0.so.0) #7 0x000055c797ec673b main (gnome-session-binary) #8 0x00007fa1c6b9d580 __libc_start_main (libc.so.6) #9 0x000055c797ec6ab9 _start (gnome-session-binary) The callback that had been scheduled was call_in_idle_cb. Unfortunately glib has three of those, in gio/gdbusconnection.c, gio/gdbusnameowning.c, and gio/gdbusnamewatching.c. I suspect we have different underlying issues exposing this bug in gnome-session. In my case, I think it's failing due to SELinux (Red Hat #1222157), which can't be to blame for the same symptoms on Arch.
*** Bug 704665 has been marked as a duplicate of this bug. ***
I was using this bug to track the session inhibitor issue as well, but I see it's not recorded here. From #704665: """ -Type some text in gedit, but don't save it -Click the Gnome "Log Out" menu option -A Log Out/Power Off window pops up with a gedit icon in the middle of it -In the Log Out/Power Off windows click the the gedit icon (do not click the "Cancel", "Restart", "Power Off" or "Log Out" buttons, these buttons won't cause the problem) -After clicking on the gedit icon you're returned to the desktop (if you close gedit now and wait, after five or more minutes you might suddenly get logged out) -Try to log out or power off again. Now these menu items don't do anything other than generate the "GDBus.Error:org.gnome.SessionManager.NotInRunning" log below (i.e. you can no longer logout or power off from the menu!) -A work around fo this issue is to run 'ALT-F2, r' to restart the gnome shell after which the power off/log out menu items work again. """
Created attachment 318297 [details] gnome-session journal debug Some debug.... I think gedit is perhaps setting multiple inhibitors? The first problem I see is during phase QUERY_END_SESSION, we see a bunch of "g_object_unref: assertion 'G_IS_OBJECT (object)' failed" (which is coming from deep in GDBus; see the backtrace above), the shell's inhibitor dialog (are you sure you want to log out, you have unsaved documents) never appears, and we transition to END_SESSION. In END_SESSION, many more "g_object_unref: assertion 'G_IS_OBJECT (object)' failed". gnome-session clearly sees the inhibitor(s) from gedit, but ignores it (why?). Then the transition from END_SESSION to EXIT gets delayed for 1.5 minutes (why?). During this time, there is no modal dialog -- I can continue to use my computer as usual, even though the state is not RUNNING. After the switch to EXIT eventually happens, it works fine, although I see a lot of "Fatal IO error 11 (Resource temporarily unavailable) on X server :0." So the problems are: * gnome-shell inhibitor dialog is never displayed * Transition from END_SESSION to EXIT delayed 1.5 minutes
Not anything resembling sure, but maybe fallout from the GDBus port.
I think Fedora 24 also needs to be updated.
(In reply to Takao Fujiwara from comment #12) > I think Fedora 24 also needs to be updated. Sorry, mistook bugzilla.
so i'm going push a couple of patches that should fix it from multiple angles. we still have a lot of code in place to support a feature that was removed from gnome-shell a long time ago ( https://git.gnome.org/browse/gnome-shell/commit/?id=e4d46aee97f11ec56126b89e31639f67ceacac00 ), but i'll save pruning that out for another day.
Created attachment 323124 [details] [review] manager: don't allow inhibitors to block forced logout If logout is forced, inhibitors shouldn't stop it !
Created attachment 323125 [details] [review] manager: don't wait for all clients to exit before exiting If a client gets hung up, we shouldn't hold up going to login screen. It means making a bug in a single client break the desktop.
Attachment 323124 [details] pushed as 58ce163 - manager: don't allow inhibitors to block forced logout Attachment 323125 [details] pushed as 58c9323 - manager: don't wait for all clients to exit before exiting