"find /sys -follow -print" loops forever on Ubuntu
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
ProcVersionSign
Uname: Linux 2.6.35-28-generic i686
NonfreeKernelMo
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
Confirmed in Quantal.