Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 99842 invoked by uid 500); 18 Dec 2002 14:14:36 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 99828 invoked from network); 18 Dec 2002 14:14:35 -0000 To: "William A. Rowe, Jr." Cc: Branko =?iso-8859-1?q?=C4=8Cibej?= , dev@subversion.tigris.org, dev@apr.apache.org Subject: Re: [PATCH] apr_dir_read doesn't return requested information References: <3DFCC43F.F6B93489@sebastian-bergmann.de> <87fzsz6o1o.fsf@codematters.co.uk> <3DFD61A3.D6C1DFF@sebastian-bergmann.de> <87znr60wpx.fsf@codematters.co.uk> <3DFE128D.14A41D65@sebastian-bergmann.de> <87pts122qe.fsf@codematters.co.uk> <3DFE4431.9F5DA96E@sebastian-bergmann.de> <8765tt1qzo.fsf_-_@codematters.co.uk> <87k7i9zcbc.fsf_-_@codematters.co.uk> <5.1.0.14.2.20021217215518.03670928@pop3.rowe-clan.net> <5.1.0.14.2.20021217225946.02a1ae90@pop3.rowe-clan.net> From: Philip Martin Date: 18 Dec 2002 14:14:29 +0000 In-Reply-To: <5.1.0.14.2.20021217225946.02a1ae90@pop3.rowe-clan.net> Message-ID: <87bs3jct2y.fsf@codematters.co.uk> Lines: 79 User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: Philip Martin X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N "William A. Rowe, Jr." writes: > What I would like to know (if you can track it...) > > Is it possible to dump the finfo structure within gdb at the point this > request fails? I'd pay especially close attention to the .valid bits, since > those are the identifiers that will help us determine if stat() was also > called later. This is for dir.c version 1.71 with the patch reverted. The Subversion code is svn_io_get_dirents in subversion/libsvn_subr/io.c, it passes APR_FINFO_TYPE | APR_FINFO_NAME to apr_dir_read. The first two calls to apr_dir_read return "." and ".." and the Subversion code skips them, the following gdb information is for the third call (gdb) s apr_dir_read (finfo=0xbffff660, wanted=33587200, thedir=0x809a878) at dir.c:174 174 apr_status_t ret = 0; (gdb) n 179 ret = readdir_r(thedir->dirstruct, thedir->entry, &retent); (gdb) 184 if(!ret && thedir->entry != retent) (gdb) p ret $1 = 0 (gdb) p thedir->entry[0] $2 = {d_ino = 186434, d_off = 13512064, d_reclen = 16, d_type = 0 '\0', d_name = "..", '\0' } (gdb) n 194 if (ret == EINVAL) { (gdb) 214 finfo->fname = NULL; (gdb) 216 if (ret) { (gdb) 222 wanted &= ~APR_FINFO_INODE; (gdb) p/x wanted $3 = 0x2008000 (gdb) n 225 wanted &= ~APR_FINFO_TYPE; (gdb) 228 wanted &= ~APR_FINFO_NAME; (gdb) 230 if (wanted) (gdb) p wanted $4 = 0 (gdb) n 244 if (wanted && (ret == APR_SUCCESS || ret == APR_INCOMPLETE)) { (gdb) 251 finfo->pool = thedir->pool; (gdb) 252 finfo->valid = 0; (gdb) 254 finfo->filetype = filetype_from_dirent_type(thedir->entry->DIRENT_TYPE); (gdb) 255 finfo->valid |= APR_FINFO_TYPE; (gdb) p finfo->filetype $5 = APR_UNKFILE (gdb) n 258 finfo->inode = thedir->entry->DIRENT_INODE; (gdb) 259 finfo->valid |= APR_FINFO_INODE; (gdb) 263 finfo->name = apr_pstrdup(thedir->pool, thedir->entry->d_name); (gdb) 264 finfo->valid |= APR_FINFO_NAME; (gdb) 266 if (wanted) (gdb) 269 return APR_SUCCESS; (gdb) Subversion explicitly requests APR_FINFO_TYPE but then the apr_dir_read code clears that bit and so doesn't call apr_lstat. APR_UNKFILE appears to be correct for d_type of 0, but is not a very useful thing for APR to return in response to APR_FINFO_TYPE. It's a change in APR's behaviour and it breaks Subversion. -- Philip Martin