Crash with empty .savedSearch file

Bug #433673 reported by Marcus Carlson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Nautilus
Fix Released
Critical
nautilus (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Binary package hint: nautilus

This is not a major problem as it can only be reproduced synthetically but still it should be fixed as it crashes nautilus every time.
Steps to reproduce:
 1. Create a new file named foo.savedSearch
 2. Double click the new file

Nautilus has now crashed.

I can probably fix this myself later but not now, just creating this report so it wont be forgotten.

Stacktrace from Jaunty
#0 0x00007f50384afe09 in _g_utf8_normalize_wc (str=0x0, max_len=-1,
    mode=G_NORMALIZE_DEFAULT)
    at /build/buildd/glib2.0-2.20.1/glib/gunidecomp.c:364
#1 0x00007f50384b0443 in IA__g_utf8_normalize (str=0x0, len=-1,
    mode=G_NORMALIZE_DEFAULT)
    at /build/buildd/glib2.0-2.20.1/glib/gunidecomp.c:525
#2 0x00000000004fd169 in nautilus_search_engine_simple_start (
    engine=<value optimized out>) at nautilus-search-engine-simple.c:112
#3 0x0000000000471ad0 in finish_loading (view=0x1d3dc50)
    at fm-directory-view.c:8535
#4 0x00000000004b29d7 in call_ready_callbacks_at_idle (
    callback_data=<value optimized out>) at nautilus-directory-async.c:1908
#5 0x00007f503847e20a in IA__g_main_context_dispatch (context=0x17b98e0)
    at /build/buildd/glib2.0-2.20.1/glib/gmain.c:1814
#6 0x00007f50384818e0 in g_main_context_iterate (context=0x17b98e0, block=1,
    dispatch=1, self=<value optimized out>)
    at /build/buildd/glib2.0-2.20.1/glib/gmain.c:2448
#7 0x00007f5038481dad in IA__g_main_loop_run (loop=0x1b05f60)
    at /build/buildd/glib2.0-2.20.1/glib/gmain.c:2656
#8 0x00007f5039cebbc7 in IA__gtk_main ()
    at /build/buildd/gtk+2.0-2.16.1/gtk/gtkmain.c:1205
#9 0x0000000000442bc7 in main (argc=1, argv=0x7fff43871ce8)
    at nautilus-main.c:518

Revision history for this message
A. Walton (awalton) wrote :

To be honest, the whole NautilusQuery code needs a rewrite. It's entirely inadequate and sub-par (e.g. the usage of g_file_test() before opening the file is a race, g_file_get_contents() is sync. i/o, etc). Could do a couple of band-aid patches to prevent it from crashing, but this is probably a fairly rare crash:

diff --git a/libnautilus-private/nautilus-query.c b/libnautilus-private/nautilus
index 267620d..b6a3f55 100644
--- a/libnautilus-private/nautilus-query.c
+++ b/libnautilus-private/nautilus-query.c
@@ -300,15 +300,18 @@ nautilus_query_load (char *file)
        NautilusQuery *query;
        char *xml;
        gsize xml_len;
-
+
+ xml_len = 0;
+ query = NULL;
+
        if (!g_file_test (file, G_FILE_TEST_EXISTS)) {
                return NULL;
        }
-

- g_file_get_contents (file, &xml, &xml_len, NULL);
- query = nautilus_query_parse_xml (xml, xml_len);
+ if (g_file_get_contents (file, &xml, &xml_len, NULL) && xml_len != 0) {
+ query = nautilus_query_parse_xml (xml, xml_len);
+ }

(then we have to make sure that the code's doing the right thing with the NULL return, etc)

Changed in nautilus (Ubuntu):
assignee: nobody → Ubuntu Desktop Bugs (desktop-bugs)
importance: Undecided → Medium
status: New → Triaged
Changed in nautilus (Ubuntu):
status: Triaged → Confirmed
Revision history for this message
Victor Vargas (kamus) wrote :

This bug has been reported to the developers of the software. You can track it and make comments at:
https://bugzilla.gnome.org/show_bug.cgi?id=601205

Thanks!

Changed in nautilus:
importance: Undecided → Unknown
status: New → Unknown
Changed in nautilus (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
Marcus Carlson (0-launchpad-mejlamej-nu) wrote :

awalton, could you post the patch upstream instead (or just commit) or do you think we should wait for the search functions to be rewritten?

Changed in nautilus:
status: Unknown → New
Changed in nautilus:
importance: Unknown → Medium
Changed in nautilus:
importance: Medium → Critical
Changed in nautilus:
status: New → Fix Released
Changed in nautilus (Ubuntu):
assignee: Ubuntu Desktop Bugs (desktop-bugs) → nobody
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.