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 151228 - Nautilus crash when sort in done on size in Computer view
Nautilus crash when sort in done on size in Computer view
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: Views: List View
2.7.x
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2004-08-27 16:55 UTC by Narayana Pattipati
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: 2.7/2.8


Attachments
Stack trace of nautilus crash when sort is done by Size (6.50 KB, text/plain)
2004-08-27 17:30 UTC, Narayana Pattipati
  Details
Fix nautilus crash when size sort is done in computer view (1.29 KB, patch)
2004-08-27 17:34 UTC, Narayana Pattipati
none Details | Review

Description Narayana Pattipati 2004-08-27 16:55:27 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.
Comment 1 Narayana Pattipati 2004-08-27 17:30:08 UTC
Created attachment 31023 [details]
Stack trace of nautilus crash when sort is done by Size
Comment 2 Narayana Pattipati 2004-08-27 17:32:08 UTC
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.
Comment 3 Narayana Pattipati 2004-08-27 17:34:40 UTC
Created attachment 31024 [details] [review]
Fix nautilus crash when size sort is done in computer view
Comment 4 Alexander Larsson 2004-08-30 09:32:41 UTC
I added space between if and the first paranthesis and commited this.
Thanks.