"find /sys -follow -print" loops forever on Ubuntu

Bug #883290 reported by dstromberg
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
findutils (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

The subject gives a good summary, but:
1) This was once not a problem
2) GNU find has reportedly not always used fts_*, but does so now.
2) I ported an early 386BSD "find" command to RHEL 5.4, and it had the same problem.
3) Both 386BSD find and contemporary GNU find rely on the host system's C library's fts_* routines to traverse the filesystem; that's probably the only thing that's common between GNU find and 386BSD find
4) I wrote a little Python script that successfully does the equivalent of "find /sys -follow -print", by maintaining a list of visited deviceno+inodeno pairs. It does not loop forever, and is rather simple. It works on both Ubuntu 10.10 and on RHEL 5.4.
5) The find manual page appears to say that upon detecting an infinite loop, find should either report the problem and terminate, or report the problem and sidestep the infinite loop, continuing with finite traversal.

I suspect a glibc bug.

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: findutils 4.4.2-1ubuntu1
ProcVersionSignature: Ubuntu 2.6.35-28.50-generic 2.6.35.11
Uname: Linux 2.6.35-28-generic i686
NonfreeKernelModules: nvidia
Architecture: i386
Date: Fri Oct 28 14:53:58 2011
ExecutablePath: /usr/bin/find
ProcEnviron:
 SHELL=/bin/bash
 PATH=(custom, user)
 LANG=en_US.utf8
SourcePackage: findutils

Revision history for this message
dstromberg (strombrg) wrote :
Revision history for this message
Logan Rosen (logan) wrote :

Confirmed in Quantal.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in findutils (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.