← Back to team overview

desktop-packages team mailing list archive

[Bug 879130] Re: invalid read (segfault) on duplicate lines in .hidden

 

I decided to keep looking at this since I had already started. Just to
be clear, the work around of removing duplicates from .hidden works fine
to fix this.

But here's what I found in the code (caution: I'm new to programming with linux, feel free to correct me)
-The crash occurs because the GHashTable has a key_destroy_func and g_hash_table_insert_node() is called with  keep_new_key = false instead of true in ghash.c
-In order to fix this, g_hash_table_replace() should be used instead of g_hash_table_insert() in read_dot_hidden_file() in nautilus-directory-async.c. I ran nautilus with this change and it didn't crash anymore.
-I did a quick search to see if this situation happens anywhere else in Nautilus, the only spot I found is at nautilus-view.c:3315, but I'm not sure if that's an issue or not.
-If I am correct, it seems strange that the comments in ghash.c for using GHashTable as a set indicate that g_hash_table_insert should be used, when it actually causes this issue.

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to nautilus in Ubuntu.
https://bugs.launchpad.net/bugs/879130

Title:
  invalid read (segfault) on duplicate lines in .hidden

Status in Nautilus:
  New
Status in “nautilus” package in Ubuntu:
  Triaged

Bug description:
  opening nautilus and attempting to click on any folders in a folder
  with a .hidden file that has a duplicate entry will consistently crash
  nautilus (also causing desktop icons to disappear).

  i have attached terminal output from when the crash occurs, 2 seperate ones.
  my system locks up (but mouse still moves, music keeps playing) when nautilus is loading, after the 3rd line of terminal output.

  I am not sure if this is worth fixing or not, most people will not run
  into it much.

  Reproduction steps:
  1. create a .hidden file in any directory.
  2. place a filename into the file twice (on separate lines). the filename does not have to exist.
  3. browse to the folder in nautilus and press ctrl+H OR browse to the folder in nautilus and click on another folder, either a subfolder or any other folder

  ProblemType: Crash
  DistroRelease: Ubuntu 11.10
  Package: nautilus 1:3.2.0-0ubuntu5
  ProcVersionSignature: Ubuntu 3.0.0-12.20-generic 3.0.4
  Uname: Linux 3.0.0-12-generic x86_64
  NonfreeKernelModules: nvidia wl
  ApportVersion: 1.23-0ubuntu3
  Architecture: amd64
  Date: Fri Oct 21 00:12:55 2011
  ExecutablePath: /usr/bin/nautilus
  InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release amd64 (20091027)
  ProcCmdline: nautilus
  Signal: 6
  SourcePackage: nautilus
  StacktraceTop:
   raise () from /lib/x86_64-linux-gnu/libc.so.6
   abort () from /lib/x86_64-linux-gnu/libc.so.6
   ?? () from /lib/x86_64-linux-gnu/libc.so.6
   ?? () from /lib/x86_64-linux-gnu/libc.so.6
   free () from /lib/x86_64-linux-gnu/libc.so.6
  Title: nautilus crashed with SIGABRT in raise()
  UpgradeStatus: Upgraded to oneiric on 2011-10-17 (2 days ago)
  UserGroups: adm admin cdrom dialout lpadmin plugdev sambashare
  usr_lib_nautilus:
   brasero            3.2.0-0ubuntu1
   deja-dup           20.0-0ubuntu3
   evince             3.2.0-0ubuntu1
   file-roller        3.2.0-0ubuntu1
   gnome-disk-utility 3.0.2-1ubuntu2

To manage notifications about this bug go to:
https://bugs.launchpad.net/nautilus/+bug/879130/+subscriptions