From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32856 invoked by alias); 22 Jul 2019 15:20:26 -0000 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 Received: (qmail 32844 invoked by uid 89); 22 Jul 2019 15:20:26 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-106.3 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GOOD_FROM_CORINNA_CYGWIN,NORMAL_HTTP_TO_IP,NUMERIC_HTTP_ADDR,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy= X-HELO: mout.kundenserver.de Received: from mout.kundenserver.de (HELO mout.kundenserver.de) (212.227.126.135) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 22 Jul 2019 15:20:25 +0000 Received: from calimero.vinschen.de ([24.134.7.25]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MXGak-1hvaOd2MLW-00YfMh; Mon, 22 Jul 2019 17:20:17 +0200 Received: by calimero.vinschen.de (Postfix, from userid 500) id C698AA80725; Mon, 22 Jul 2019 17:20:16 +0200 (CEST) Date: Mon, 22 Jul 2019 15:20:00 -0000 From: Corinna Vinschen To: Ken Brown Cc: "cygwin@cygwin.com" , "Erik M. Bray" Subject: Re: Regression (last snapshot) Message-ID: <20190722152016.GE21169@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: Ken Brown , "cygwin@cygwin.com" , "Erik M. Bray" References: <8f6a87faa9c8130241c026889a01d763@xs4all.nl> <5414d0e1-79d9-cab7-b1bd-4761265bf8bd@cornell.edu> <265a2749-95b6-38aa-a191-7913bfcc98b6@cornell.edu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="k3qmt+ucFURmlhDS" Content-Disposition: inline In-Reply-To: <265a2749-95b6-38aa-a191-7913bfcc98b6@cornell.edu> User-Agent: Mutt/1.11.3 (2019-02-01) X-SW-Source: 2019-07/txt/msg00167.txt.bz2 --k3qmt+ucFURmlhDS Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 2709 On Jul 22 13:44, Ken Brown wrote: > On 7/22/2019 8:23 AM, Ken Brown wrote: > > On 7/20/2019 6:55 PM, Houder wrote: > >> 64-@@ uname -a > >> CYGWIN_NT-6.1 Seven 3.1.0s(0.339/5/3) 2019-07-12 15:28 x86_64 Cygwin > >> > >> 64-@@ ls -lL <(grep bash .bashrc) > >> ls: /dev/fd/63: No such file or directory > >> pr-------- 1 Henri None 0 Jul 21 00:41 /dev/fd/63 > >=20 > > Thanks for the report. This is probably caused by my new FIFO code. I= 'm > > looking into it. >=20 > Actually, a bisection shows that the regression is due to the following c= ommit: >=20 > commit 2607639992f6600135532831c8357c10cb248821 > Author: Erik M. Bray > Date: Wed Apr 10 17:05:22 2019 +0200 >=20 > Improve error handling in /proc/[pid]/ virtual files. >=20 > * Changes error handling to allow /proc/[pid]/ virtual files to be > empty in some cases (in this case the file's formatter should retu= rn > -1 upon error, not 0). >=20 > * Better error handling of /proc/[pid]/stat for zombie processes: > previously trying to open this file on zombie processes resulted > in an EINVAL being returned by open(). Now the file can be read, > and fields that can no longer be read are just zeroed. >=20 > * Similarly for /proc/[pid]/statm for zombie processes. >=20 > * Similarly for /proc/[pid]/maps for zombie processes (in this case = the > file can be read but is zero-length, which is consistent with obse= rved > behavior on Linux. >=20 >=20 > Erik, can you take a look? I have a hunch. It's this change: @@ -355,7 +355,7 @@ fhandler_process::fill_filebuf () } else filesize =3D process_tab[fileid].format_func (p, filebuf); - return !filesize ? false : true; + return filesize < 0 ? false : true; } return false; } The formatter for /proc/PID/fd, format_process_fd, returns *valid* negative values. But the above patch treats all negative values as error now. The fact that format_process_fd returns negative values has historical reasons. Negative values of type virtual_ftype_t are files, positive values are directories. One way to fix this is to change this to all positive values. At a first glance I don't see any check for an explicit negative virtual_ftype_t value, especially not in the only consumer path_conv::check in path.cc, and the simple numbers have long been replaced with enum values. At the same time, we should better drop some outdated comments in the virtual file fhandler classes, e.g. /* Returns 0 if path doesn't exist, >0 if path is a directory, -1 if path is a file, -2 if it's a symlink. */ Corinna --=20 Corinna Vinschen Cygwin Maintainer --k3qmt+ucFURmlhDS Content-Type: application/pgp-signature; name="signature.asc" Content-length: 833 -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAl011DAACgkQ9TYGna5E T6AoTw//TflicdbRupDqfzEOcQqN2tzxMqOpA/355uY7q3683KvawIp0ToDNq1wY xyFI/IrHWousl1Zqa2SX0w6udwYVgVtrsSbtt5F2sb1Xma2FP7lwxM8xcgGcEMac hM1RiBLkcma+NoAdm7GzLdJm+2Bin7ewmeaUxxZPGdgCs+avukwKj+QfMkGM/POY KZFWxtzcXrkJjCfG+0QGXbOnuxULU1aPi7t2me7sjfzzKROnx3nBYqO5uHs+ZvPJ Y6nmPfC6wUb8yVubwqzSltnCTEbySRsaMmuGfLWaSpXvRkBahDgsMJRvgczM20Lt DlOf4u4a4xH/jcTFNISjFwtAplcRJzLLAACu3e0jH6QBplbn0FVT6UDrgUV+0ddG zYoU/9k0dVHawQmhfv2zH8qu1+LW4prO89wfAUc3zewgIVrS0b2omj5A8+JfJN54 gNgBOtUslxwompEem6xJxfk1JsRTmvaptjBce1iC4VuB38jP3n0nOCBn3JVaLxxp wNa65O+tEEusDKTbcLvm6Eo+i+ZAPsNNS0CJxzzYMtpIYz9kRLZbFrvRX6JPntDg UbOPx8yEPkaR9kZh941g7WGH9OWiOgAGiu2AoJmbCfiOcHFiY5Vr4awkCSxSlESj nR3WQUP+rOT/FxyQdXu42h5NtA2mRM6afO2aL4GzfGmQsg/c0+Q= =Jzxb -----END PGP SIGNATURE----- --k3qmt+ucFURmlhDS--