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 780963 - Boxes fails to connect to Spice display
Boxes fails to connect to Spice display
Status: RESOLVED FIXED
Product: gnome-boxes
Classification: Applications
Component: display
unspecified
Other Linux
: Normal normal
: --
Assigned To: GNOME Boxes maintainer(s)
GNOME Boxes maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2017-04-06 09:29 UTC by Felipe Borges
Modified: 2017-04-24 13:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
spice-session: Do not transfer open_fd() ownership (1.92 KB, patch)
2017-04-24 13:08 UTC, Pavel Grunt
committed Details | Review

Description Felipe Borges 2017-04-06 09:29:30 UTC
gnome-boxes built from master here (ce9aa75). Fedora 26.

When I try to open a box, it gets disconnected and there's a warning saying:

(gnome-boxes:28542): GSpice-WARNING **: (/home/fborges/jhbuild/checkout/spice-gtk-0.33/src/spice-widget.c:2360):update_mouse_mode: code should not be reached
Comment 1 Pavel Grunt 2017-04-06 09:36:48 UTC
do you have spice debug ?
Comment 2 Felipe Borges 2017-04-06 09:43:38 UTC
(In reply to Pavel Grunt from comment #1)
> do you have spice debug ?

Yep. https://paste.gnome.org/pvrryovka

I see that right before the update_mouse_mode warning there is
(gnome-boxes:12075): GSpice-DEBUG: /home/fborges/jhbuild/checkout/spice-gtk-0.33/src/spice-widget.c:2341 mouse mode 0

Where mouse_mode should be 1 || 2 (server, client).

I wonder what changed. I git blamed boxes' spice-display.vala code and also the the spice-gtk-0.33 spice-widget.c code and nothing related seem to have changed recently.
Comment 3 Christophe Fergeau 2017-04-06 09:51:39 UTC
Is this working if you downgrade to Boxes from f25? or if you keep Boxes from f26 and downgrade spice-gtk? What about using GDK_BACKEND=x11 rather than wayland? (the last suggestion being a shot in the dark)
Comment 4 Felipe Borges 2017-04-06 10:06:02 UTC
(In reply to Christophe Fergeau from comment #3)
> Is this working if you downgrade to Boxes from f25?

It even works with Boxes 3.24 (in f26). It doesn't work with it built from master under jhbuild.

> What about using GDK_BACKEND=x11 rather
> than wayland? (the last suggestion being a shot in the dark)

Same result. Doesn't work either.
Comment 5 Felipe Borges 2017-04-06 10:07:27 UTC
Pavel Grunt suggested me to post the xml dump of one of the boxes https://paste.gnome.org/pn9zjyc2z
Comment 6 Christophe Fergeau 2017-04-06 13:53:06 UTC
(In reply to Felipe Borges from comment #4)
> (In reply to Christophe Fergeau from comment #3)
> > Is this working if you downgrade to Boxes from f25?
> 
> It even works with Boxes 3.24 (in f26). It doesn't work with it built from
> master under jhbuild.
> 

Ah, I'd experiment with master built against a f26 system if that's possible, and with 3.24 built under jhbuild. Ie first try to figure out whether the problem is in gnome-boxes master, in your jhbuild deps, ...
Comment 7 Pavel Grunt 2017-04-11 11:10:13 UTC
I was able to reproduce using vala 0.36.1-1.fc26, distro-sync'ing to f25 version 0.34.2 fixed boxes for me...

Command I use to reproduce (Suggested by fidencio):
git clean -xfd ; ./autogen.sh --prefix=/home/pgrunt/dev && make -j && make install && /home/pgrunt/dev/bin/gnome-boxes
Comment 8 Pavel Grunt 2017-04-11 12:57:51 UTC
the changed behavior is in spice-display.vala:223 connect_it()

0.36 clears open_fd
0.34 does not change open_fd (correct behavior)

bt for 0.36:
  • #0 boxes_spice_display_real_connect_it
    at /home/pgrunt/src/gnome-boxes/src/spice-display.vala line 225
  • #1 boxes_display_connect_it
    at /home/pgrunt/src/gnome-boxes/src/display.vala line 33
  • #2 boxes_libvirt_machine_real_connect_display_co
    at /home/pgrunt/src/gnome-boxes/src/libvirt-machine.vala line 99
  • #3 boxes_libvirt_machine_connect_display_ready
    at /home/pgrunt/src/gnome-boxes/src/libvirt-machine.vala line 70
  • #4 g_task_return_now
  • #5 complete_in_idle_cb
  • #6 g_idle_dispatch
  • #7 g_main_context_dispatch
  • #8 g_main_context_iterate.isra
  • #9 g_main_context_iteration
  • #10 g_application_run
  • #11 _vala_main
    at /home/pgrunt/src/gnome-boxes/src/main.vala line 84
  • #12 main
    at /home/pgrunt/src/gnome-boxes/src/main.vala line 68
  • #0 boxes_spice_display_real_connect_it
    at /home/pgrunt/src/gnome-boxes/src/spice-display.vala line 240
  • #1 boxes_display_connect_it
    at /home/pgrunt/src/gnome-boxes/src/display.vala line 33
  • #2 boxes_libvirt_machine_real_connect_display_co
    at /home/pgrunt/src/gnome-boxes/src/libvirt-machine.vala line 99
  • #3 boxes_libvirt_machine_connect_display_ready
    at /home/pgrunt/src/gnome-boxes/src/libvirt-machine.vala line 70
  • #4 g_simple_async_result_complete
  • #5 boxes_libvirt_machine_start_co
    at /home/pgrunt/src/gnome-boxes/src/libvirt-machine.vala line 582
  • #6 boxes_libvirt_machine_start_ready
    at /home/pgrunt/src/gnome-boxes/src/libvirt-machine.vala line 587
  • #7 g_task_return_now
  • #8 complete_in_idle_cb
  • #9 g_idle_dispatch
  • #10 g_main_context_dispatch
  • #11 g_main_context_iterate.isra
  • #12 g_main_context_iteration
  • #13 g_application_run
  • #14 _vala_main
    at /home/pgrunt/src/gnome-boxes/src/main.vala line 84
  • #15 main
    at /home/pgrunt/src/gnome-boxes/src/main.vala line 68

one difference between them is use of g_simple_async_result_complete ()
Comment 9 Pavel Grunt 2017-04-24 13:08:10 UTC
Created attachment 350293 [details] [review]
spice-session: Do not transfer open_fd() ownership

Otherwise just one channel can connect
Comment 10 Felipe Borges 2017-04-24 13:14:56 UTC
Review of attachment 350293 [details] [review]:

Sure!

It solves the issue for me.
Comment 11 Felipe Borges 2017-04-24 13:15:36 UTC
Attachment 350293 [details] pushed as 3779c06 - spice-session: Do not transfer open_fd() ownership