gnome-settings-daemon / check_gl_texture_size deadlock because g-s-d has server grab

Bug #871188 reported by Chris Coulson
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gnome-desktop3 (Ubuntu)
Fix Released
High
Chris Halse Rogers
Oneiric
Fix Released
High
Chris Halse Rogers

Bug Description

I've noticed for the past week or so that every time I open my laptop lid or press the display key, my laptop appears to lock up entirely. Initially, I thought this might be a compiz or X bug, as the only obvious way to recover is to kill my session and log in again. However, I did a bit of debugging this morning and this is due to the recent gnome-desktop change to work around bug 824099.

What happens is:

1) gnome-settings-daemon takes a server grab
2) It then runs check_gl_texture_size
3) check_gl_texture_size hangs in XOpenDisplay because g-s-d has a grab
4) g-s-d hangs because it waits for check_gl_texture_size to exit
5) The entire desktop appears to be locked up, because g-s-d never lets go of its grab

This is repeatable for me - it happens every single time I open my laptop lid, which is a bit of an inconvenience tbh (my laptop seems to trigger a fake Fn+F7 keypress when this happens, which is another matter)

If you're curious, this is where g-s-d hangs (sorry, I didn't have gnome-desktop symbols installed for this one, but the missing symbol in frame 9 is screen_update):

#0 0x00007f93e7b69c3d in __libc_waitpid (pid=<optimized out>, stat_loc=<optimized out>, options=<optimized out>) at ../sysdeps/unix/sysv/linux/waitpid.c:41
#1 0x00007f93e77435fa in ?? () from /usr/lib/libgnome-desktop-3.so.2
#2 0x00007f93e774477b in gnome_rr_config_applicable () from /usr/lib/libgnome-desktop-3.so.2
#3 0x00007f93d7dfa19d in auto_configure_outputs (timestamp=1506448, manager=0xb64190) at gsd-xrandr-manager.c:1564
#4 on_randr_event (screen=<optimized out>, data=<optimized out>) at gsd-xrandr-manager.c:1681
#5 0x00007f93e68db0a4 in g_closure_invoke (closure=0xb6c890, return_value=0x0, n_param_values=1, param_values=0xd68660, invocation_hint=<optimized out>)
    at /build/buildd/glib2.0-2.30.0/./gobject/gclosure.c:774
#6 0x00007f93e68ed02a in signal_emit_unlocked_R (node=<optimized out>, detail=0, instance=0xb5d180, emission_return=0x0, instance_and_params=0xd68660)
    at /build/buildd/glib2.0-2.30.0/./gobject/gsignal.c:3272
#7 0x00007f93e68f66b1 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=<optimized out>)
    at /build/buildd/glib2.0-2.30.0/./gobject/gsignal.c:3003
#8 0x00007f93e68f6852 in g_signal_emit (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at /build/buildd/glib2.0-2.30.0/./gobject/gsignal.c:3060
#9 0x00007f93e77412b4 in ?? () from /usr/lib/libgnome-desktop-3.so.2
#10 0x00007f93e7741390 in gnome_rr_screen_refresh () from /usr/lib/libgnome-desktop-3.so.2
#11 0x00007f93d7df9a4a in handle_fn_f7 (timestamp=1505379, mgr=0xb64190) at gsd-xrandr-manager.c:1185
#12 gsd_xrandr_manager_2_video_mode_switch (timestamp=1505379, manager=0xb64190, error=<optimized out>) at gsd-xrandr-manager.c:677
#13 handle_method_call (connection=<optimized out>, sender=<optimized out>, object_path=<optimized out>, interface_name=<optimized out>, method_name=<optimized out>,
    parameters=<optimized out>, invocation=0xc482a0, user_data=0xb64190) at gsd-xrandr-manager.c:2047
#14 0x00007f93e6bcb620 in call_in_idle_cb (user_data=<optimized out>) at /build/buildd/glib2.0-2.30.0/./gio/gdbusconnection.c:4446
#15 0x00007f93e6211a5d in g_main_dispatch (context=0xac1600) at /build/buildd/glib2.0-2.30.0/./glib/gmain.c:2441
#16 g_main_context_dispatch (context=0xac1600) at /build/buildd/glib2.0-2.30.0/./glib/gmain.c:3011
#17 0x00007f93e6212258 in g_main_context_iterate (context=0xac1600, block=<optimized out>, dispatch=1, self=<optimized out>) at /build/buildd/glib2.0-2.30.0/./glib/gmain.c:3089
#18 0x00007f93e6212792 in g_main_loop_run (loop=0x7f93d8016810) at /build/buildd/glib2.0-2.30.0/./glib/gmain.c:3297
#19 0x00007f93e722ce1d in gtk_main () at /build/buildd/gtk+3.0-3.2.0/./gtk/gtkmain.c:1367
#20 0x0000000000403caf in main (argc=1, argv=0x7fffd483a4f8) at main.c:466

And check_gl_texture_size:

#0 0x00007f7ad6716738 in __GI___poll (fds=0x7fff42d8f530, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:83
#1 0x00007f7ad642eecd in ?? () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#2 0x00007f7ad642d369 in xcb_connect_to_fd () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#3 0x00007f7ad64301d8 in xcb_connect_to_display_with_auth_info () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#4 0x00007f7ad6c7ba02 in _XConnectXCB (dpy=0x1b90010, display=0x0, screenp=0x7fff42d8f87c) at ../../src/xcb_disp.c:78
#5 0x00007f7ad6c6b741 in XOpenDisplay (display=0x0) at ../../src/OpenDis.c:129
#6 0x0000000000400872 in main (argc=<optimized out>, argv=<optimized out>) at check_gl_texture_size.c:12

Changed in gnome-desktop3 (Ubuntu Oneiric):
importance: Undecided → High
status: New → Triaged
assignee: nobody → Canonical Desktop Team (canonical-desktop-team)
Changed in gnome-desktop3 (Ubuntu Oneiric):
assignee: Canonical Desktop Team (canonical-desktop-team) → Chris Halse Rogers (raof)
Revision history for this message
Chris Halse Rogers (raof) wrote :

I'm surprised that this happens each time you open your lid - check_gl_texture_size should be run exactly once per g-s-d process, since it caches the result.

I'll see what's happening with the server grab.

Revision history for this message
Robert Roth (evfool) wrote :

Does this have anything to do with bug #862161?

Revision history for this message
Chris Halse Rogers (raof) wrote :

I don't believe so, no.

Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Hello Chris, or anyone else affected,

Accepted gnome-desktop3 into oneiric-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in gnome-desktop3 (Ubuntu Oneiric):
status: Triaged → Fix Committed
tags: added: verification-needed
Revision history for this message
Chris Coulson (chrisccoulson) wrote :

The actual deadlock is fixed, although I still end up with a completely blank screen when I undock my laptop. However, it's recoverable by pressing the Fn+F7 key again, so I suspect it's not related to this and is another symptom of my laptop faking this keypress when I undock it.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gnome-desktop3 - 3.2.0-0ubuntu4.1

---------------
gnome-desktop3 (3.2.0-0ubuntu4.1) oneiric-proposed; urgency=low

  * debian/patches/02_refuse_to_break_GL_compositors.patch:
    - Add extra paranoid checks to fail gracefully in the case of errors in
      check_gl_texture_size. Eliminates (otherwise harmless) crashes.
      (LP: #862161, LP: #862998, LP: #861804, LP: #861548)
    - Wait for check_gl_texture_size no longer than 500msec. Ensures that
      this check will not block the desktop, as in (LP: #871188).
  * Remove debian-changes patch which accidentally reverted the change meant
    to be applied in 3.2.0-0ubuntu4.
 -- Christopher James Halse Rogers <email address hidden> Tue, 11 Oct 2011 10:30:22 +1100

Changed in gnome-desktop3 (Ubuntu):
status: Fix Committed → Fix Released
Changed in gnome-desktop3 (Ubuntu Oneiric):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.