From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout.easymail.ca (mailout.easymail.ca [64.68.200.34]) by sourceware.org (Postfix) with ESMTPS id 063A03858D28 for ; Sun, 17 Oct 2021 20:52:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 063A03858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=house.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=house.org Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id B3B68EAA for ; Sun, 17 Oct 2021 20:52:37 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at emo02-pco.easydns.vpn Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo02-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MU4KzKibL0Zj for ; Sun, 17 Oct 2021 20:52:37 +0000 (UTC) Received: from tringa.house.org (S01063c378672c9be.gv.shawcable.net [24.108.54.3]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id 34204E7D for ; Sun, 17 Oct 2021 20:52:37 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: cat fifo hang [Re: [ANNOUNCEMENT] cygwin 3.3.0-0.2.6c1f49f83fde (TEST)] From: Chris Roehrig In-Reply-To: <2c263022-b361-f697-ca7b-5caface23872@cornell.edu> Date: Sun, 17 Oct 2021 13:52:35 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <3734589D-7DB4-41F1-9BE6-AF3A36693397@house.org> References: <9D395D88-1D8A-4C8B-9C96-32734D14C4D7@house.org> <13495a25-2ae9-69f9-cd8e-6e6ff0e1af9e@cornell.edu> <2c263022-b361-f697-ca7b-5caface23872@cornell.edu> To: Ken Brown via Cygwin X-Mailer: Apple Mail (2.1499) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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, 17 Oct 2021 20:52:40 -0000 On Sun Oct 17 2021, at 9:19 AM, Ken Brown via Cygwin = wrote: > On 10/16/2021 1:42 PM, Chris Roehrig wrote: >> On Mon Sep 27 2021, at 7:26 AM, Ken Brown via Cygwin = wrote: >>> On 9/26/2021 8:57 PM, Chris Roehrig wrote: >>>> I have installed this (completely this time) and have encountered = no issues with it. I'm getting full gigabit speeds with my rsync = transfers. Looks great! >>>=20 >>> Thanks for testing. >> I've encountered a crash that might be related. I had previously = been having occasional crashes/hangs of cat.exe over the years, but this = is the first time I've ever gotten an error message: >> cygwin error: 0 [fifo_reader] cat 11398 C:\cygwin\bin\cat.exe: *** = fatal error - Can't add a client handler, Win32 error 123 >=20 > This isn't a crash in the usual sense. It's the Cygwin fifo code = issuing a fatal error because an attempt to create a new Windows pipe = instance failed. And it's in code that's been around for a while, so = it's not related to the new pipe implementation. >=20 >> cat here is reading from a fifo created with mkfifo. >> I've only encountered it once (out of daily runs over the last couple = weeks) and don't know how to replicate it. Possibly a race? Looks = like my script has tried to mitigate this with a sleep 1 between the = mkfifo and the fork: cat < $fifo & >=20 > The sleep shouldn't be necessary. If it is, there's a bug in the fifo = code. Can you remove the sleep and see what happens? It would be great = if that made it possible to replicate the problem. Here's a script that pretty reliably hangs cat after some iterations. = I haven't yet gotten a repeat of that error message though. It runs fine on Ubuntu 20.04 and Mac OS X 10.8.4. #!/bin/bash # take arg as number of iterations (default=3D100) STEPS=3D"${1-100}" FIFO_PFX=3D"/tmp/catfifo_" FIFO_WAIT=3D0 STEP_WAIT=3D0 function mysleep() { if [ -n "$1" -a "$1" !=3D "0" ]; then sleep "$1"; = fi } function cleanup(){ rm -f "$FIFO_PFX"* } trap cleanup EXIT printf "Creating $STEPS fifo readers...\n" for ((i=3D0; i"$fifo" =09 printf "FIFO %d\n" "$i" >&3 # close the file descriptor, wait for process to exit and clean = up exec 3>&- wait $pid rm -f "$fifo" mysleep $STEP_WAIT done