X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:from:date:message-id:subject:to :content-type; q=dns; s=default; b=bMXHWALDAnRtuOyfNb+MCe/gOZU8R Kgqn7N2gN1CCMr7hnhwgZZ03k7MRBGjG0Npn3KtB2N3Gfm3THTbrMHswoIRuYoVs aiHHR976EBTpo4TVZ355zGthrGHg5MU6DVRFk+JBp0l5aRgHqrl/9r3evhQzTMVd Uz3YRoZ/0vW3Ps= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:from:date:message-id:subject:to :content-type; s=default; bh=djriSW6IdHOP8qKQtYirzRWGKWM=; b=FQC Hz7vG2HyAdZgJtD6cV65MGB2Ia9s5h30zQ0dIiyyWZMHJAs/G4imSCU/6aXrP2jT qR1SFAFM9nKswdhuC6nuau5l4V9NlWKtnigHsH9li6ARR3N/GfAQA8LTpuFlMb8B H3LYiKcTINIXcXzeecja0r0cPwIUWwNdE7e1uFrc= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=inconsistency X-HELO: mail-oi0-f48.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=4YZ1MtVMBRrB5zWQ0wPDCO6WteOBZc7657n+shAmqpk=; b=rct0DYJjD4VyYe6uc6T8SHac6oOyzILpR3uFUO1ZEjQRgB96gBYcLHTHrX/oBKk8R6 2Uuiz9OEtBWlIJlvDz6WH/aZw1fN2W5wVTktth3estu7uixKXpCYbbxZIYwHeDIneabp HpVnww4FO2l/FfwPdut4BY6X9FqkpS18pF1yOQXk+nEv6nfQqwHkSb4luaxg9RgviGKD QuO7Fw4DeplyNWHzUyBRYg6MkcYP1lUDeIunZNCP7qNcs9AoP9UuL/SfKDSKsvgFbaR2 +3sTpApM5rGz6hcNk2W/zHbKuqKquuPaezFOifY0D+CcRysgmpokOsffEed8dze2BJRo xOrA== X-Gm-Message-State: APt69E0SDAfx8OUJZPbdl/SiKug3ySU0JY0qcJ9p4yN2dc34giUqwk8e AIvm2lzRNYRZnIUgYq4AfElGQjJJN+zLBVk12xUT0xQ= X-Google-Smtp-Source: ADUXVKK2IXk79HoF58Zgj5tnbAhye4hMvuOKIA547bfz4FLiZarlw8V5sVb3P4suqD3DGQBDyo1vmfEY7oMnRiRR3rY= X-Received: by 2002:aca:f186:: with SMTP id p128-v6mr2138571oih.286.1528302229003; Wed, 06 Jun 2018 09:23:49 -0700 (PDT) MIME-Version: 1.0 From: =?UTF-8?Q?Jo=C3=A3o_Eiras?= Date: Wed, 6 Jun 2018 18:23:08 +0200 Message-ID: Subject: Multiple attempts at opening same pipe for writing fail To: cygwin AT cygwin DOT com Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes Howdy. I've prepared a testcase for a bug or inconsistency with linux that is affecting one of my projects. Basically I have a background process that keeps some state always running with a pipe open for reading requests. Foreground processes that try to open that pipe for writting (to send a request) then block/fail on the second and subsequent tries. The whole setup can be simplified with a small testcase that runs in a single process. https://github.com/joaoe/cygwin-pipe-testcase I left a README that explains things in a bit more detail. To summarize here, consider the following order of events: * open pipe for reading with NONBLOCK into FD1 -> OK * poll() FD1 -> empty event list, OK * read from FD1 -> zero length read, OK * open pipe for writting into FD2, write something -> OK * poll() FD1 -> POLLIN and POLLPRI, POLLPRI is unexpected here, FAIL * read from FD1 -> got stuff that was written * close FD2 * poll() FD1 -> POLLIN and POLLPRI, wrong, should report POLLHUP, FAIL * read from FD1 -> zero length read, OK * open pipe for writting into FD2 again -> got error ENXIO, FAIL So, known bug ? Do you confirm my observations ? Any pointers so I could perhaps look into the relevant code ? It seems like Cygwin still keeps some dirty state somewhere that tells the pipe is still open by a writer somewhere. Thank you ! -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple