X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0B5AF385B512 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1692847937; bh=S7hjWdQLotqseixeLkwhK4ufmqLHilGlYEfylzWz4X0=; h=Date:To:Subject:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=jYeBjDNDUoJVlWNZhC7gcGfTsP3T50QJk64Jub5K4L9Y0j2mGk36Rz5GjnLqYzzuw KwpFXmnSlV/E2k+en9Hp/EyS201hew8Nhk75blY2zGUThYXW3H6ptB+LD6dyCLe/0K WndOBtPcPof4HNZjM0bIiRvDmHqBdvcTFDsPIQYU= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 744AB3858C01 Date: Thu, 24 Aug 2023 12:31:31 +0900 To: cygwin AT cygwin DOT com Subject: Re: scp stalls on uploading in cygwin 3.5 current master. Message-Id: <20230824123131.390b4471915c963425c77608@nifty.ne.jp> In-Reply-To: <20230824060502.c4798062cb19d4d35a5633ae@nifty.ne.jp> References: <20230824060502 DOT c4798062cb19d4d35a5633ae AT nifty DOT ne DOT jp> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32) Mime-Version: 1.0 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: cygwin AT cygwin DOT 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: , From: Takashi Yano via Cygwin Reply-To: Takashi Yano Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" On Thu, 24 Aug 2023 06:05:02 +0900 Takashi Yano wrote: > Hi Corinna, > > After the commit dedbbd74d0a8, "scp file server:." stalls. > I confirmed this when the "server" is a Linux machine. > The problem does not occur if it is reverted. > > Could you please have a look? > > commit dedbbd74d0a8f3b7dfae6188321703a47bb8a2b3 > Author: Corinna Vinschen > Date: Tue Aug 1 14:22:55 2023 +0200 > > Cygwin: select: workaround FD_WRITE network event handling > > The FD_WRITE event is a false friend. It indicates ready to write > even if the next send fails with WSAEWOULDBLOCK. *After* the fact, > FD_WRITE will be cleared until sending is again possible, but that > is too late for a select/write loop. > > Workaround that by using the WinSock select function when peeking > at a socket and FD_WRITE gets indicated. WinSock select fortunately > indicates writability correctly. > > Fixes: 70e476d27be8 ("(peek_socket): Use event handling for peeking socket.") > Signed-off-by: Corinna Vinschen I'm not sure why at all, however, the following patch seems to solve the issue. diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc index 7b9473849..de5794c9f 100644 --- a/winsup/cygwin/select.cc +++ b/winsup/cygwin/select.cc @@ -1790,7 +1790,7 @@ peek_socket (select_record *me, bool) if (events & FD_WRITE) { wfd_set w = { 1, { fh->get_socket () } }; - TIMEVAL t = { 0 }; + TIMEVAL t = { .tv_sec = 0, .tv_usec = 1 }; if (_win32_select (0, NULL, &w, NULL, &t) == 0) events &= ~FD_WRITE; -- Takashi Yano -- 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