After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 750508 - Logout is broken (a) when session inhibitor is active and (b) after logout is canceled once
Logout is broken (a) when session inhibitor is active and (b) after logout is...
Status: RESOLVED FIXED
Product: gnome-session
Classification: Core
Component: gnome-session
3.18.x
Other Linux
: Normal major
: ---
Assigned To: Session Maintainers
Session Maintainers
: 699795 704665 731735 733051 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2015-06-07 02:08 UTC by Christian Stadelmann
Modified: 2016-07-19 12:06 UTC
See Also:
GNOME target: 3.20
GNOME version: ---


Attachments
gnome-session journal debug (77.87 KB, text/plain)
2016-01-05 22:37 UTC, Michael Catanzaro
  Details
manager: don't allow inhibitors to block forced logout (2.62 KB, patch)
2016-03-04 19:57 UTC, Ray Strode [halfline]
committed Details | Review
manager: don't wait for all clients to exit before exiting (6.62 KB, patch)
2016-03-04 19:57 UTC, Ray Strode [halfline]
committed Details | Review

Description Christian Stadelmann 2015-06-07 02:08:24 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
Comment 1 Balló György 2015-07-25 19:13:46 UTC
I confirm this bug on Arch Linux. It's really annoying that gnome-session hangs randomly and won't accept further requests after abort.
Comment 2 Christian Stadelmann 2015-07-25 21:07:46 UTC
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.
Comment 4 Michael Catanzaro 2015-12-27 23:48:30 UTC
*** Bug 731735 has been marked as a duplicate of this bug. ***
Comment 5 Michael Catanzaro 2015-12-27 23:52:43 UTC
*** Bug 699795 has been marked as a duplicate of this bug. ***
Comment 6 Michael Catanzaro 2015-12-27 23:53:26 UTC
*** Bug 733051 has been marked as a duplicate of this bug. ***
Comment 7 Michael Catanzaro 2015-12-28 00:04:58 UTC
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.
Comment 8 Michael Catanzaro 2016-01-05 20:58:23 UTC
*** Bug 704665 has been marked as a duplicate of this bug. ***
Comment 9 Michael Catanzaro 2016-01-05 20:58:49 UTC
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.
"""
Comment 10 Michael Catanzaro 2016-01-05 22:37:59 UTC
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
Comment 11 Michael Catanzaro 2016-01-05 22:46:24 UTC
Not anything resembling sure, but maybe fallout from the GDBus port.
Comment 12 Takao Fujiwara 2016-01-07 02:03:23 UTC
I think Fedora 24 also needs to be updated.
Comment 13 Takao Fujiwara 2016-01-07 02:04:46 UTC
(In reply to Takao Fujiwara from comment #12)
> I think Fedora 24 also needs to be updated.

Sorry, mistook bugzilla.
Comment 14 Ray Strode [halfline] 2016-03-04 19:56:45 UTC
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.
Comment 15 Ray Strode [halfline] 2016-03-04 19:57:43 UTC
Created attachment 323124 [details] [review]
manager: don't allow inhibitors to block forced logout

If logout is forced, inhibitors shouldn't stop it !
Comment 16 Ray Strode [halfline] 2016-03-04 19:57:48 UTC
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.
Comment 17 Ray Strode [halfline] 2016-03-04 19:58:08 UTC
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