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 607974 - Nautilus crashing on broken cycling links
Nautilus crashing on broken cycling links
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: general
2.28.x
Other Linux
: Normal normal
: ---
Assigned To: Tomas Bzatek
Nautilus Maintainers
: 445456 615914 638104 694972 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-01-24 21:40 UTC by Artyom Smirnov
Modified: 2013-03-02 00:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Last lines of strace output when opening directory with symlinks (7.96 KB, text/plain)
2010-01-24 21:59 UTC, Artyom Smirnov
  Details
nautilus-2.29.3-limit-symlink-resolving-depth.patch (2.41 KB, patch)
2010-02-02 17:21 UTC, Tomas Bzatek
needs-work Details | Review

Description Artyom Smirnov 2010-01-24 21:40:19 UTC
Test case:
ln -s 1 2
ln -s 2 1
nautilus .
Comment 1 Fabio Durán Verdugo 2010-01-24 21:50:31 UTC
hmm... ¿?

Thanks for taking the time to report this bug.
This bug report isn't very useful because it doesn't describe the bug well. If you have time and can still reproduce the bug, please read http://bugzilla.gnome.org/bug-HOWTO.html and add a more useful description to this bug.
Comment 2 Artyom Smirnov 2010-01-24 21:59:35 UTC
Created attachment 152182 [details]
Last lines of strace output when opening directory with symlinks
Comment 3 Artyom Smirnov 2010-01-24 22:00:37 UTC
Just try create two symlinks in same directory which will be linking to each other e.g.:
link1 -> link2
link2 -> link1
Then try to open this directory in nautilus, here nautilus segfaulting.
Comment 4 Tomas Bzatek 2010-02-02 17:21:24 UTC
Created attachment 152860 [details] [review]
nautilus-2.29.3-limit-symlink-resolving-depth.patch

This is my first try, stupid patch, limiting the resolving depth to 20 tries.
Comment 5 Cosimo Cecchi 2010-04-16 18:10:33 UTC
*** Bug 615914 has been marked as a duplicate of this bug. ***
Comment 6 Cosimo Cecchi 2010-04-16 18:11:34 UTC
*** Bug 445456 has been marked as a duplicate of this bug. ***
Comment 7 Matt Giuca 2010-04-17 01:55:37 UTC
As Linux
raises an ELOOP error in this condition, I assume Nautilus is not opening the
symlink using a standard 'open', but instead manually following symlinks, with
no limit on the number of times it will follow them.

To reproduce:

$ mkdir looptest; cd looptest
$ touch foo
$ ln -s foo bar
$ rm foo
$ ln -s bar foo
$ ls -l
total 8
lrwxrwxrwx 1 matt matt 84 2010-04-16 11:07 bar -> foo
lrwxrwxrwx 1 matt matt 84 2010-04-16 11:07 foo -> bar
$ cat foo
cat: foo: Too many levels of symbolic links
$ nautilus .

This crashes Nautilus as it loads.

I examined the crash in GDB. The stack trace is about 178575 frames long and
then it SIGSEGVs. The majority of the stack trace is a cycle between three
functions (which I can't see because I don't have source on). This implies that
it's simply following the symlinks manually forever until a stack overflow.
Comment 8 Tomas Bzatek 2010-04-19 12:27:12 UTC
Yes, Nautilus resolves symlinks manually on icon ("object/file") load and queues stat requests into the idle mainloop. It's actually difficult to distinguish between loading and idle state of the NautilusFile instance. We can't get ELOOP in our case because of the internal design.
Comment 9 José María Pérez 2010-12-27 12:19:20 UTC
*** Bug 638104 has been marked as a duplicate of this bug. ***
Comment 10 chrysn 2011-06-19 11:08:09 UTC
this seems to be resolved at least as of version 3.0.
Comment 11 Christian Kirbach 2011-09-26 22:37:54 UTC
I tried to reproduce again, I can confirm this bug has been fixed, altough I could not see a git log entry referncing this report.
anyways, it is fixed in GNOME 3.2 for sure.

Thank you all for your work on this.

CLOSING.
Comment 12 Florian Bäuerle 2013-03-02 00:25:58 UTC
*** Bug 694972 has been marked as a duplicate of this bug. ***