From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26703 invoked by alias); 8 Jan 2009 15:31:32 -0000 Received: (qmail 26693 invoked by uid 22791); 8 Jan 2009 15:31:31 -0000 X-Spam-Check-By: sourceware.org Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 08 Jan 2009 15:31:28 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id D912F6D4FC5; Thu, 8 Jan 2009 16:31:11 +0100 (CET) Date: Thu, 08 Jan 2009 16:07:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: find assert (was Re: [1.7] System reboot (udfs.sys),...) Message-ID: <20090108153111.GA18089@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <495A4B87.3080009@partners.org> <20081230170638.GB5230@ednor.casa.cgf.cx> <20081230174104.GD5230@ednor.casa.cgf.cx> <20081230175246.GE5230@ednor.casa.cgf.cx> <20081230190603.GA13443@ednor.casa.cgf.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20081230190603.GA13443@ednor.casa.cgf.cx> User-Agent: Mutt/1.5.17 (2007-11-01) Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2009-01/txt/msg00190.txt.bz2 On Dec 30 14:06, Christopher Faylor wrote: > On Tue, Dec 30, 2008 at 12:52:46PM -0500, Christopher Faylor wrote: > >Hmm. After removing the /dev/fd directory that I had created years > >ago, find now just SEGVs. And, it seems to be dying in find itself > >if the stack dump is any indication. > > > >Eric, is there any way that you could confirm or deny this? I would > >rather not build a debugging version of find if I don't have to. > > It was stupid of me to assume that this was just a generic find problem. > If I'd actually checked the error log I would have seen this: > > assertion "state.type != 0" failed: file "/usr/src/findutils-4.5.3-1/src/findutils-4.5.3/find/ftsfind.c", line 475, function: consider_visiting > > This is apparently caused by a symlink that looks like this: > > lrwxrwxrwx 1 cgf None 6 Jul 9 2005 n -> //none > > I don't remember creating that symlink. Apparently I was checking on > creating symlinks to nonexistent domains back in 2005. > > I don't know if this is a find bug or a cygwin bug. I could see it > being either or both. It looks like a find bug to me. The assertion is basically if (ent->fts_info == FTS_NSOK || ent->fts_info == FTS_NS) assert (state.type != 0); state.type is set in the calling function find() like this: while ( (ent=fts_read(p)) != NULL ) { state.have_type = !!ent->fts_statp->st_mode; state.type = state.have_type ? ent->fts_statp->st_mode : 0; } which is a bug, AFAICS. The reason is that per the fts_read man page the value of ent->fts_statp is undefined if ent->fts_info is FTS_NSOK or FTS_NS. So the values of state.have_type and consequentially state.type are undefined as well and the above assertion makes no sense. Additionally, consider that the BSD variant of fts_read as used by Cygwin memset's fts_statp to 0 in the FTS_NS case. Consequentially: state.have_type = !!ent->fts_statp->st_mode ==> state.have_type = 0 ==> state.type = 0 ==> assert (state.type != 0) FAILs Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- 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/