From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 102308 invoked by alias); 18 Jul 2017 10:51:26 -0000 Mailing-List: contact cygwin-apps-help@cygwin.com; run by ezmlm Precedence: bulk Sender: cygwin-apps-owner@cygwin.com List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Mail-Followup-To: cygwin-apps@cygwin.com Received: (qmail 102116 invoked by uid 89); 18 Jul 2017 10:51:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-106.4 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GOOD_FROM_CORINNA_CYGWIN,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=H*c:application X-HELO: drew.franken.de Received: from mail-n.franken.de (HELO drew.franken.de) (193.175.24.27) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 18 Jul 2017 10:51:13 +0000 Received: from aqua.hirmke.de (aquarius.franken.de [193.175.24.89]) (Authenticated sender: aquarius) by mail-n.franken.de (Postfix) with ESMTPSA id CC335721E280C for ; Tue, 18 Jul 2017 12:51:10 +0200 (CEST) Received: from calimero.vinschen.de (calimero.vinschen.de [192.168.129.6]) by aqua.hirmke.de (Postfix) with ESMTP id 14DA95E01D3 for ; Tue, 18 Jul 2017 12:51:10 +0200 (CEST) Received: by calimero.vinschen.de (Postfix, from userid 500) id E8B08A80617; Tue, 18 Jul 2017 12:51:09 +0200 (CEST) Date: Tue, 18 Jul 2017 10:51:00 -0000 From: Corinna Vinschen To: cygwin-apps@cygwin.com Subject: Re: fflush(NULL) clobbers input streams Message-ID: <20170718105109.GD26902@calimero.vinschen.de> Reply-To: cygwin-apps@cygwin.com Mail-Followup-To: cygwin-apps@cygwin.com References: <87k2376jck.fsf@Rainer.invalid> <20170718095456.GC26902@calimero.vinschen.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="yVhtmJPUSI46BTXb" Content-Disposition: inline In-Reply-To: <20170718095456.GC26902@calimero.vinschen.de> User-Agent: Mutt/1.8.3 (2017-05-23) X-SW-Source: 2017-07/txt/msg00043.txt.bz2 --yVhtmJPUSI46BTXb Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1905 On Jul 18 11:54, Corinna Vinschen wrote: > On Jul 17 19:53, Achim Gratz wrote: > >=20 > > Perl configure for 5.22.1 on Cygwin 2.4.0 said this: > >=20 > > --8<---------------cut here---------------start------------->8--- > > Checking how to flush all pending stdio output... > > Your fflush(NULL) works okay for output streams. > > Let's see if it clobbers input pipes... > > fflush(NULL) seems to behave okay with input streams. > > --8<---------------cut here---------------end--------------->8--- > >=20 > > I'm reasonably certain that the intervening Perl versions were also this > > way, but I didn't keep the log files around unfortunately. > >=20 > > Now, using Cygwin 2.8.x to configure Perl 5.22.4 I got this instead: > >=20 > > --8<---------------cut here---------------start------------->8--- > > Checking how to flush all pending stdio output... > > Your fflush(NULL) works okay for output streams. > > Let's see if it clobbers input pipes... > > Ouch, fflush(NULL) clobbers input pipes! We will not use it. > > Good, at least fflush(stdin) seems to behave okay when stdin is a pipe. > > Sigh. Flushing explicitly all the stdio streams doesn't work. > > --8<---------------cut here---------------end--------------->8--- > >=20 > > It seems that fflush is only supposed to discard buffered input data on > > seekable files, but not pipes (per POSIX.1-2008), so this looks a > > regression to me. >=20 > Did you try to bisect the issue? The log doesn't indicate any obvious candidate. We're talking about a timeframe of 2016-01-15 - 2017-03-30 *iff* this already occurs on 2.8.0. At least knowing the exact Cygwin version introducing the issue would be a great help zeroing in on the culprit. Oh, and a plain C testcase, of course... Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --yVhtmJPUSI46BTXb Content-Type: application/pgp-signature; name="signature.asc" Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJZbegdAAoJEPU2Bp2uRE+gHPIQAJadsHy/cEmntfDp76Hqc6TK wenQsk/Y5bUHgBtNja+KeYf3DWUUfDEKPlnvxciLIt5UEjddgfz7pSofpvKVT1mP nhqlFiiKJA9VVG3eO5poO6nkT8sP+urBmx+a+h+/37hOr/ov1bI3MC/nEnXH2or+ H6GIBCBLGf64+rOp5H3yn6qMiU0Znf1Mgw4DuD+ohxheu3QiNa/BYPLAJO51n8NB XuX1/ciX0yNXJU/zlSZKHDcWWE5Ydi+Mu1EMTNga0MY8DGEjiaY1s/g28uiAhYiK MeKW+OXafU0l6gTo5GkEicRe4qjMpvLbmeH1dA5ZY+a84RrGJal2tRBiv48fnYlz A7gSiY7DlIiR535xbEI87UjZOv2ptXnaGXzD4v91lL1R3/rRKsL9/7I2WHKiAFoH nRycNbQLa3ZVJ8CtZZeqSxQZ2mvqzCjXWGipnmGInhN+fkOLJwg2XKjUwdIJGXaS LBF1a1WWLbXnpTDYllbBLHef3llU+HFVO6gHk/dSYAYWn0ta8T5u4f5JS+3rN9Su jfLajL6T+tVjT5dyuK+PaITN+i0tXluhDP17rt1XDoO4PQM+7gBSAg2n15g5N7dD IpKfGW86bAtdx1YSwGSC56VbixjoHY08jsC9ktYozRKju4Dx9/DSACXTGJwz0B9D ROqkmdWDDM4zSifqv24t =2m93 -----END PGP SIGNATURE----- --yVhtmJPUSI46BTXb--