X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Tue, 1 Dec 2009 17:13:41 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: Issues with find in /proc Message-ID: <20091201161341.GA8059@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <2bf229d30912010331l7f041692ld4ed231a8b3edbf4 AT mail DOT gmail DOT com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2bf229d30912010331l7f041692ld4ed231a8b3edbf4@mail.gmail.com> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: 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 On Dec 1 06:31, Chris Sutcliffe wrote: > Hi All, > > I'm not sure if this is expected behaviour or not, but I've noticed > the following: > > csutclif AT EUSH000065 /proc > $ find . > . > ./loadavg > ./meminfo > ./registry > find: `./registry': Bad file descriptor This is a bug in Cygwin. It misses to set a certain flag for the /proc/registry{32,64} directory itself. > ./4080/fd/5 > assertion "ent->fts_info == FTS_NSOK || state.type != 0" failed: file > "/usr/src/findutils-4.5.4-1/src/findutils-4.5.4/find/ftsfind.c", line > 475, function: consider_visiting > Aborted (core dumped) This one appears to be a bug in find. It looks like it's using its own version of the fts(3) functions. AFAICS, what happens is that find uses fstatat(fd = "/proc/$PID/fd", name="6") in the first place. This returns with ENOENT since the descriptor 6 disappeared in the meantime. That should be fine for find, but for some reason the next what happens is that it calls lstat("6"). The problem here is that the current working directory is /proc, which does not contain a file called "6" and that in turn results in the assertion. Eric, could you have a look into that, please? Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple