GNOME Bugzilla – Bug 151228
Nautilus crash when sort in done on size in Computer view
Last modified: 2004-12-22 21:47:04 UTC
Running nautilus built from HEAD. Nautilus crashed when sort is done by size in computer view. How to simulate: a) Launch nautilus b) Click on the Computer icon on the desktop. c) Spatial window of computer will launch. d) Select list view by clicking on View->View as list e) Try to sort the items by size. You will find nautilus crash. The crash is because of an assertion in gsequence.c file. I will attach stack trace.
Created attachment 31023 [details] Stack trace of nautilus crash when sort is done by Size
The crash is happening because of an assert in cut-n-paste-code/gsequence/gsequence.c:g_sequence_node_insert_sorted() 985 g_assert (node_compare (new, closest, &info) <= 0); 986 g_sequence_node_insert_before (closest, new); This is because, the sizes for items under computer view are either "not known" or "not knowable" to gnome-vfs. The size comparison in libnautilus-private.c/nautilus-file.c:compare_by_size () is not checking whether the sizes for files (or item counts for directories) are "not known" or "not knowable". Even if the size details (file size or count for dirs.) are "not known" or "not knowable", the code compares the uninitialized size values and returns result as, one file is having higher size than the other, causing assertion failure. So, a check in the functions compare_directories_by_count(), compare_files_by_size() is required to make sure no comparison is done for files/directories whose sizes are "not known" or "not knowable". I will attach a patch for the same.
Created attachment 31024 [details] [review] Fix nautilus crash when size sort is done in computer view
I added space between if and the first paranthesis and commited this. Thanks.