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 688992 - Problems logging into GDM
Problems logging into GDM
Status: RESOLVED FIXED
Product: gnome-session
Classification: Core
Component: gnome-session
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Session Maintainers
Session Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-11-24 20:01 UTC by Bastien Nocera
Modified: 2012-12-03 17:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
main: disconnect shutdown_cb when manager is destroyed (5.49 KB, patch)
2012-11-30 21:11 UTC, Ray Strode [halfline]
needs-work Details | Review
main: disconnect shutdown_cb when manager is destroyed (5.61 KB, patch)
2012-12-03 15:07 UTC, Ray Strode [halfline]
committed Details | Review

Description Bastien Nocera 2012-11-24 20:01:13 UTC
1. Try to log in as my user by clicking on my name
2. Comes back directly to user selection without offering to enter password

I see this in my gdm log:
gnome-session[31962]: CRITICAL: gsm_manager_set_phase: assertion `GSM_IS_MANAGER (manager)' failed
gnome-session[31962]: Gtk-CRITICAL: gtk_main_quit: assertion `main_loops != NULL' failed
with gnome-session 3.6.2

I can log in correctly with gnome-session 3.6.1
I suspect this commit:
http://git.gnome.org/browse/gnome-session/commit/?h=gnome-3-6&id=981acc49ed778860c3128ad6592a7ed7850259e7
Comment 1 Ray Strode [halfline] 2012-11-30 21:06:31 UTC
So git grep gtk_main_quit suggests the function you're hitting is shutdown_cb which does:

        g_debug ("Calling shutdown callback function");•
•
        /*•
         * When the signal handler gets a shutdown signal, it calls•
         * this function to inform GsmManager to not restart•
         * applications in the off chance a handler is already queued•
         * to dispatch following the below call to gtk_main_quit.•
         */•
        gsm_manager_set_phase (manager, GSM_MANAGER_PHASE_EXIT);•
•
        gtk_main_quit ();•

grepping for where that call yields:

        manager = gsm_manager_new (client_store, failsafe);•
•
        g_signal_connect_swapped (bus_proxy,•
                                  "destroy",•
                                  G_CALLBACK (shutdown_cb),•
                                  manager);•

So it gets called when bus_proxy is destroyed.  If the manager is destroyed before the bus_proxy, then that would explain the message.

Sure enough:

        g_clear_object (&manager);•
        g_clear_object (&client_store);•
        g_clear_object (&bus_proxy);•
Comment 2 Ray Strode [halfline] 2012-11-30 21:08:10 UTC
Looks like might caused by bug 688774
Comment 3 Ray Strode [halfline] 2012-11-30 21:11:07 UTC
Created attachment 230344 [details] [review]
main: disconnect shutdown_cb when manager is destroyed

shutdown_cb is supposed to be called when gnome-session is
running and suddenly the bus is ripped away from it.  Unfortunately,
it also gets run as part of the normal shutdown path, which it isn't
designed for.

This commit changes g_signal_connect_swapped to g_signal_connect_object
to ensure the handler isn't called in the normal shutdown path.
Comment 4 Colin Walters 2012-12-01 16:23:35 UTC
Review of attachment 230344 [details] [review]:

::: gnome-session/main.c
@@ +328,3 @@
         manager = gsm_manager_new (client_store, failsafe);
 
+        g_signal_connect_object (bus_proxy,

That's not going to work because we were depending on the _swapped variant passing "manager" as the first argument.

This code is really ugly...it'd be way harder to screw up if the GsmManager object watched the bus, rather than us trying to do it from the outside.

I actually don't get the rationale for it in the first place - if the session bus crashes, we should fail whale.
Comment 5 Matthias Clasen 2012-12-03 04:17:43 UTC
g_signal_connect_object takes flags, so you can pass the swapped flag.
Comment 6 Ray Strode [halfline] 2012-12-03 15:06:17 UTC
(In reply to comment #5)
> g_signal_connect_object takes flags, so you can pass the swapped flag.

Odd, I know i compile-tested this, must have run make from the wrong directory or something.
Comment 7 Ray Strode [halfline] 2012-12-03 15:07:55 UTC
Created attachment 230534 [details] [review]
main: disconnect shutdown_cb when manager is destroyed

shutdown_cb is supposed to be called when gnome-session is
running and suddenly the bus is ripped away from it.  Unfortunately,
it also gets run as part of the normal shutdown path, which it isn't
designed for.

This commit changes g_signal_connect_swapped to g_signal_connect_object
to ensure the handler is disconnected when the manager object goes away,
so the handler isn't called in the normal shutdown path.
Comment 8 Colin Walters 2012-12-03 16:32:21 UTC
Review of attachment 230534 [details] [review]:

4th time's a charm?
Comment 9 Ray Strode [halfline] 2012-12-03 17:36:39 UTC
Attachment 230534 [details] pushed as 6b62168 - main: disconnect shutdown_cb when manager is destroyed