From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from conssluserg-03.nifty.com (conssluserg-03.nifty.com [210.131.2.82]) by sourceware.org (Postfix) with ESMTPS id F15CF3858404 for ; Tue, 9 Nov 2021 23:30:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F15CF3858404 Received: from Express5800-S70 (z221123.dynamic.ppp.asahi-net.or.jp [110.4.221.123]) (authenticated) by conssluserg-03.nifty.com with ESMTP id 1A9NTPgQ006126 for ; Wed, 10 Nov 2021 08:29:25 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-03.nifty.com 1A9NTPgQ006126 X-Nifty-SrcIP: [110.4.221.123] Date: Wed, 10 Nov 2021 08:29:32 +0900 From: Takashi Yano To: cygwin@cygwin.com Subject: Re: Another pipe-related problem? Message-Id: <20211110082932.3e33bae9364db0dda0c57d16@nifty.ne.jp> In-Reply-To: <20211110082245.2943cf3c2519bff24a6843b2@nifty.ne.jp> References: <05c4180e-396b-4af3-ac0c-2ab8125df17e@cornell.edu> <20211110082245.2943cf3c2519bff24a6843b2@nifty.ne.jp> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, 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: Tue, 09 Nov 2021 23:30:04 -0000 On Wed, 10 Nov 2021 08:22:45 +0900 Takashi Yano wrote: > On Tue, 9 Nov 2021 09:11:28 -0500 > Ken Brown wrote: > > I'll have to reproduce the hang myself in order to test this (or maybe you could > > test it), but I now have a new guess: If the read call above keeps failing with > > EINTR, then we're in an infinite loop. This could happen because of the > > following code in fhandler_pipe::raw_read: > > > > DWORD waitret = cygwait (read_mtx, timeout); > > switch (waitret) > > { > > case WAIT_OBJECT_0: > > break; > > case WAIT_TIMEOUT: > > set_errno (EAGAIN); > > len = (size_t) -1; > > return; > > default: > > set_errno (EINTR); > > len = (size_t) -1; > > return; > > } > > > > Takashi, is EINTR really the appropriate errno in the default case? Isn't > > cygwait supposed to handle signals? > > I assume cygwait() returns WAIT_SIGNALED when signalled > by SIGINT, SIGTERM, SIGTSTP, etc... In this case, EINTR > should return I think. > > Is it wrong? Ah, if SA_RESTART is set, we should continue to read even if signalled... -- Takashi Yano