delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2020/03/28/22:20:15

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3F075385E013
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1585448361;
bh=C8MGuRVwrTe5n+gXEcNEk/1YQmxFHmK/4SsMtuN+zx8=;
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=xw7yLnEeXfNm+FNGT/sIYrX40CakzqXbsKxTU8UXWntaHxFcKOhMo+qcpRBfuN42B
qKIX2/I1cufgI5QKCLs6W3EqVO2walWLPBXh/O2XAcYgtuTxfWq2GdqhzR8F59tqro
sa52dVdXHdv5f5UNQ9JlmRMzIYPUenvwvBmSnw+k=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3D254385B831
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
b=WkgCOT/WQdGnAOSrVqw2Z/cLL3QP5f4s7uUuDNkBp4EMDh8PEENEcgFpT6ywVYXODOba7H88biP3A/ttqpKfk44MKUdWC0lWBHzIv1vgcgG5sdk+z2qUY1GAyczjzFy/8vQZInZy29GxA9QyTk+XMCaPdXrgwzk3DtHAOjEe5fib2ttvvVwNiZPvwsZXcEyj18m1nY8b3ZPfDBv7mzaM9gEDwbced9RZbvaw3P0Nc+1Hw/Y+Q1DXFQkwG39YXD9gv3XCbePEEI37rDR2rxLKeiysi2GgrUfAcQlFOyyk+wFGoza2UdakHgYfJJVFkpAUyPufVSQ9AzaAbqCmw0QiXg==
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=UyPFCAwZ+8GMc+cpkI127yzbVjhhfOdIEGKkCRWAtns=;
b=jTlBMGNYBR72koU1TCDKZ1sdMM/Ea6T5MrNzLSSxsgfPFRYqqvu+O3tv5+v9c7RiiRxfLM8tOkbEvbqwu9WVlPBCQWl62KiVAeWzOPNRvEQSoGBy9WEb7PDL3KhYSAd3UhsYQJOMa+YVO0ufN2gmVv10szWUi8Ywh7V7xXl51GcJNM5ougKT/Pl6TyMuyWKlrMrA7IR1IMjIqwDMvPcg6p/l3WP7DCseG8Q4iVOJLRgfGauLPVV5MGSoWyihDmvLXKj48Y4xIif++aWMPRTpOLMf7pbH8AZw+mKNw9v0/TzaHHHXP4/tgL+kqwN8nPJADHSvR3/GPucwt95uzd/wcg==
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: 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>
<ce4a4877-df77-3400-e8ac-16655b313757 AT cornell DOT edu>
<b311d907-7376-5bc6-3216-7d2b96728dbc AT cornell DOT edu>
<00b901d60447$7ecb4c50$7c61e4f0$@gmail.com>
<f8f5c9b4-9eb9-85b0-ab8f-44b3b2458e0b AT cornell DOT edu>
<00e001d604f9$d0aa0720$71fe1560$@gmail.com>
<8c6c5655-c162-8361-9f44-376bbd7cf114 AT cornell DOT edu>
Message-ID: <d213c473-00c2-0308-b720-d8f274126681@cornell.edu>
Date: Sat, 28 Mar 2020 22:19:09 -0400
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101
Thunderbird/68.6.0
In-Reply-To: <8c6c5655-c162-8361-9f44-376bbd7cf114@cornell.edu>
X-ClientProxiedBy: MN2PR18CA0002.namprd18.prod.outlook.com
(2603:10b6:208:23c::7) 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: 442a572b-a160-4954-2472-08d7d3879210
X-MS-TrafficTypeDiagnostic: DM6PR04MB5145:
X-Microsoft-Antispam-PRVS: <DM6PR04MB5145D4631A6B9E67528FBFA0D8CA0 AT DM6PR04MB5145 DOT namprd04 DOT prod DOT outlook DOT com>
X-MS-Oob-TLC-OOBClassifiers: OLM:6790;
X-Forefront-PRVS: 035748864E
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)(376002)(396003)(39860400002)(346002)(366004)(136003)(4326008)(186003)(786003)(86362001)(16526019)(6486002)(6916009)(75432002)(31686004)(26005)(31696002)(66476007)(8936002)(478600001)(53546011)(66556008)(66946007)(81156014)(36756003)(52116002)(316002)(956004)(2616005)(16576012)(5660300002)(2906002)(81166006)(8676002);
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: jj9t33YXmcYm6FRJXok9iMt4ou51EMiN3HHqpozqP/ECHpS9TGAvNh7jd7K7uBj3trxeKW48FOckN6XjOUJaNH3xXmgW82wXafbsxiPKfxoCQwnoKh9D1mN2NE942WQirg3C4xZLnQlodavjyGVCW+yPg+tXaWkNo/iJwgk5laS+JzEpAK3KEEL1T8ml1fteU00napaHIV7kK2fCp1R4iPUehhiHYeETQ0HatYTJQ9RWUg85TwcRPbY2kadmdFKDnFRyM9bwh9naj/8Hj47lCHat49hCjG8Ys4v25UzsWooFcf04f/lH55Vst/1jOEIBgEqclE5OeX4CWvKxyrtQO6Wk02GhnG1BZ2BNFsmCL9fejdRp2YMvP3umht9vUhjUNEuDZKWyw9BNAFCcUbpqbddA2xRP1xMqPKjxC6hyygf82KmurEvzV2Ooz8u8YlRV
X-MS-Exchange-AntiSpam-MessageData: aqNxEiWzZln3MCAq1M8n8q8h+FiDSOb1m8TtMJnhrTUNBUy05DV+Y17p2BJXPLbwe1S6o6QwqM4NLYM4cqOo8knL4OffiUd7OCcZ3dDqotG2geO8rHwxi20dPIBDFBUeGUqYQTZCVMJL5E52NV9wfA==
X-OriginatorOrg: cornell.edu
X-MS-Exchange-CrossTenant-Network-Message-Id: 442a572b-a160-4954-2472-08d7d3879210
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2020 02:19:12.3130 (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: XFDRZNf49aV5eLm0iRyIAZwOr7wqp2GbBsvXt3/QMOvoW3oDxR5BAN2FZ0nP2fcN7E+aIj41qO5g2+biXw9L/A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR04MB5145
X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00, DKIM_INVALID,
DKIM_SIGNED, KAM_DMARC_STATUS, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_NONE,
SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no 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>
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id 02T2JnLF011094

On 3/28/2020 11:43 AM, Ken Brown via Cygwin wrote:
> On 3/28/2020 8:10 AM, sten DOT kristian DOT ivarsson AT gmail DOT com wrote:
>>> On 3/27/2020 10:53 AM, sten DOT kristian DOT ivarsson AT gmail DOT com wrote:
>>>>> On 3/26/2020 7:19 PM, Ken Brown via Cygwin wrote:
>>>>>> 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.
>>>>>>>
>>>>>>> This is consistent with my guess that the error is generated by
>>>>>>> fhandler_fifo::wait.  I have a feeling that read_ready should have
>>>>>>> been created as a manual-reset event, and that more care is needed
>>>>>>> to make sure it's set when it should be.
>>>>>>>
>>>>>>>> I could provide a code-snippet
>>>>>>>> to reproduce it if wanted ?
>>>>>>>
>>>>>>> Yes, please!
>>>>>>
>>>>>> That might not be necessary.  If you're able to build the git repo
>>>>>> master branch, please try the attached patch.
>>>>
>>>>> Here's a better patch.
>>>>
>>>>
>>>> I finally succeeded to build latest master (make is not my favourite
>>>> tool) and added the patch, but still no success in my little
>>>> test-program (see
>>>> attachment) when creating a write-file-descriptor with O_NONBLOCK
>>
>>> Your test program fails for me on Linux too.  Here's the output from one
>> run:
>>
>> You're right. That was extremely careless of me to not test this in Linux
>> first :-)
> 
> No problem.
> 
>> I can assure that we have a use case that works on Linux but not in Cygwin,
>> but it seems like I failed to narrow it down in the wrong way
>>
>> I'll try to rearrange my code (that works in Linux) to mimic our application
>> but in a simple way (I'll be back)
> 
> OK, I'll be waiting for you.  BTW, if it's not too hard to write your test case 
> in plain C, or at least less modern C++, that would simplify things for me.  For 
> example, your pipe.cpp failed to compile on one Linux machine I wanted to test 
> it on, presumably because that machine had an older C++ compiler.

Never mind.  I was able to reproduce the problem and find the cause.  What 
happens is that when the first subprocess exits, fhandler_fifo::close resets 
read_ready.  That causes the second and subsequent subprocesses to think that 
there's no reader open, so their attempts to open a writer with O_NONBLOCK fail 
with ENXIO.

I should be able to fix this tomorrow.

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

- Raw text -


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