This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Find working improperly causes updatedb to take forever

Hash: SHA1

According to Victor E. Vaile, IV on 7/11/2006 8:39 PM:
> 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
> 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   
volunteer cygwin findutils maintainer
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at
Comment: Using GnuPG with Mozilla -


Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]