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 761202 - Crash when leaving VNC connection
Crash when leaving VNC connection
Status: RESOLVED FIXED
Product: gnome-boxes
Classification: Applications
Component: general
3.18.x
Other Linux
: Normal normal
: --
Assigned To: GNOME Boxes maintainer(s)
GNOME Boxes maintainer(s)
: 767490 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2016-01-27 18:18 UTC by Michael Catanzaro
Modified: 2016-09-20 08:15 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Michael Catanzaro 2016-01-27 18:18:29 UTC
* Open a VNC connection
* Press the back button in the upper left

Boxes crashes 100% for me. Check the See Also field for a full backtrace in the downstream bug.
Comment 1 Pavel Grunt 2016-03-16 08:20:21 UTC
maybe the signal lives longer than the display

this avoids the crash for me:

diff --git a/src/vnc-display.vala b/src/vnc-display.vala
index 8cf5d42..e78c474 100644
--- a/src/vnc-display.vala
+++ b/src/vnc-display.vala
@@ -70,9 +70,7 @@
             display.close ();
         });
 
-        this.notify["config"].connect (() => {
-            config.sync_properties (display, sync_properties);
-        });
+        this.config.sync_properties (display, sync_properties);
     }
 
     public VncDisplay (BoxConfig config, string host, int port) {
Comment 2 Zeeshan Ali 2016-03-16 12:50:11 UTC
(In reply to Pavel Grunt from comment #1)
> maybe the signal lives longer than the display

Hmm.. that is very much possible. I'll see if we can use g_signal_connect_object() from vala.

> this avoids the crash for me:

Thanks for helping out with investigation. :)
Comment 3 Zeeshan Ali 2016-03-16 13:46:12 UTC
Looking at the backtrace, i don't think that's the issue here but it's just that not connecting to the signal, means this code doesn't get called:

  • #1 g_strdup
    at gstrfuncs.c line 362
  • #2 boxes_box_config_sync_property_copy
    at /home/zeenix/checkout/gnome/gnome-boxes/src/box-config.vala line 4
  • #3 __lambda4_
    at /home/zeenix/checkout/gnome/gnome-boxes/src/box-config.vala line 151
  • #4 ___lambda4__g_object_notify
    at /home/zeenix/checkout/gnome/gnome-boxes/src/box-config.vala line 150
  • #5 g_cclosure_marshal_VOID__PARAM
    at gmarshal.c line 1832
  • #6 g_closure_invoke
    at gclosure.c line 804
  • #7 signal_emit_unlocked_R
    at gsignal.c line 3629
  • #8 g_signal_emit_valist
    at gsignal.c line 3385
  • #9 g_signal_emit
    at gsignal.c line 3441
  • #10 g_object_dispatch_properties_changed
    at gobject.c line 1062
  • #11 g_object_notify_by_spec_internal
    at gobject.c line 1155
  • #12 g_object_notify_by_pspec
    at gobject.c line 1265
  • #13 gtk_widget_hide
    at gtkwidget.c line 4886
  • #14 gtk_widget_dispose
    at gtkwidget.c line 12022
  • #15 g_object_unref
    at gobject.c line 3146
  • #16 on_disconnected
    at vncdisplay.c line 1716
  • #17 g_cclosure_marshal_VOID__VOIDv
    at gmarshal.c line 905
  • #18 _g_closure_invoke_va
    at gclosure.c line 867
  • #19 g_signal_emit_valist
    at gsignal.c line 3294
  • #20 g_signal_emit
    at gsignal.c line 3441
  • #21 do_vnc_connection_emit_main_context
    at vncconnection.c line 613
  • #22 g_idle_dispatch
    at gmain.c line 5441
  • #23 g_main_dispatch
    at gmain.c line 3154
  • #24 g_main_context_dispatch
    at gmain.c line 3769
  • #25 g_main_context_iterate
    at gmain.c line 3840
  • #26 g_main_context_iteration
    at gmain.c line 3901
  • #27 g_application_run
    at gapplication.c line 2381
  • #28 _vala_main

Comment 4 Zeeshan Ali 2016-03-16 17:21:21 UTC
There is still some issue of 'readonly' property of VNC display not getting loaded after it's changed via properties launched from overview but that would a separate bug.

---
commit: 262cfe580c18cdbbbae5e3e8c6523ecf9f444b81
Date:   Wed Mar 16 16:54:06 2016 +0000

    box-config: SyncProperty -> SavedProperty
    
    SyncProperty is a silly and confusing name.

commit: 498461a841545a20488f3a08bca4b79cd2185a83
Date:   Wed Mar 16 15:37:14 2016 +0000

    box-config: Don't access passed array after method returns
    
    Seems we can't rely on the passed array of structs to be around in a
    closure and get a crash.
    
    This patch fixes a crash when going back to overview from a VNC display.

commit: fe4f075a1f4e3feb515c81b2c03c499c1317f32b
Date:   Wed Mar 16 16:03:27 2016 +0000

    machine: Add a null check
    
    The 'window' is already gone when display is hidden as part of Boxes
    shutdown so accessing it only crashes Boxes on exit.

commit: 031b7918dee1ff016d74a69515f9cdbabc4b6b31
Date:   Wed Mar 16 16:28:40 2016 +0000

    display: config property now protected
    
    It's only set by subclasses anyway.
    
commit: 447d66dfbb6ea372b1fb48f545a5de675463f2c5
Date:   Wed Mar 16 16:30:41 2016 +0000

    spice,vnc: Simplify setting up syncing of properties
    
    Instead of hooking-up to 'config' property changes to set-up syncing of
    saved properties of display, let's just do that already after
    initializing 'config' property (which happens once anyway).
Comment 5 Zeeshan Ali 2016-03-16 17:32:11 UTC
Filed bug#763772 for Read-only not getting saved/loaded.
Comment 6 Zeeshan Ali 2016-06-23 14:09:34 UTC
*** Bug 767490 has been marked as a duplicate of this bug. ***