From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on20707.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e89::707]) by sourceware.org (Postfix) with ESMTPS id 21F3C3858D31 for ; Sun, 19 Apr 2020 01:47:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 21F3C3858D31 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IZEI5JAVQSoq4h+k34gaP5RyDDbAmwAGodj23ToK9Ad06y5DyCwOoNdKIqorbG25gWfDw9933e2kSNCbz2ArRa+FZbggP3WyuIcM1F7adAoK/3BM3P2LOq40RAMZlQ2caFU6GItEvZUI5vejmfMYcW6NBWsSWYScG06D1VwyXuq48Hw8nmAw9knfIp+cQQbyL5T1Y2D/WXp0y5cfwHifG+Q5ZlaaSwHQr0l/Je8b281Fq4tRdsUgdCWUqxY85mlT/sFWcKri7P/b14SFG4HaWwoIuPoIG1Yov58PJ9Hqzqa28sLvN+m916//hzc0fMnM8BPpeCZRauh3g+r4CllETw== 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=VdtgvAX58wZ3nEHYxz2wCZpqrcL26WYRJziW2WnyBrU=; b=j1yL3Gfv/3sHnJtx919Tq1Zrk+YUEIedYRmEAPLkHplsFDO+AiOZzgIH3h71RPX9nkqtXj3dElLn/yK30ToiMp1aXai2eWSzq6JjzMJzceE72mpHUB5/a5Xa9SNLOG6gHVcrSAT3xdqQVVDGfoAUB2eaVO8PYsNWQSuD8xK49IldSWxv2JemTa2478SzltcvvjmJuXcX6+nrcmBG9/JHl2QtMJx2sKuh7mbSHPoj+8Vz7oU09X8yio6IjTOrpPhAZdtqnAc8C9Jobx2OxbpYTuqy+HBaxLesbrQRD0C2ydh3QIAON0pY2JBQMmdw5oy6pXYAGtnFcGuKUzSyhw7GWQ== 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 Received: from DM6PR04MB6075.namprd04.prod.outlook.com (2603:10b6:5:127::31) by DM6PR04MB4313.namprd04.prod.outlook.com (2603:10b6:5:9a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29; Sun, 19 Apr 2020 01:47:01 +0000 Received: from DM6PR04MB6075.namprd04.prod.outlook.com ([fe80::f48b:4e13:94d7:f7c4]) by DM6PR04MB6075.namprd04.prod.outlook.com ([fe80::f48b:4e13:94d7:f7c4%4]) with mapi id 15.20.2921.027; Sun, 19 Apr 2020 01:47:00 +0000 Subject: Re: open write descriptor on named pipe sometime results in ENOENT To: cygwin@cygwin.com References: <005101d61595$741a0120$5c4e0360$@gmail.com> From: Ken Brown Message-ID: <55a55714-b7b6-f9a8-edd9-8e9b61d13329@cornell.edu> Date: Sat, 18 Apr 2020 21:46:58 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-ClientProxiedBy: MN2PR19CA0042.namprd19.prod.outlook.com (2603:10b6:208:19b::19) To DM6PR04MB6075.namprd04.prod.outlook.com (2603:10b6:5:127::31) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.0.17] (68.175.129.7) by MN2PR19CA0042.namprd19.prod.outlook.com (2603:10b6:208:19b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.29 via Frontend Transport; Sun, 19 Apr 2020 01:46:59 +0000 X-Originating-IP: [68.175.129.7] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ed7ea9eb-b432-4598-9bf5-08d7e4038d03 X-MS-TrafficTypeDiagnostic: DM6PR04MB4313: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-Forefront-PRVS: 0378F1E47A 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)(366004)(396003)(346002)(39860400002)(136003)(376002)(316002)(16576012)(6486002)(786003)(6916009)(31686004)(2906002)(81156014)(75432002)(8676002)(8936002)(16526019)(186003)(52116002)(86362001)(26005)(478600001)(36756003)(31696002)(2616005)(956004)(5660300002)(66476007)(66556008)(53546011)(66946007); 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: SkWpoyFoM7X6UAwZSQpJX4tc69xKoHc7xHN+sXV55qqIdIGDeZ4NhhBBf31YEO1ABgJumoR+8V1SiaupUQ9yNxNCPqRmtC2LVQ6lrVDxqJW6J/zKnMwwNFYKAjUpcdUJ/p8uTnK5kVFJKmUZOcyf5yQC1tNYRoFv8jYFUQd1CVnp1E2ShKySVb/AYyCsIr2WiI6PESgsnnLCQ5TneH4udHSpKknROcS+epHSHz7e66mSiwngejUQlPqrqaGCxKSHM8znaWiYHzsm3jS2ntMoaSGk5zaTEWx5+UJq54b55h5a+f3FASQY9kEUrmZHBrpTdOvXMttLgbxuPnnQhjCCHvgQlH/QSDM+kRLqSyTOk7BV1Tyx/JOh9FXdj1vNrwqf88wtacmQJ2q6U3mMIVLANd6sNKTO4BXPiwXvsZK+OrFNV3C6UDuk5ccKOJFQVYkP X-MS-Exchange-AntiSpam-MessageData: GxQBlPzzCmu/hxEMW/FUS+vB3V9vMqBeSHNT9SgcTRCdjUjxl+kwYXY5kq2b3xukILxIfBgcMdZzC7KNeiDOdryfTtR2o0sHho06Oez7g+Tlrl/RNS+HNw3eDjeBIzmb8TqgoHfvXtxYJc22s58gxQ== X-OriginatorOrg: cornell.edu X-MS-Exchange-CrossTenant-Network-Message-Id: ed7ea9eb-b432-4598-9bf5-08d7e4038d03 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2020 01:47:00.5848 (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: hjqsEiP34yDag+LwFJyzWEzbOVaJXBqOusqWQ2FM3NChdzySHisv/4TAjc48/Tbo2LKYstM2o5EArWsTnIEPjQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR04MB4313 X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00, DKIM_INVALID, DKIM_SIGNED, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, MSGID_FROM_MTA_HEADER, 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@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Apr 2020 01:47:08 -0000 On 4/18/2020 5:48 PM, Ken Brown via Cygwin wrote: > On 4/18/2020 11:24 AM, sten.kristian.ivarsson@gmail.com wrote: >> Hey all >> >> >> We're trying to nail down some issues with using named pipes >> >> The issue we're getting is deterministic (ENXIO) but it is not this one, but >> we think this issue is worth reporting anyway >> >> >> We're using the branch topic/fifo >> >> >> >> The program explained in short is: >> >> >> - One main (parent) pipe that lives through the whole execution >> >> - The main process forks 'children' child-processes that creates their own >> (unique) named pipes >> >> - Each child forks 'children' grans-child-processes that just writes some >> bogus messages back to the unique child pipe >> >> - Each child writes a bogus message back to the main process >> >> - Every process creates a write and a read descriptor, but the write >> descriptor is just a dummy descriptor (to somehow keep the pipe alive >> without being bombarded with signals) >> >> - This iterates a few times >> >> >> Some of the constructs may be a bit confusing and maybe not relevant to this >> issue, but I left them in the test-program anyway >> >> >> >> >> Issue #1 sometimes occurs in line 35 (printed as 36) we get ENOENT (No such >> file or directory) despite that the pipe was just created and the read >> descriptor successfully was opened >> >>     *wfd = open(name, O_WRONLY); >> >> >> Issue #2 sometimes occurs in line 73 (printed as 74) we get EBUSY (Device or >> resource busy) when attempting to open a non blocking descriptor >> >>     const int wfd = open(name, O_WRONLY | O_NONBLOCK); >> >> >> Issue #3 sometimes occurs somewhere unknown and the main process just get >> stuck (I've failed to reproduced that with strace or so) and to not have any >> more input so maybe this should be left out ? >> >> >> >> I hope this is well described and hopefully it's enough to reproduce the >> issue(s) and hopefully is not due to a fault test case ;-) > > I'm just in the middle of fixing some bugs that are probably related.  I hope to > have some fixes in the next day or two, as well as better error codes.  (The > error codes are mostly translated from NTSTATUS codes and often don't reflect > the real problem.) > > By the way, I really appreciate all your testing and bug reports.  The FIFO code > is fairly new and hasn't gotten any intense testing up to now, especially in the > non-blocking case. I've made some improvements in the opening of writers, which I will push soon (probably tomorrow). I think that this will fix the errors you've been seeing when opening writers. The issue is one of timing. I hope I've built in a large enough timeout so that you won't see these errors anymore. But if it does fail you should see ETIMEDOUT instead of EBUSY or ENOENT. But there's a separate issue: Your program has two processes trying to read from /tmp/pipe_parent at the same time. My implementation of support for multiple readers is not yet finished, so this can't work yet. I hope to have at least a first cut of this done within a few days. Ken