lightdm-1.2.0 hangs in exit_cb()

Reported by Paul Parsons on 2012-04-07
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Light Display Manager
Undecided
Unassigned
Gentoo Linux
New
Undecided
Unassigned

Bug Description

When shutting down my Gentoo Linux system, lightdm-1.2.0 hangs in exit_cb().

1. OpenRC sends a SIGTERM signal to stop lightdm.
2. lightdm receives the signal and proceeds to shut down.
3. lightdm hangs in exit_cb() calling g_hash_table_unref(seat_bus_entries).

To demonstrate this, I added some extra debug to exit_cb():

   142 static gboolean
   143 exit_cb (gpointer data)
   144 {
   145 g_debug ("Entering exit_cb()");
   146 /* Clean up display manager */
   147 g_object_unref (display_manager);
   148 display_manager = NULL;
   149
   150 /* Remove D-Bus interface */
   151 g_debug ("Calling g_bus_unknown_name(bus_id=%d)", bus_id);
   152 g_bus_unown_name (bus_id);
   153 if (seat_bus_entries)
   154 {
   155 g_debug ("Calling g_hash_table_unref(seat_bus_entries=%p)", seat_bus_entries);
   156 g_hash_table_unref (seat_bus_entries);
   157 }
   158 if (session_bus_entries)
   159 {
   160 g_debug ("Calling g_hash_table_unref(session_bus_entries=%p)", session_bus_entries);
   161 g_hash_table_unref (session_bus_entries);
   162 }
   163
   164 g_debug ("Exiting with return value %d", exit_code);
   165 exit (exit_code);
   166 }

Here is the tail of /var/log/lightdm/lightdm.log:

[+53.01s] DEBUG: Got signal 15 from process 2321
[+53.01s] DEBUG: Caught Terminated signal, shutting down
[+53.01s] DEBUG: Stopping display manager
[+53.01s] DEBUG: Stopping seat
[+53.01s] DEBUG: Stopping display
[+53.01s] DEBUG: Session 1875: Sending SIGTERM
[+53.05s] DEBUG: Greeter closed communication channel
[+53.06s] DEBUG: Session 1875 exited with return value 0
[+53.06s] DEBUG: Greeter quit
[+53.06s] DEBUG: Sending signal 15 to process 1730
[+53.35s] DEBUG: Process 1730 exited with return value 0
[+53.35s] DEBUG: X server stopped
[+53.35s] DEBUG: Removing X server authority /var/run/lightdm/root/:0
[+53.35s] DEBUG: Releasing VT 7
[+53.35s] DEBUG: Display server stopped
[+53.35s] DEBUG: Display stopped
[+53.35s] DEBUG: Seat stopped
[+53.35s] DEBUG: Display manager stopped
[+53.35s] DEBUG: Stopping daemon
[+53.35s] DEBUG: Entering exit_cb()
[+53.35s] DEBUG: Calling g_bus_unknown_name(bus_id=1)
[+53.35s] DEBUG: Calling g_hash_table_unref(seat_bus_entries=0x659520)

There is no further output, thus lightdm-1.2.0 has hung in exit_cb() calling g_hash_table_unref(seat_bus_entries), in line 156 above.

My previous version was lightdm-1.0.6, which exited OK.

Tim (timbers2k) wrote :

I see the same symptoms in Gentoo using lightdm-1.1.9 and 1.2.0

Paul Parsons (lost-distance) wrote :

Same symptoms with lightdm-1.2.1 and lightdm-1.2.2; they too hang on exit.

Robert Ancell (robert-ancell) wrote :

I haven't been able to reproduce it. Is it getting stuck inside bus_entry_free?

Paul Parsons (lost-distance) wrote :

Yes, it looks like g_dbus_connection_unregister_object() hangs:

   508 static void
   509 bus_entry_free (gpointer data)
   510 {
   511 BusEntry *entry = data;
   512
   513 g_debug("%s: calling g_dbus_connection_unregister_object", __func__);
   514 g_dbus_connection_unregister_object (bus, entry->bus_id);
   515
   516 g_debug("%s: calling g_dbus_connection_emit_signal", __func__);
   517 g_dbus_connection_emit_signal (bus,
   518 NULL,
   519 "/org/freedesktop/DisplayManager",
   520 "org.freedesktop.DisplayManager",
   521 entry->removed_signal,
   522 g_variant_new ("(o)", entry->path),
   523 NULL);
   524
   525 g_debug("%s: calling g_free (entry->path)", __func__);
   526 g_free (entry->path);
   527 g_debug("%s: calling g_free (entry->parent_path)", __func__);
   528 g_free (entry->parent_path);
   529 g_debug("%s: calling g_free (entry->removed_signal)", __func__);
   530 g_free (entry->removed_signal);
   531 g_debug("%s: calling g_free (entry)", __func__);
   532 g_free (entry);
   533 g_debug("%s: return", __func__);
   534 }

[+31.86s] DEBUG: Got signal 15 from process 2438
[+31.86s] DEBUG: Caught Terminated signal, shutting down
[+31.86s] DEBUG: Stopping display manager
[+31.86s] DEBUG: Stopping seat
[+31.86s] DEBUG: Stopping display
[+31.86s] DEBUG: Session 2075: Sending SIGTERM
[+31.87s] DEBUG: Greeter closed communication channel
[+31.87s] DEBUG: Session 2075 exited with return value 0
[+31.87s] DEBUG: Greeter quit
[+31.87s] DEBUG: Sending signal 15 to process 2070
[+32.14s] DEBUG: Process 2070 exited with return value 0
[+32.15s] DEBUG: X server stopped
[+32.15s] DEBUG: Removing X server authority /var/run/lightdm/root/:0
[+32.15s] DEBUG: Releasing VT 7
[+32.15s] DEBUG: Display server stopped
[+32.15s] DEBUG: Display stopped
[+32.15s] DEBUG: Seat stopped
[+32.15s] DEBUG: Display manager stopped
[+32.15s] DEBUG: Stopping daemon
[+32.15s] DEBUG: bus_entry_free: calling g_dbus_connection_unregister_object

Nothing more is printed, so presumably g_dbus_connection_unregister_object() hangs.

Kirill Elagin (kirelagin) wrote :

Gentoo Linux, lightdm 1.2.2-r1

Here is the bt:
========================

#0 __lll_lock_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:136
#1 0x000000349a00a511 in _L_lock_997 () from /lib64/libpthread.so.0
#2 0x000000349a00a32a in __pthread_mutex_lock (mutex=0x1659f10) at pthread_mutex_lock.c:61
#3 0x0000003d3bcb3ea0 in g_dbus_connection_signal_unsubscribe (connection=0x1662830, subscription_id=20) at gdbusconnection.c:3534
#4 0x0000003d3bcbe511 in g_dbus_proxy_finalize (object=0x16924d0) at gdbusproxy.c:218
#5 0x0000003d3ae13168 in g_object_unref (_object=0x16924d0) at gobject.c:2746
#6 0x0000000000406f9e in user_dispose (object=0x1660d90) at accounts.c:421
#7 0x0000003d3ae130ea in g_object_unref (_object=0x1660d90) at gobject.c:2709
#8 0x00000000004132f1 in session_finalize (object=0x168bad0) at session.c:600
#9 0x0000003d3ae13168 in g_object_unref (_object=0x168bad0) at gobject.c:2746
#10 0x000000000040bce7 in greeter_finalize (object=0x167b240) at greeter.c:694
#11 0x0000003d3ae13168 in g_object_unref (_object=0x167b240) at gobject.c:2746
#12 0x0000000000408beb in display_finalize (object=0x166e6e0) at display.c:932
#13 0x0000003d3ae13168 in g_object_unref (_object=0x166e6e0) at gobject.c:2746
#14 0x00000000004109f9 in seat_finalize (object=0x1661b00) at seat.c:666
#15 0x0000003d3ae13168 in g_object_unref (_object=0x1661b00) at gobject.c:2746
#16 0x0000003d3bcac4b7 in exported_interface_free (ei=0x167f880) at gdbusconnection.c:3880
#17 0x0000003d3a2355bc in g_hash_table_remove_internal (hash_table=0x1681640, key=0x167fb40, notify=1) at ghash.c:1200
#18 0x0000003d3bcb434e in g_dbus_connection_unregister_object (connection=0x1662830, registration_id=<optimized out>) at gdbusconnection.c:4996
#19 0x000000000040d6f7 in bus_entry_free (data=0x167db20) at lightdm.c:513
#20 0x0000003d3a235183 in g_hash_table_remove_all_nodes (hash_table=0x1681580, notify=<optimized out>) at ghash.c:513
#21 0x0000003d3a235b6a in g_hash_table_unref (hash_table=0x1681580) at ghash.c:997
#22 0x000000000040c917 in exit_cb (data=<optimized out>) at lightdm.c:152
#23 0x0000003d3a247672 in g_main_dispatch (context=0x1659c40) at gmain.c:2441
#24 g_main_context_dispatch (context=0x1659c40) at gmain.c:3011
#25 0x0000003d3a247e68 in g_main_context_iterate (context=0x1659c40, block=1, dispatch=1, self=<optimized out>) at gmain.c:3089
#26 0x0000003d3a2483ba in g_main_loop_run (loop=0x1659d30) at gmain.c:3297
#27 0x000000000040e372 in main (argc=1, argv=0x7fff108cb7d8) at lightdm.c:1207

Paul Parsons (lost-distance) wrote :

Same symptoms with lightdm-1.3.1.

Paul Parsons (lost-distance) wrote :

Upgrading the Gentoo dev-libs/glib package from 2.30.3 to 2.32.3 fixed the problem (on 32-bit systems at least).

Paul Parsons (lost-distance) wrote :

Gentoo Linux recently upgraded their stable package on x86 and amd64 architectures from glib-2.30.3 to glib-2.32.4-r1, thereby fixing this bug.

This bug should probably now be closed.

Robert Ancell (robert-ancell) wrote :

Closing as reported by Paul to be fixed by a glib upgrade.

Changed in lightdm:
status: New → Won't Fix
status: Won't Fix → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers