This is the mail archive of the
mailing list for the Cygwin project.
Re: Find working improperly causes updatedb to take forever
- From: Eric Blake <ebb9 at byu dot net>
- To: cygwin at cygwin dot com, victorv4 at yahoo dot com
- Date: Tue, 11 Jul 2006 21:57:21 -0600
- Subject: Re: Find working improperly causes updatedb to take forever
- References: <44B460CC.49C960A1@yahoo.com>
-----BEGIN PGP SIGNED MESSAGE-----
According to Victor E. Vaile, IV on 7/11/2006 8:39 PM:
> 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
As written, the \( \) are unnecessary in your example.
The reason that this doesn't work is that cygwin's filesystem name
reporting is not very good. Try 'find / -maxdepth 1 -printf '%f:%F ' to
see what I mean. /proc is listed as "unknown", not "proc", as its fstype,
so your above attempt was failing to prune /proc (and hence, that explains
why you were traversing /proc/registry).
As to why it is different now that you upgraded cygwin: a patch was added
that allows readdir() to return virtual directories from within the root
directory, where previously it did not. And /proc is a virtual directory.
So the behavior, while not necessarily nice, is expected; and serves to
illustrate the need to be careful with find when crossing file system
boundaries. Try -xdev, instead of -fstype ... -prune.
> As far as I know the syntax for the find command should work as above.
Only if cygwin were to be patched to actually provide find with the
information it needs to see /proc is -fstype "proc" rather than "unknown".
However, if updatedb is trying this, maybe I should look into patching that.
Life is short - so eat dessert first!
Eric Blake firstname.lastname@example.org
volunteer cygwin findutils maintainer
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v22.214.171.124 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html