delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/07/22/11:21:19

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:cc:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; q=dns; s=
default; b=nHJsmyDj69pUbhVRPrVCXMGXMDGa+5XK5I5COJib03+XprjKHLS4s
80+QSlRyYelC1RhFre/lBwlZJNybuYTkzf7eE2fcG/LKI0jgu5caX8+1+AhAl9d6
qy1RMO4KRx4vTqSFd7q5zmlsu1P11B9iodpMQhefA66hhLQvnzaGEo=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:cc:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; s=default;
bh=ZSVTH9ZeP7TLFmfOQawNMJ9NjbY=; b=vas/H5EkhfFzzRLILIV+9RXNLltU
if+v1H0wO0rVolu4Jpc7Yfo7vN63qfr0VPczqLY0CR+22AXEZW0OOLytjYkUq30B
J0arVrDHBpDuftdMbP5TrgUELmxiib0VJn0K66BbUcT7s31NFp09SBTumgDpfHlc
axMoSK39yR4LKE8=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
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
Date: Mon, 22 Jul 2019 17:20:16 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: Ken Brown <kbrown AT cornell DOT edu>
Cc: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>,
"Erik M. Bray" <erik DOT m DOT bray AT gmail DOT com>
Subject: Re: Regression (last snapshot)
Message-ID: <20190722152016.GE21169@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: Ken Brown <kbrown AT cornell DOT edu>, "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>, "Erik M. Bray" <erik DOT m DOT bray AT gmail DOT com>
References: <8f6a87faa9c8130241c026889a01d763 AT xs4all DOT nl> <5414d0e1-79d9-cab7-b1bd-4761265bf8bd AT cornell DOT edu> <265a2749-95b6-38aa-a191-7913bfcc98b6 AT cornell DOT edu>
MIME-Version: 1.0
In-Reply-To: <265a2749-95b6-38aa-a191-7913bfcc98b6@cornell.edu>
User-Agent: Mutt/1.11.3 (2019-02-01)

--k3qmt+ucFURmlhDS
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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 <erik DOT m DOT bray AT gmail DOT com>
> 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"

-----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--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019