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 600057 - nautilus crashed with SIGSEGV in open64()
nautilus crashed with SIGSEGV in open64()
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: metadata
unspecified
Other Linux
: Normal critical
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2009-10-29 18:49 UTC by Chris Coulson
Modified: 2009-11-18 15:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Stacktrace (10.27 KB, application/x-compressed-tar)
2009-10-29 18:52 UTC, Chris Coulson
Details
~/.local/share/gvfs-metadata/home from Kai Lüke, downloaded from the launchpad bugreport (4.77 KB, application/octet-stream)
2009-11-12 11:08 UTC, Tomas Bzatek
Details

Description Chris Coulson 2009-10-29 18:49:53 UTC
This was reported at https://bugs.edge.launchpad.net/ubuntu/+source/gvfs/+bug/424043.

Some users are reporting this crash, and also large memory leaks in gvfsd-metadata (which I think are related). I've attached the stack trace due to the large size of it
Comment 1 Chris Coulson 2009-10-29 18:52:10 UTC
Created attachment 146519 [details]
Stacktrace

Ok, I had to compress it so Bugzilla would let me attach it. Anyway, this is a good summary of what it looks like (repeated for 2000 frames):

  • #2 meta_tree_init
    at metatree.c line 431
  • #3 meta_tree_init
    at metatree.c line 509
  • #4 meta_tree_init
    at metatree.c line 509
  • #5 meta_tree_init
    at metatree.c line 509

Comment 2 Christian Kellner 2009-10-30 09:57:32 UTC
The high memory imprint is not caused by a memory leak but the code going into an infinite loop:

The problem is that meta_tree_refresh_locked () calls meta_tree_needs_rereading(). If the latter returns TRUE we call "meta_tree_init ()" which then again calls  meta_tree_refresh_locked ().

My best bet currently is that the "rotated" bit is wrongly set on a stable file. Of course that shouldn't ever going to be the case. Maybe the file got corrupted, like it seems to be the case in bug 598561.
Comment 3 Tomas Bzatek 2009-11-12 11:08:17 UTC
Created attachment 147555 [details]
~/.local/share/gvfs-metadata/home from Kai Lüke, downloaded from the launchpad bugreport

To reproduce the issue use 'meta-ls' from gvfs sources:

./meta-ls <metadata file> /

I'm getting segfault due to endless loop in meta_tree_init(), just like reported above.
Comment 4 Tomas Bzatek 2009-11-12 11:34:24 UTC
So, this is pretty serious issue - as long as reading metadata is done in libgio and not in an isolated daemon, any read attempt from a corrupted database like this will lead to segfault of parent application due to stack overflow. Nautilus and Epiphany will both crash on startup.

Still, no good repro steps :-((
Comment 5 Christian Kellner 2009-11-18 14:09:17 UTC
I have pushed a fix for the crasher (infinite loop) to git master. With this patch we compare the inode number and if they are equal we stop refreshing.

Of course that doesn't fix the root cause, that we have a stable file with a rotated bit set to 1.
Comment 6 Christian Kellner 2009-11-18 15:00:25 UTC
Quick summary of the origin of this bug:
[15:21] alex: Here is the race:
[15:21] alex: we write the temp file with new data
[15:21] alex: fsync it, now all *data* (not file metadata) for the directory is on disk
[15:21] alex: then we rename the new file over the old one
[15:22] alex: then we write the "rotated" bit to the old file
[15:22] alex: wait a bit, then *boom* system died
[15:22] alex: maybe the rotated bit was written to the old file?
[15:22] alex: maybe the metadata from the rename were not?
[15:23] alex: so, on reboot we have the old data left, but its marked as rotated
[15:23] alex: solution: fsync the directory after the rename before writing the rotated bit

In git master there is now a patch (6592ecb3b) that does exactly that. Closing this bug.