From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from conssluserg-01.nifty.com (conssluserg-01.nifty.com [210.131.2.80]) by sourceware.org (Postfix) with ESMTPS id 5D4A5385AC31 for ; Sat, 18 Sep 2021 08:04:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5D4A5385AC31 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=nifty.ne.jp Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=nifty.ne.jp Received: from Express5800-S70 (z221123.dynamic.ppp.asahi-net.or.jp [110.4.221.123]) (authenticated) by conssluserg-01.nifty.com with ESMTP id 18I83Ji2019962; Sat, 18 Sep 2021 17:03:19 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-01.nifty.com 18I83Ji2019962 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.ne.jp; s=dec2015msa; t=1631952199; bh=Spnoe7wcCaAS8CeQPL+mcW6Ft/bGmfPR0hlRFbw0nfI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Sj3Ywho6g0Dz7dQU3geaC2KVrrklGiWIjKQMmzogoX2sijK1qAiGUeni+LhPt4Wng W2rec8MnMQ5pCD8djIR6OncXcAPJbDOqd8WU6iu4MstHYwWHIC7QW9+5Q0/BUF2Cwz mZJBXfrkPKQo3CWJT8wo9PSpmkQxZNHMM19f8TtZViRZlLdMxAOyAOAI9/L0VqYvFF EDt9FrS2sKB8wAxKpg4T1WW7fNZT9fr/6Sx25iXq9VPxNXmBuuRbbhXLxbc3xu99Tc 0Vk5kNg8hz7mevDYnXwXpQoyigZ3Ur3RkNZr9vSKV/sDasdF4/2Np7XCtX/FT8Spld bH+TOrqn1EjJg== X-Nifty-SrcIP: [110.4.221.123] Date: Sat, 18 Sep 2021 17:03:32 +0900 From: Takashi Yano To: cygwin-developers@cygwin.com Cc: Jon Turney Subject: Re: cygrunsrv + sshd + rsync = 20 times too slow -- throttled? Message-Id: <20210918170332.2ff48fdcbfd2398614a5666f@nifty.ne.jp> In-Reply-To: <1199de76-b51c-bb39-2bd0-8618e729e98a@cornell.edu> References: <20210915205433.014102a9c1204687135e1417@nifty.ne.jp> <20210916232756.fe8c744401b6cf703b1fe993@nifty.ne.jp> <4d9e4a0d-1fb0-5fe6-5e09-27ffde8f3174@cornell.edu> <0d5488da-3238-09be-5713-2f20e374ca21@cornell.edu> <20210917050108.0427cacf58fc473c63013386@nifty.ne.jp> <20210917173130.7e62602a5ef1bb5ae952d3bb@nifty.ne.jp> <7ec3a773-a75e-23ce-e827-850443b7d832@cornell.edu> <20210918012300.3c62456e1d2091d3086d1e69@nifty.ne.jp> <20210918024358.a9c2d43d539903c360ce6d6f@nifty.ne.jp> <20210918103012.11eedd27fb81fef4ca1375f4@nifty.ne.jp> <6fb2a102-22c1-12f6-2749-39a640e6b718@cornell.edu> <1199de76-b51c-bb39-2bd0-8618e729e98a@cornell.edu> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.6 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-developers@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component developers mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2021 08:04:39 -0000 On Fri, 17 Sep 2021 22:10:39 -0400 Ken Brown wrote: > On 9/17/2021 10:07 PM, Ken Brown wrote: > > On 9/17/2021 9:30 PM, Takashi Yano wrote: > >> On Fri, 17 Sep 2021 15:53:18 -0400 > >> Ken Brown wrote: > >>> $ cygport *.cygport up > >>> /usr/bin/cygport: line 426: echo: write error: Broken pipe > >>> /usr/bin/cygport: line 426: echo: write error: Broken pipe > >>> /usr/bin/cygport: line 426: echo: write error: Broken pipe > >>> /usr/bin/cygport: line 426: echo: write error: Broken pipe > >>> *** Info: Building native toolchain for x86_64-pc-cygwin host > >>> /usr/bin/cygport: line 426: echo: write error: Broken pipe > >>> /usr/bin/cygport: line 426: echo: write error: Broken pipe > >>>   >>> Uploading cygwin-3.3.0-0.1.9814cfd8f693.x86_64 > >>> [...] > >>> > >>> This happens in an xterm window, but not in mintty. > >> > >> I have installed cygwin 3.3.0 [TEST]. > >> And I tryed cygpoort upload, but I cannot reproduce your problem > >> even in xterm window. > > > > Hmm.  I wonder what's different about my environment that would explain this.  I > > start the X server with startxwin. > > And then I start UXTerm from the xwin-xdg-menu. Ah, this seems to be the point. If xterm is started from xwin-xdg-menu, minimized test case (/bin/echo A; /bin/echo B) | head -1 also causes the error: /bin/echo: write error: Broken pipe Even in mintty, this error occurs if it is started from xwin-xdg-menu. I also confirmed that this also happen with cygwin 3.2.0. However this does not happen if xterm is started from mintty window by 'xterm -display :0'. So, this is not a regression in cygwin 3.3.0 [TEST]. In other words, the change of pipe implementation is not the culprit. I have no idea why terminal behaves differently if it is started from xwin-xdg-menu so far. 'yes |head -1' also behaves differently. In the termainl not started from xwin-xdg-menu, [yano@Express5800-S70 ~]$ yes |head -1 y [yano@Express5800-S70 ~]$ however, if it is started from xwin-xdg-menu, [yano@Express5800-S70 ~]$ yes |head -1 y yes: standard output: Broken pipe [yano@Express5800-S70 ~]$ It seems that SIGPIPE is handled differently. I guess SIGPIPE is handled by SIG_IGN if the terminal started from xwin-xdg-menu, otherwize, it is handled by SIG_DFL. Ah, the following patch for xwin-xdg-menu may be the right thing. --- execute.c.orig 2021-06-23 23:59:37.000000000 +0900 +++ execute.c 2021-09-18 16:53:52.144248600 +0900 @@ -76,6 +76,7 @@ { struct rlimit rl; unsigned int fd; + int sig; /* dup write end of pipes onto stderr and stdout */ close(STDOUT_FILENO); @@ -89,6 +90,10 @@ for (fd = STDERR_FILENO + 1; fd < rl.rlim_cur; fd++) close(fd); + /* Set all signal handlers to SIG_DFL. */ + for (sig = 1; sig < NSIG; sig++) + signal(sig, SIG_DFL); + /* Disassociate any TTYs */ setsid(); -- Takashi Yano