Find working improperly causes updatedb to take forever
Igor Peshansky
pechtcha@cs.nyu.edu
Wed Jul 12 04:19:00 GMT 2006
On Tue, 11 Jul 2006, Victor E. Vaile, IV wrote:
> Hello,
>
> I upgraded my cygwin today from 1.5.19-4 to 1.5.20-1 (along with
> other various packages to their current versions). I ran updatedb, and
> instead of it taking less than a few minutes, the prompt hadn't returned
> after several minutes. I fired up procexp.exe (from sysinternals.com)
> and saw that the find.exe process was opening several registry keys in
> HKCR. This process was taking between 20-45% of my cpu as well. I did
> a quick test of the following command:
>
> /usr/bin/find / \( -fstype proc \) -prune -o -print0
>
> Sure enough, the find command happily started traversing the /proc
> registry keys. I reverted the cygwin base (keeping everything else
> installed as is, although I don't know if there are any dependencies
> that might be reverted automatically) back to 1.5.19-4, and did the same
> test, and find exited properly before descending into /proc as expected.
> I'm currently using 1.5.19-4 again. :(
>
> As far as I know the syntax for the find command should work as
> above. (I actually made a copy of the updatedb script and changed it to
> echo the find command it was using to make sure.) Anyway, I saw another
> post to this list with the subject "Updatedb does not finish", however I
> didn't see any replies, or updates, and just thought I'd mail the list
> in case anyone is interested, or has any other insights. Thanks.
The most likely change from 1.5.19 to 1.5.20 that caused this is the fact
that virtual directories (/proc, /dev, etc) are now enumerated as part of
the root directory listing. So, not only would your find recurse into
/proc, it would probably also recurse into /cygdrive, unless you use the
-xdev option (which updatedb doesn't by default).
As for "-fstype proc" not matching /proc, that is probably a real bug,
though it's unclear whether the bug is in findutils or Cygwin.
Basically, findutils reads through the mount table entries, and expects
all filesystems to be there (including /proc, etc). Under Cygwin, /proc
doesn't appear as a separate mount table entry, and thus is missed by
findutils. Depending on whether POSIX mandates that /proc appear in the
mount table or not, either Cygwin or findutils needs to be fixed. Since
findutils uses GNUlib's read_file_system_list(), it's also possible that
the fix needs to be made there.
For more info, see the findutils source (find/fstype.c is the most
relevant source file, I believe). As a workaround, you might want to add
/proc to PRUNEPATHS.
HTH,
Igor
--
http://cs.nyu.edu/~pechtcha/
|\ _,,,---,,_ pechtcha@cs.nyu.edu | igor@watson.ibm.com
ZZZzz /,`.-'`' -. ;-;;,_ Igor Peshansky, Ph.D. (name changed!)
|,4- ) )-,_. ,\ ( `'-' old name: Igor Pechtchanski
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!
"Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte."
"But no -- you are no fool; you call yourself a fool, there's proof enough in
that!" -- Rostand, "Cyrano de Bergerac"
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
More information about the Cygwin
mailing list