X-Spam-Check-By: sourceware.org Message-ID: <44B47321.8000806@byu.net> Date: Tue, 11 Jul 2006 21:57:21 -0600 From: Eric Blake User-Agent: Thunderbird 1.5.0.4 (Windows/20060516) MIME-Version: 1.0 To: cygwin AT cygwin DOT com, victorv4 AT yahoo DOT com Subject: Re: Find working improperly causes updatedb to take forever References: <44B460CC DOT 49C960A1 AT yahoo DOT com> In-Reply-To: <44B460CC.49C960A1@yahoo.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com -----BEGIN PGP SIGNED MESSAGE----- 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 > 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". cygwin.com/acronyms#PTC. However, if updatedb is trying this, maybe I should look into patching that. - -- Life is short - so eat dessert first! Eric Blake ebb9 AT byu DOT net volunteer cygwin findutils maintainer -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.1 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEtHMh84KuGfSFAYARArsZAKCT6VtyPzTkreMSCFao2kXmOwkBpgCgu3gP w1ZvWCsoQINSoONUQwk0Ba8= =fHBZ -----END PGP SIGNATURE----- -- 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/