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 679040 - crash in boxes_collection_view_get_path_for_item
crash in boxes_collection_view_get_path_for_item
Status: RESOLVED FIXED
Product: gnome-boxes
Classification: Applications
Component: general
3.5.x (unsupported)
Other Linux
: Normal normal
: --
Assigned To: GNOME Boxes maintainer(s)
GNOME Boxes maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2012-06-28 10:27 UTC by Christophe Fergeau
Modified: 2016-03-31 13:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Break out some code into a helper function (3.76 KB, patch)
2012-06-28 14:51 UTC, Alexander Larsson
committed Details | Review
Don't crash when zooming out of a removed box (1.12 KB, patch)
2012-06-28 14:51 UTC, Alexander Larsson
committed Details | Review

Description Christophe Fergeau 2012-06-28 10:27:40 UTC
- start boxes
- create a new f17 box with unattended install
- click on the box to see it's content
- go back to the collection view
- delete the box while it's running
- create another f17 box with unattended install
-> crash when clicking on the "create" button

  • #0 boxes_collection_view_get_path_for_item
    at collection-view.c line 1363
  • #1 boxes_collection_view_real_ui_state_changed
    at collection-view.c line 811
  • #2 boxes_ui_ui_state_changed
    at ui.c line 92
  • #3 boxes_ui_set_ui_state
    at ui.c line 132
  • #4 boxes_app_real_ui_state_changed
    at app.c line 2881
  • #5 boxes_ui_ui_state_changed
    at ui.c line 92
  • #6 boxes_ui_set_ui_state
    at ui.c line 132
  • #7 boxes_wizard_set_page
    at wizard.c line 3045
  • #8 __lambda118_
    at wizard.c line 2209
  • #9 ___lambda118__gtk_button_clicked
    at wizard.c line 2214
  • #10 g_cclosure_marshal_VOID__VOIDv
    at gmarshal.c line 115
  • #11 _g_closure_invoke_va
    at gclosure.c line 840
  • #12 g_signal_emit_valist
    at gsignal.c line 3211
  • #13 g_signal_emit
    at gsignal.c line 3356
  • #14 gtk_button_clicked
    at gtkbutton.c line 1363
  • #15 gtk_real_button_released
    at gtkbutton.c line 2019
  • #16 g_cclosure_marshal_VOID__VOIDv
    at gmarshal.c line 115
  • #17 g_type_class_meta_marshalv
    at gclosure.c line 997
  • #18 _g_closure_invoke_va
    at gclosure.c line 840
  • #19 g_signal_emit_valist
    at gsignal.c line 3211
  • #20 g_signal_emit
    at gsignal.c line 3356
  • #21 gtk_button_button_release
    at gtkbutton.c line 1854
  • #22 _gtk_marshal_BOOLEAN__BOXEDv
    at gtkmarshalers.c line 130
  • #23 g_type_class_meta_marshalv
    at gclosure.c line 997
  • #24 _g_closure_invoke_va
    at gclosure.c line 840
  • #25 g_signal_emit_valist
    at gsignal.c line 3211
  • #26 g_signal_emit
    at gsignal.c line 3356
  • #27 gtk_widget_event_internal
  • #28 gtk_widget_event
    at gtkwidget.c line 5946
  • #29 propagate_event_up
    at gtkmain.c line 2391
  • #30 propagate_event
    at gtkmain.c line 2491
  • #31 gtk_propagate_event
    at gtkmain.c line 2526
  • #32 gtk_main_do_event
    at gtkmain.c line 1714
  • #33 _gdk_event_emit
    at gdkevents.c line 69
  • #34 gdk_event_source_dispatch
    at gdkeventsource.c line 358
  • #35 g_main_dispatch
    at gmain.c line 2539
  • #36 g_main_context_dispatch
    at gmain.c line 3075
  • #37 g_main_context_iterate
    at gmain.c line 3146
  • #38 g_main_context_iteration
    at gmain.c line 3207
  • #39 g_application_run
    at gapplication.c line 1607
  • #40 boxes_app_run
    at app.c line 1188
  • #41 _vala_main
    at main.c line 729
  • #42 main
    at main.c line 740

See bug #678894 where this bug was first mentioned, Zeeshan has another reproducer (which I did not test):

Zeeshan Ali (Khattak) [reporter] [gnome-boxes developer] 2012-06-28 02:29:52 UTC

Aha, this crash seem to have nothing to do with my recent changes. I can
reproduce it against v3.5.3 tag. Steps I take to reproduce this:

1. Create a machine for live media (I used F17) through wizard.
2. Shut it down from inside the guest.

Seems more like a regression from Alex's zoom in/out patches.
Comment 1 Alexander Larsson 2012-06-28 14:51:13 UTC
Created attachment 217529 [details] [review]
Break out some code into a helper function

This avoids some code duplication.
Comment 2 Alexander Larsson 2012-06-28 14:51:16 UTC
Created attachment 217530 [details] [review]
Don't crash when zooming out of a removed box

Instead we zoom to 0,0.
Comment 3 Zeeshan Ali 2012-06-28 17:29:52 UTC
Review of attachment 217529 [details] [review]:

Looks good otherwise.

::: src/collection-view.vala
@@ -198,3 +205,3 @@
     }
 
-    private Gtk.TreePath get_path_for_item (CollectionItem item) {
+    private Gtk.TreePath? get_path_for_item (CollectionItem item) {

This change seems unrelated to this patch?

@@ -201,2 +208,2 @@
         var iter = item.get_data<Gtk.TreeIter?> ("iter");
-        return model.get_path (iter);
+        if (iter != null)

I'd rather do it as this so its clear which one is exception here:

if (iter == null)
   return null;

return model.get_path (iter);
Comment 4 Zeeshan Ali 2012-06-28 17:30:32 UTC
Review of attachment 217530 [details] [review]:

ACK!
Comment 5 Alexander Larsson 2012-06-28 17:35:50 UTC
Review of attachment 217529 [details] [review]:

::: src/collection-view.vala
@@ -198,3 +205,3 @@
     }
 
-    private Gtk.TreePath get_path_for_item (CollectionItem item) {
+    private Gtk.TreePath? get_path_for_item (CollectionItem item) {

Agh, yeah, it should be in the other patch.
Comment 6 Alexander Larsson 2012-06-28 17:46:55 UTC
Attachment 217529 [details] pushed as 04f54c0 - Break out some code into a helper function
Attachment 217530 [details] pushed as 6d61294 - Don't crash when zooming out of a removed box