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 662131 - nautilus crashed with SIGSEGV in g_type_create_instance()
nautilus crashed with SIGSEGV in g_type_create_instance()
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: Crashers
3.2.x
Other Linux
: Normal critical
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-10-18 19:42 UTC by Pedro Villavicencio
Modified: 2012-09-05 19:06 UTC
See Also:
GNOME target: ---
GNOME version: 3.1/3.2


Attachments
Show name column even if we can't load column preferences (1.70 KB, patch)
2012-09-05 00:22 UTC, William Jon McCann
reviewed Details | Review
Show name column even if we can't load column preferences (1.97 KB, patch)
2012-09-05 14:02 UTC, William Jon McCann
reviewed Details | Review
Don't crash if we can't load column preferences (1.83 KB, patch)
2012-09-05 17:02 UTC, William Jon McCann
committed Details | Review

Description Pedro Villavicencio 2011-10-18 19:42:51 UTC
this report has been filed here:

https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/874496

"Nautilus crashed immediately afer login first time after update "

".

Thread 1 (Thread 0xb785b850 (LWP 18019))

  • #0 apply_columns_settings
    at nautilus-list-view.c line 1415
  • #1 create_and_set_up_tree_view
    at nautilus-list-view.c line 1747
  • #2 nautilus_list_view_init
    at nautilus-list-view.c line 3320
  • #3 g_type_create_instance
    at /build/buildd/glib2.0-2.30.0/./gobject/gtype.c line 1885
  • #4 g_object_constructor
    at /build/buildd/glib2.0-2.30.0/./gobject/gobject.c line 1629
  • #5 g_object_newv
    at /build/buildd/glib2.0-2.30.0/./gobject/gobject.c line 1493
  • #6 g_object_new_valist
    at /build/buildd/glib2.0-2.30.0/./gobject/gobject.c line 1610
  • #7 g_object_new
    at /build/buildd/glib2.0-2.30.0/./gobject/gobject.c line 1325
  • #8 nautilus_list_view_create
    at nautilus-list-view.c line 3362
  • #9 nautilus_view_factory_create
    at nautilus-view-factory.c line 70
  • #10 create_content_view
    at nautilus-window-manage-views.c line 1067
  • #11 got_file_info_for_view_selection_callback
    at nautilus-window-manage-views.c line 955
  • #12 ready_callback_call
    at nautilus-directory-async.c line 1279
  • #13 call_ready_callbacks_at_idle
    at nautilus-directory-async.c line 1861
  • #14 g_idle_dispatch
    at /build/buildd/glib2.0-2.30.0/./glib/gmain.c line 4801
  • #15 g_main_dispatch
    at /build/buildd/glib2.0-2.30.0/./glib/gmain.c line 2441
  • #16 g_main_context_dispatch
    at /build/buildd/glib2.0-2.30.0/./glib/gmain.c line 3011
  • #17 g_main_context_iterate
    at /build/buildd/glib2.0-2.30.0/./glib/gmain.c line 3089
  • #18 g_main_loop_run
    at /build/buildd/glib2.0-2.30.0/./glib/gmain.c line 3297
  • #19 gtk_main
    at /build/buildd/gtk+3.0-3.2.0/./gtk/gtkmain.c line 1367
  • #20 gtk_application_run_mainloop
    at /build/buildd/gtk+3.0-3.2.0/./gtk/gtkapplication.c line 115
  • #21 g_application_run
    at /build/buildd/glib2.0-2.30.0/./gio/gapplication.c line 1323
  • #22 main
    at nautilus-main.c line 102

Comment 1 William Jon McCann 2012-09-05 00:22:54 UTC
Created attachment 223485 [details] [review]
Show name column even if we can't load column preferences

This is a bit better than crashing.
Comment 2 Cosimo Cecchi 2012-09-05 13:13:19 UTC
Review of attachment 223485 [details] [review]:

::: src/nautilus-list-view.c
@@ +1245,3 @@
+	if (column_order != NULL) {
+		all_columns = nautilus_sort_columns (all_columns, column_order);
+	}

This shouldn't be necessary, as nautilus_sort_columns() does the NULL check already.

@@ +1259,3 @@
+		}
+	} else {
+		g_hash_table_insert (visible_columns_hash, g_strdup ("name"), g_strdup ("name"));

I'd rather not have this here...nothing bad should happen if we leave the HT empty, no?
Comment 3 William Jon McCann 2012-09-05 13:18:24 UTC
Review of attachment 223485 [details] [review]:

::: src/nautilus-list-view.c
@@ +1245,3 @@
+	if (column_order != NULL) {
+		all_columns = nautilus_sort_columns (all_columns, column_order);
+	}

It does the null check wrong :)

It should probably return the list instead of NULL when the input is NULL.

@@ +1259,3 @@
+		}
+	} else {
+		g_hash_table_insert (visible_columns_hash, g_strdup ("name"), g_strdup ("name"));

Rather have what? If the hash table is empty you open a blank window with no columns. That seems pretty horrible.
Comment 4 Cosimo Cecchi 2012-09-05 13:34:30 UTC
(In reply to comment #3)
> Review of attachment 223485 [details] [review]:
> 
> ::: src/nautilus-list-view.c
> @@ +1245,3 @@
> +    if (column_order != NULL) {
> +        all_columns = nautilus_sort_columns (all_columns, column_order);
> +    }
> 
> It does the null check wrong :)
> 
> It should probably return the list instead of NULL when the input is NULL.

Okay, that can be changed then.

> @@ +1259,3 @@
> +        }
> +    } else {
> +        g_hash_table_insert (visible_columns_hash, g_strdup ("name"), g_strdup
> ("name"));
> 
> Rather have what? If the hash table is empty you open a blank window with no
> columns. That seems pretty horrible.

The thing is we should never reach this code with a NULL value, unless the user forcefully disabled all the columns in the preferences or we hit a GSettings bug (in the stacktrace we're being called with a value coming directly from GSettings, and the default in the schema is not null).
We don't make one column mandatory anywhere else (e.g. you can remove all the columns from Visible Columns), so I don't think we should do it here, at least not as part of this fix.
Comment 5 William Jon McCann 2012-09-05 13:47:43 UTC
I don't think we should allow disabling the name column ever. And I think even in the case of a gsettings bug coming up with no columns is unacceptable. The entire point of this patch is to guard against a broken gsettings basically and I think that simply not crashing but coming up unusable isn't worth doing.
Comment 6 Cosimo Cecchi 2012-09-05 14:02:17 UTC
(In reply to comment #5)
> I don't think we should allow disabling the name column ever. And I think even
> in the case of a gsettings bug coming up with no columns is unacceptable. The
> entire point of this patch is to guard against a broken gsettings basically and
> I think that simply not crashing but coming up unusable isn't worth doing.

I agree with you that coming up with an empty view is not something that we want.
However, that still sounds like a more general problem to me, which involves changing the Visible Columns dialog too. Until we enforce that consistently in all the situations, I'd rather take the simplest possible fix for this crasher.
Comment 7 William Jon McCann 2012-09-05 14:02:23 UTC
Created attachment 223542 [details] [review]
Show name column even if we can't load column preferences

This is a bit better than crashing.
Comment 8 Cosimo Cecchi 2012-09-05 14:20:32 UTC
Review of attachment 223542 [details] [review]:

::: src/nautilus-list-view.c
@@ +1260,1 @@
 	}

As I said in the previous comment, I don't think this is the right place to fix it. I'd rather take only the other parts of the patch, and fix the empty view separately.
Comment 9 William Jon McCann 2012-09-05 17:02:23 UTC
Created attachment 223566 [details] [review]
Don't crash if we can't load column preferences
Comment 10 Cosimo Cecchi 2012-09-05 17:05:53 UTC
Review of attachment 223566 [details] [review]:

Thanks!
Comment 11 William Jon McCann 2012-09-05 19:06:17 UTC
Attachment 223566 [details] pushed as 185dad3 - Don't crash if we can't load column preferences