delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2020/03/26/19:20:13

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D8A12385E00B
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1585264763;
bh=KMlMIFiFnmpbY+/3gUXsPrxSgsv/DaLxDdfAYvueN8c=;
h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:
From;
b=JBT929yMwvH0LewhePei8aUL+p2BIJbZLMheI/7wQQfgbZMasZrNMT4V4AHaDtVBG
tOlB/Ojm3YLTg0EUfd+PXzC72ZZEM0d96yMOisu5USU0ZniWPO2CY0SaSQtJ9NXdLJ
m/tizW63asA461rkqLeiROs39ol/0KwX32QKpWB0=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 61164385E006
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
b=MduhOBMlhLR2iIfFRuYttDtYLmz267Q3aY7Vd/LHkCArsET9A1hLiJ7moYDt1h2EyZr0HvNEgRjQsLylNWpZ7suoyLV4b4yBcIMiErnxVb81k28/pHvUJ9Cr9lhJ1dwrTzE0OgwW0op3pDFzNp1X8B9g8ByXODn0T7+6wOMfVKeLtm7lnjILvR4s1jTeE1YHsgjJ5llczsQjaPBf5bUxTD9ef9SiJjX4l8db3wiZTgqg4n86ahpLgePc/+6oJDspzHZJ030xDwz3ZSIzt4VQcSMrBNDKZKgVKLzQQxLORF0CmYwB64KrozWg2zhpexpZgrYixUR8fSG5e3hdzOV53w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
s=arcselector9901;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
bh=1HadIEfbMIDuDxDeOGbud+66uy5HM9WOxHEw+jXCsHM=;
b=LjMaBT5nHOoDPzbbnPCS3co2QA9Ai2rmPCs+PldfAkY8QRkOXqrO53AC59iRX9bV7lMusW/lwUcu65qOO48Bu6NXy+SHaLUyebhdFL9qwi+Oq+sR7wGIrEaoHoaPiajM2mgKwnOQ2rBgrWWsFjFDlo91yR9li/se3G/eMPQ0ccNI11vEfO0gr7xDhuOtG/DNL15KfiyF4ELtjL4/JIIE/YI74BbjsxEpMXuAZ4E6JTu46BVoSGsXg+4FYQ2YpvU/1vvY3xXjPGBy2v7EU/COJDBui6oF1+OX9Tj2uXNLxw+PASXTaBAX+jhLKFEzuMHeWumERL90M8P2mxSlgqjZSA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
smtp.mailfrom=cornell.edu; dmarc=pass action=none header.from=cornell.edu;
dkim=pass header.d=cornell.edu; arc=none
Subject: Re: Sv: Sv: Named pipes and multiple writers
To: sten DOT kristian DOT ivarsson AT gmail DOT com
References: <1b1401d60296$2769e690$763db3b0$@gmail.com>
<716e2076-f607-454e-2723-937c3959e2a3 AT cornell DOT edu>
<18be01d602ab$0bbfca30$233f5e90$@gmail.com>
<35b43b59-6410-f21f-710c-385e39cbae0b AT cornell DOT edu>
<005201d603ba$2bc8ab20$835a0160$@gmail.com>
<472d1df6-531a-ebd7-4ffa-583a06e270ff AT cornell DOT edu>
Message-ID: <ce4a4877-df77-3400-e8ac-16655b313757@cornell.edu>
Date: Thu, 26 Mar 2020 19:19:15 -0400
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101
Thunderbird/68.6.0
In-Reply-To: <472d1df6-531a-ebd7-4ffa-583a06e270ff@cornell.edu>
X-ClientProxiedBy: MN2PR08CA0019.namprd08.prod.outlook.com
(2603:10b6:208:239::24) To DM6PR04MB6075.namprd04.prod.outlook.com
(2603:10b6:5:127::31)
MIME-Version: 1.0
X-MS-Exchange-MessageSentRepresentingType: 1
X-Originating-IP: [68.175.129.7]
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id: 7715f256-4e56-4689-ed7b-08d7d1dc1abe
X-MS-TrafficTypeDiagnostic: DM6PR04MB5146:
X-Microsoft-Antispam-PRVS: <DM6PR04MB5146F6A6D3F128580AC6229FD8CF0 AT DM6PR04MB5146 DOT namprd04 DOT prod DOT outlook DOT com>
X-MS-Oob-TLC-OOBClassifiers: OLM:7691;
X-Forefront-PRVS: 0354B4BED2
X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;
IPV:NLI; SFV:NSPM; H:DM6PR04MB6075.namprd04.prod.outlook.com; PTR:; CAT:NONE;
SFTY:;
SFS:(10019020)(4636009)(136003)(39860400002)(366004)(376002)(346002)(396003)(6916009)(6486002)(786003)(316002)(186003)(16576012)(2906002)(31686004)(16526019)(26005)(86362001)(31696002)(956004)(36756003)(2616005)(66476007)(66946007)(66556008)(52116002)(33964004)(53546011)(75432002)(8936002)(81156014)(5660300002)(4326008)(8676002)(478600001)(81166006)(235185007)(66616009);
DIR:OUT; SFP:1102;
Received-SPF: None (protection.outlook.com: cornell.edu does not designate
permitted sender hosts)
X-MS-Exchange-SenderADCheck: 1
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: kThCHZAqqUHei7SK4LQeIXQo/dvh0MUHuf/FgmloGdMict1iYRSgfxMkjy0sHIYxwMqs353FnY6s7SyxNV/aUAkhxqVet4ZIHJDtJUIxsJdKjI5NcMyMcI4lG0Gc0m9U7FdAbZf2pXq3MqE9gmgyhqPJvYg7hs1zWZgJKFfFmF2/Ngt7gfcLbELHtXB4eVd3/M31F1zAG3cduE3DENjxUV3W6rUDe/KegZulE5UhXrC9HPAa1MVXQcc+c24zyLLWAlz1ErsbEgJKWvtK1CTZtIQwK6hvRwPKStoJvx2flcDCB7TO1G1nHaoIrkJ7nf4e+Zgv5uiLahQoO1upJtTeln6hx9caLY++a+fMYntvQLf1iYSpXJMDRS9vbkcWJbDYerLAMTqWexZVvzZeJ9mE6gFl77ZPMQi1ckzDMKNsZkOIRYgA1UkmBKuhtJc0rPcO
X-MS-Exchange-AntiSpam-MessageData: XvmPCp9kJlknN8igG0YXf2p/SM0TBFKeGfC3D6Iw0JM12GbaKxBKspz1xnULy/7mUMsX4Hq7ZDnE9V0t+zSPhHr72PTOtNtxXCtq9BkqbWwSQAjx2NVo9NvaEbMuCLNiwgeAgxHR7u5OGhKMR9XssQ==
X-OriginatorOrg: cornell.edu
X-MS-Exchange-CrossTenant-Network-Message-Id: 7715f256-4e56-4689-ed7b-08d7d1dc1abe
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Mar 2020 23:19:17.4551 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 5d7e4366-1b9b-45cf-8e79-b14b27df46e1
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: XFcBiFTqzPxhWL08ilYTSnDsDKJnEvAexYefQQISUBovn4iqAX9QK0zFZnICoiDZ+gvm/Im5w9Vx/AjLMS6NmA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR04MB5146
X-Spam-Status: No, score=-19.9 required=5.0 tests=BAYES_00, DKIM_INVALID,
DKIM_SIGNED, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3,
KAM_DMARC_STATUS, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS,
SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <http://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <http://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <http://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Ken Brown via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Ken Brown <kbrown AT cornell DOT edu>
Cc: "'cygwin'" <cygwin AT cygwin DOT com>
Errors-To: cygwin-bounces AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces AT cygwin DOT com>

--------------CE98C37F39D315F56A5799FF
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: quoted-printable

On 3/26/2020 6:39 PM, Ken Brown via Cygwin wrote:
> On 3/26/2020 6:01 PM, sten DOT kristian DOT ivarsson AT gmail DOT com wrote:
>> The ENIXIO occurs when parallel child-processes simultaneously using
>> O_NONBLOCK opening the descriptor.
>=20
> This is consistent with my guess that the error is generated by=20
> fhandler_fifo::wait.=A0 I have a feeling that read_ready should have be=
en created=20
> as a manual-reset event, and that more care is needed to make sure it's=
 set when=20
> it should be.
>=20
>> I could provide a code-snippet
>> to reproduce it if wanted ?
>=20
> Yes, please!

That might not be necessary.  If you're able to build the git repo master=
=20
branch, please try the attached patch.

Ken

--------------CE98C37F39D315F56A5799FF
Content-Type: text/plain; charset=UTF-8;
 name="0001-Cygwin-FIFO-make-read_ready-a-manual-reset-event.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename*0="0001-Cygwin-FIFO-make-read_ready-a-manual-reset-event.patch"

From 279591d91a13616957964256e02344a627b6f558 Mon Sep 17 00:00:00 2001
From: Ken Brown <kbrown AT cornell DOT edu>
Date: Thu, 26 Mar 2020 19:02:16 -0400
Subject: [PATCH] Cygwin: FIFO: make read_ready a manual-reset event

If a FIFO is open for reading and an attempt is made to open it for
writing with O_NONBLOCK, read_ready must be set in order for open to
succeed.  When read_ready was an auto-reset event, there was a brief
period when read_ready was not set set after a writer opened.  If a
second writer attempted to open the FIFO with O_NONBLOCK during this
period, the attempt would fail.

Addresses: https://sourceware.org/pipermail/cygwin/2020-March/244201.html
---
 winsup/cygwin/fhandler_fifo.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc
index 19cd0e507..c05161099 100644
--- a/winsup/cygwin/fhandler_fifo.cc
+++ b/winsup/cygwin/fhandler_fifo.cc
@@ -516,7 +516,7 @@ fhandler_fifo::open (int flags, mode_t)
 
   char npbuf[MAX_PATH];
   __small_sprintf (npbuf, "r-event.%08x.%016X", get_dev (), get_ino ());
-  if (!(read_ready = CreateEvent (sa_buf, false, false, npbuf)))
+  if (!(read_ready = CreateEvent (sa_buf, true, false, npbuf)))
     {
       debug_printf ("CreateEvent for %s failed, %E", npbuf);
       res = error_set_errno;
-- 
2.21.0


--------------CE98C37F39D315F56A5799FF
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

--------------CE98C37F39D315F56A5799FF--

- Raw text -


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