delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2020/03/27/19:01:04

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3AEBD3885C32
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1585350015;
bh=SP4vTRHXK03R2ZgQA58AhOqlSHy9mMvHYboFtwPpwjU=;
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=F9il1C12Uu02ueJ8hr76vgVsm5K6C1TyfTEZXxK7oVXQ4ShFStGwZ3vnzxkYyGaFv
RZ4CpKqV6vA0Ebq+sp87zhdw1+Am+VZ1VSkIbjAj35CQmZcaTYsw/FN954IDloNO96
ZPon+YJUzb9QihQ5l41gRL3JuV3z1n5k99Tcyksg=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 21A73385E010
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
b=bPAdskLq3gyQ0hgFDmeSeYRissjvep0uglm/wilkPRqTC7nlZDHwxXtAG3hzDS4H0+Zxs+whI3zEw0txaSygOvJCITAa0jF812EZmo3Ws7rMdD+qOgP8c9nbCjZhJMgODmNPDgcp/5lbUVjBZo0jbRDbVrEazXqUhG6Hx6xAu/UmYSUcsj1G18hoUXcImRhckEAvL+IeltWOX4EdULy+elfok8+FITYib5Bp8CJQ2E1l6Gv0GDO0igM/MyejmwFlML1sSD1wPx7p5a7001RnsXBsCG7BwvooPeSqtTljAVB04HcgTYmItxwPngHkh5SGNHn7qyuUN/+o1jVFt5UOiA==
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=1fYyKfRGtStRufLtPwEs39Ta9Um95HpNqjqDO9zfIXM=;
b=SFOer7A90Neh8GJ2uCN3PzYyKa0HMG27PtqowfQcY+Wy8wIbk4OGeZA+8wwVgVMiVmfz4FpMJkfAzK1wLPbzpCYrfapK3Htuz5a8JvGzBJthZQEvAjeBrlA4mx5rt3kWbKIk0TMuuyY7rlCNSIoYDDix7374UhoeEN9krUbEVAj/E5a/HYoNesbp1Ynn9NqBxT2Z9RmK2ZrZQ8g3Oh/UT8/T7KbF2XuyRQv/Pj42QfxvwYtBTRhcC20ED/MxqqIQxuseL9IdQFGbpbTGeOKNmlZhRHowF8RhfXCYwloZKDxFgHt2z4Rf2mRatI+xLzSuYWv8jjFBI4jynNWeMdI6Eg==
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: 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>
Message-ID: <917871e6-d85c-60cc-6501-5d4ad0104f92@cornell.edu>
Date: Fri, 27 Mar 2020 19:00:08 -0400
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101
Thunderbird/68.6.0
In-Reply-To: <f8f5c9b4-9eb9-85b0-ab8f-44b3b2458e0b@cornell.edu>
X-ClientProxiedBy: CH2PR07CA0031.namprd07.prod.outlook.com
(2603:10b6:610:20::44) 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: c2060c51-5812-4c96-4ac4-08d7d2a299e8
X-MS-TrafficTypeDiagnostic: DM6PR04MB5515:
X-Microsoft-Antispam-PRVS: <DM6PR04MB55151E407A21230198EE8E74D8CC0 AT DM6PR04MB5515 DOT namprd04 DOT prod DOT outlook DOT com>
X-MS-Oob-TLC-OOBClassifiers: OLM:6430;
X-Forefront-PRVS: 0355F3A3AE
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)(39860400002)(136003)(396003)(346002)(366004)(8676002)(786003)(31686004)(81156014)(186003)(26005)(66476007)(16576012)(81166006)(75432002)(66946007)(8936002)(2906002)(478600001)(66556008)(36756003)(316002)(956004)(2616005)(16526019)(966005)(86362001)(4326008)(6916009)(53546011)(6486002)(5660300002)(52116002)(31696002);
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: 4oq83BbHr6Y8E3ojLeEgyL0qk9nFjkswRv9nyQq4H9ZyiMPuTgB3fEdzngKHqeYYcwkY3EfAZ695olFvKpfzpcHbKSw5/UJhm86bOMsLu68AvnSo+syJS4bgQAuOWkiOMD846wvZ7rwSD8hC5Oz70Mh8UN0kn6WF5pqwdSWhe7DU8s/bGEAcD7+KJTgLHZ1cSRTYPerbTWwL+f3awD/4h0aJx7NQC9nYZbRZ5W0xIabdqautPH3IdiA88hIO70YD12PFnDDo+c8hUxo5JikQKsH4XHat4E4NC3+oguzMKI4xneAdM1iRu5f1MK4ZcRpVjFjQAxtB5o9DHhkqFcgcE2IbqIqKY2prbK4DVssDxHgiVefEoYQJSnGQjt7AQXfZjxv/yR7klH/5IiXTrWnZSsaNvn+4zvEdJYWkZEXT/G3eDSoykl/PoAY50Lej4+3XOwFcSBALmMG2Ki9iFDuw2PIumifH4Sl9s+jGrYI3HKiQ00xrT7JL+FDDB00h0GMSQ/U36aXbAbSkn5CVsJ+0Yg==
X-MS-Exchange-AntiSpam-MessageData: 2B1vnHIOtuzkwMERASqwkTPJSHoUwS/+zzSyKrdZ6yKOk0V+3+5idQlm4TrQoUoZSRdL3CLLzrlDwBlrkEDEo4p207Bvx6qrtG86cu9lbV5uZ0tOv84FYiGX+xNyoF/Q0N5nDrh0TJ1JXbwfQFYmsw==
X-OriginatorOrg: cornell.edu
X-MS-Exchange-CrossTenant-Network-Message-Id: c2060c51-5812-4c96-4ac4-08d7d2a299e8
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Mar 2020 23:00:10.5816 (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: +9RWz9HBQqZi4y9Hj3bRagk26MXxG7nBdRGOD/Wl7YMsyuOq8iYW3e8+DBDvxJRkMVYaFrxnBy1sRpQ/dSLDGQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR04MB5515
X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, BODY_8BITS,
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 02RN0dpr028979

On 3/27/2020 6:56 PM, Ken Brown via Cygwin 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:
> 
> child 657
> 657     error:  6       No such device or address
> child 658
> child 659
> 658659  error:  child 660
> parent
> child 661
>          error:  66606661 661 661
>                  error:          661
> No such device or address6No such device or address
> 
> No such device or address
> 
> [I then killed it with control-C; the parent was blocked trying to open the FIFO.]
> 
> There's a race condition in your code.  The parent is trying to open the FIFO 
> for reading (without O_NONBLOCK) while the child is trying to open it for 
> writing (with O_NONBLOCK).  The parent is blocked waiting for the child, and the 
> child's open fails with ENXIO; see
> 
>    https://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html#tag_16_357
> 
> I think you need to rearrange things so that the FIFO is open for reading before 
> you try a nonblocking open for writing.

For example, you could open it with O_RDWR instead of O_RDONLY.
--
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