Bug 856682 - [remote-viewer] gnome session unresponsive after connecting to vm with more displays
[remote-viewer] gnome session unresponsive after connecting to vm with more d...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: virt-viewer (Show other bugs)
6.3
Unspecified Unspecified
high Severity urgent
: rc
: ---
Assigned To: Christophe Fergeau
Virtualization Bugs
:
: 907597 (view as bug list)
Depends On: 926007
Blocks: 922712 927882
  Show dependency treegraph
 
Reported: 2012-09-12 10:58 EDT by Tomas Jamrisko
Modified: 2017-02-06 10:17 EST (History)
13 users (show)

See Also:
Fixed In Version: virt-viewer-0.5.6-1.el6
Doc Type: Bug Fix
Doc Text:
Because of what apparently is a gtk+2 bug , we cannot recreate the submenu every time we need to refresh it, otherwise the application may get frozen with the keyboard and mouse grabbed if gtk_menu_item_set_submenu is called while the menu is displayed. Reusing the same menu every time works around this issue. Cause: Recreating a menu while it being display, for example clicking View -> Displays before the connection actually gets established and leave it open. Consequence: Client may freeze. Fix: Do not recreate entirely a Gtk+ menu, but instead repopulate it. Result: Client doesn't freeze when refreshing display menu.
Story Points: ---
Clone Of:
: 912434 922712 926007 927882 (view as bug list)
Environment:
Last Closed: 2013-11-21 03:01:53 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Standalone gtk+2 testcase reproducing this problem (1.63 KB, text/x-chdr)
2013-03-22 13:27 EDT, Christophe Fergeau
no flags Details

  None (edit)
Description Tomas Jamrisko 2012-09-12 10:58:23 EDT
Description of problem:
Connecting to a VM with more displays whilst having View -> Displays expanded before the connection gets actually established results in gnome session being completely unresponsive to user input

Version-Release number of selected component (if applicable):
virt-viewer-0.5.2-9.el6.x86_64
virt-viewer-0.5.2-9.el6.i386
spice-gtk-0.11-11.el6_3.1

How reproducible:
Always

Steps to Reproduce:
1. Setup a VM (preferably in RHEVM) with 2 active screens
2. Click Console in RHEVM (or conenct to the VM any other way)
3. Click View ->, expand Displays before the connection actually gets established and leave it open
4. Wait for the connection to establish
  
Actual results:
Both displays get open, menu doesn't update, session gets frozen, remote-viewer must be killed in order to regain control.
Comment 2 Christophe Fergeau 2012-09-12 11:34:04 EDT
Any chance you can try getting a backtrace when remote-viewer is frozen?
You can attach gdb to it after it froze with "gdb --pid $(pidof remote-viewer)", and then "thread apply all bt" will give you a backtrace showing where it's frozen (you may need to use debuginfo-install virt-viewer to get the debug package to get a good backtrace).
Comment 3 Tomas Jamrisko 2012-09-13 06:49:59 EDT
This is pretty much it, i suppose: 

Thread 1 (Thread 0x7f12ab9dd980 (LWP 24601)):
#0  0x00007f12aae99218 in __poll (fds=0x24c0d50, nfds=15, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:83
#1  0x00000039bc23c655 in g_main_context_poll (context=0x22ea620, block=1, dispatch=1, self=<value optimized out>) at gmain.c:2904
#2  g_main_context_iterate (context=0x22ea620, block=1, dispatch=1, self=<value optimized out>) at gmain.c:2586
#3  0x00000039bc23cd55 in IA__g_main_loop_run (loop=0x23da1e0) at gmain.c:2799
#4  0x000000323fd4c307 in IA__gtk_main () at gtkmain.c:1218
#5  0x000000000041c305 in main (argc=1, argv=0x7fff96eb0858) at remote-viewer-main.c:180
Comment 5 Daniel Berrange 2012-10-11 11:03:11 EDT
Hmm, are you sure remote-viewer had hung at the time you took that stack trace. That trace shows everything operating 100% normally, just waiting for events.
Comment 6 Tomas Jamrisko 2012-10-11 12:32:02 EDT
Not really, that's why I referred to Session in general. 

I can't really check whether or not is remote-viewer responsive (cursor is blinking though), when the rest of the desktop only shows cursor movement and reacts just to ctrl alt F*; where i kill remote viewer. 

That's pretty much the reason why I asked about your opinion whether to move it to gtk2 as, something like, "Mutual exclusion when adding items to currently displayed menu".
Comment 8 Tomas Jamrisko 2013-02-11 08:54:03 EST
*** Bug 907597 has been marked as a duplicate of this bug. ***
Comment 9 David Blechter 2013-02-21 08:20:28 EST
Raising the severity and priority of this bug, proposing for 6.4.z due to a significant impact on rhevm 3.2 testing
Comment 11 Christophe Fergeau 2013-03-20 13:00:36 EDT
I could reproduce this with virt-viewer/spice-gtk git master *built with gtk2* on a f18. I've also been able to reproduce this on a RHEL6
This does not happen when built with gtk3, the whole display menu gets closed automatically at some point during the connection.
I've also been able to reproduce by rebooting a VM and keeping that menu open. This happens quite late in the boot process (agent or qxl loading?)
I'm getting the same backtrace as Tomas when everything is hung.
I've done these tests with a win7 guest.
At this point, I'd lean towards a gtk2 bug, but maybe this can be worked around(?)
Comment 12 Christophe Fergeau 2013-03-20 13:16:45 EDT
On my fedora18 the backtrace was actually a bit more comprehensive:

Thread 3 (Thread 0x7fe8166f5700 (LWP 31563)):
#0  0x0000003a88ce998d in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x000000301d247d24 in g_main_context_poll (priority=2147483647, n_fds=3, 
    fds=0x7fe8100010e0, timeout=-1, context=0x9ad370) at gmain.c:3584
#2  g_main_context_iterate (context=0x9ad370, block=block@entry=1, 
    dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3285
#3  0x000000301d248182 in g_main_loop_run (loop=0x9ad300) at gmain.c:3484
#4  0x00000035b06cc546 in gdbus_shared_thread_func (user_data=0x9ad340)
    at gdbusprivate.c:277
#5  0x000000301d26b605 in g_thread_proxy (data=0x9dc0f0) at gthread.c:797
#6  0x0000003a89007d15 in start_thread (arg=0x7fe8166f5700)
    at pthread_create.c:308
#7  0x0000003a88cf246d in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:114

Thread 2 (Thread 0x7fe814a2a700 (LWP 31566)):
#0  0x0000003a88ce998d in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x000000301d247d24 in g_main_context_poll (priority=2147483647, n_fds=1, 
    fds=0x7fe8080010c0, timeout=-1, context=0xa69a50) at gmain.c:3584
#2  g_main_context_iterate (context=context@entry=0xa69a50, block=block@entry=
    1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3285
#3  0x000000301d247e44 in g_main_context_iteration (context=0xa69a50, 
    may_block=1) at gmain.c:3351
#4  0x00007fe814a3e48d in dconf_gdbus_worker_thread ()
   from /usr/lib64/gio/modules/libdconfsettings.so
#5  0x000000301d26b605 in g_thread_proxy (data=0xa3eed0) at gthread.c:797
#6  0x0000003a89007d15 in start_thread (arg=0x7fe814a2a700)
    at pthread_create.c:308
#7  0x0000003a88cf246d in clone ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S:114

Thread 1 (Thread 0x7fe8232f09c0 (LWP 31560)):
#0  0x0000003a88ce998d in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x000000301d247d24 in g_main_context_poll (priority=2147483647, n_fds=15, 
    fds=0xae4220, timeout=-1, context=0x884be0) at gmain.c:3584
#2  g_main_context_iterate (context=0x884be0, block=block@entry=1, 
    dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3285
#3  0x000000301d248182 in g_main_loop_run (loop=0x93fde0) at gmain.c:3484
#4  0x0000003d3cf4b077 in IA__gtk_main () at gtkmain.c:1257
#5  0x000000000040e3c7 in main (argc=1, argv=0x7fff46571958)
    at remote-viewer-main.c:316
Comment 13 Christophe Fergeau 2013-03-20 13:22:39 EDT
(thread 2 is about dconf, not sure at all the 2 additional threads are relevant at all).
Comment 14 Christophe Fergeau 2013-03-21 05:52:51 EDT
G_MESSAGES_DEBUG=all log before dying is below, should be possible to use this to debug further )

(remote-viewer:18130): GSpiceController-DEBUG: controller.vala:178: got CONNECT request
(remote-viewer:18130): GSpiceController-DEBUG: controller.vala:246: new message 17size 8
(remote-viewer:18130): GSpiceController-DEBUG: controller.vala:182: got SHOW request

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed
(remote-viewer:18130): GSpice-DEBUG: #0 +0+0-1152x864

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed
(remote-viewer:18130): GSpice-DEBUG: #0 +0+0-1152x864

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed
Comment 15 Christophe Fergeau 2013-03-21 06:23:14 EDT
Actually, the (remote-viewer:18130): Gtk-CRITICAL **: IA__gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed warnings only appear when moving the mouse when everything is frozen ('frozen' = keyboard/mouse(?) grabbed, so screen is refreshing, but you can't interact with anything else). This is consistent with what is happening on screen as when things freeze, the submenu listing the available displays becomes blank (before it was populated), so consistent with 'widget should be displayed here, but is unrealized for whatever reason).
Comment 16 Christophe Fergeau 2013-03-22 13:27:55 EDT
Created attachment 714691 [details]
Standalone gtk+2 testcase reproducing this problem

This is indeed a gtk+2 bug, the attached testcase reproduce this bug by opening the submenu and then waiting for the refresh to happen. The issue appears after the call to gtk_menu_item_set_submenu.
If we reuse the existing submenu, empty it and add the new content instead of recreating the submenu everytime and setting it with _set_submenu, then the bug does not occur. I'll send such a workaround for virt-viewer.
Comment 17 Christophe Fergeau 2013-03-23 04:28:32 EDT
Patch sent upstream https://www.redhat.com/archives/virt-tools-list/2013-March/msg00133.html
Comment 23 CongDong 2013-07-11 04:51:44 EDT
I can reproduce this bug:
Version:
# rpm -qa virt-viewer
virt-viewer-0.5.2-16.el6.x86_64
# rpm -qa gtk2
gtk2-2.18.9-10.el6.x86_64
# rpm -qa spice-gtk
spice-gtk-0.14-4.el6.x86_64

Steps:
As the steps in descritpion

Result:
Both displays get open, menu doesn't update, session gets frozen, remote-viewer must be killed in order to regain control.

Verify:
# rpm -qa spice-gtk gtk2 virt-viewer
spice-gtk-0.14-7.el6.x86_64
gtk2-2.18.9-12.el6.x86_64
virt-viewer-0.5.6-1.el6.x86_64

Steps:
As the steps above.

Result:
The virt-viewer works well, the window and menu didn't get frozen.

As the result, change to VERIFIED.
Comment 24 errata-xmlrpc 2013-11-21 03:01:53 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-1578.html

Note You need to log in before you can comment on or make changes to this bug.