Crash with empty .savedSearch file
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_
mode=
at /build/
#1 0x00007f50384b0443 in IA__g_utf8_
mode=
at /build/
#2 0x00000000004fd169 in nautilus_
engine=<value optimized out>) at nautilus-
#3 0x0000000000471ad0 in finish_loading (view=0x1d3dc50)
at fm-directory-
#4 0x00000000004b29d7 in call_ready_
callback_
#5 0x00007f503847e20a in IA__g_main_
at /build/
#6 0x00007f50384818e0 in g_main_
dispatch=1, self=<value optimized out>)
at /build/
#7 0x00007f5038481dad in IA__g_main_loop_run (loop=0x1b05f60)
at /build/
#8 0x00007f5039cebbc7 in IA__gtk_main ()
at /build/
#9 0x0000000000442bc7 in main (argc=1, argv=0x7fff4387
at nautilus-main.c:518
Changed in nautilus (Ubuntu): | |
status: | Triaged → Confirmed |
Changed in nautilus (Ubuntu): | |
status: | Confirmed → Triaged |
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 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 private/ nautilus- query.c private/ nautilus- query.c
NautilusQuery *query; TEST_EXISTS) ) {
return NULL;
index 267620d..b6a3f55 100644
--- a/libnautilus-
+++ b/libnautilus-
@@ -300,15 +300,18 @@ nautilus_query_load (char *file)
char *xml;
gsize xml_len;
-
+
+ xml_len = 0;
+ query = NULL;
+
if (!g_file_test (file, G_FILE_
}
-
- g_file_get_contents (file, &xml, &xml_len, NULL); query_parse_ xml (xml, xml_len); get_contents (file, &xml, &xml_len, NULL) && xml_len != 0) { query_parse_ xml (xml, xml_len);
- query = nautilus_
+ if (g_file_
+ query = nautilus_
+ }
(then we have to make sure that the code's doing the right thing with the NULL return, etc)