From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from re-prd-fep-043.btinternet.com (mailomta20-re.btinternet.com [213.120.69.113]) by sourceware.org (Postfix) with ESMTPS id D89AA385841C for ; Sat, 18 Sep 2021 14:11:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D89AA385841C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dronecode.org.uk Authentication-Results: sourceware.org; spf=none smtp.mailfrom=dronecode.org.uk Received: from re-prd-rgout-005.btmx-prd.synchronoss.net ([10.2.54.8]) by re-prd-fep-043.btinternet.com with ESMTP id <20210918141123.LYQ22650.re-prd-fep-043.btinternet.com@re-prd-rgout-005.btmx-prd.synchronoss.net> for ; Sat, 18 Sep 2021 15:11:23 +0100 Authentication-Results: btinternet.com; auth=pass (PLAIN) smtp.auth=jonturney@btinternet.com; bimi=skipped X-SNCR-Rigid: 613A9124011D9D10 X-Originating-IP: [81.129.146.163] X-OWM-Source-IP: 81.129.146.163 (GB) X-OWM-Env-Sender: jonturney@btinternet.com X-VadeSecure-score: verdict=clean score=0/300, class=clean X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgedvtddrudehkedgjeduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuueftkffvkffujffvgffngfevqffopdfqfgfvnecuuegrihhlohhuthemuceftddunecunecujfgurhepuffvfhfhkffffgggjggtgfesthejredttdefjeenucfhrhhomheplfhonhcuvfhurhhnvgihuceojhhonhdrthhurhhnvgihsegurhhonhgvtghouggvrdhorhhgrdhukheqnecuggftrfgrthhtvghrnhepteelffegteeiudeuteehffevledvffeffeekgffhhfehvdfhgffhteehteelteeknecuffhomhgrihhnpegthihgfihinhdrtghomhenucfkphepkedurdduvdelrddugeeirdduieefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehhvghloheplgduledvrdduieekrddurddutdefngdpihhnvghtpeekuddruddvledrudegiedrudeifedpmhgrihhlfhhrohhmpehjohhnrdhtuhhrnhgvhiesughrohhnvggtohguvgdrohhrghdruhhkpdhrtghpthhtoheptgihghifihhnqdguvghvvghlohhpvghrshestgihghifihhnrdgtohhm X-RazorGate-Vade-Verdict: clean 0 X-RazorGate-Vade-Classification: clean Received: from [192.168.1.103] (81.129.146.163) by re-prd-rgout-005.btmx-prd.synchronoss.net (5.8.716.04) (authenticated as jonturney@btinternet.com) id 613A9124011D9D10 for cygwin-developers@cygwin.com; Sat, 18 Sep 2021 15:11:23 +0100 Subject: Re: cygrunsrv + sshd + rsync = 20 times too slow -- throttled? To: cygwin-developers@cygwin.com References: <20210915205433.014102a9c1204687135e1417@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> <20210918170332.2ff48fdcbfd2398614a5666f@nifty.ne.jp> <97b9f3f7-ee41-1f4a-00db-7944fb94f032@cornell.edu> <20210918203543.ed639fe3cfb4bd024b403612@nifty.ne.jp> From: Jon Turney Message-ID: <0d257e42-2623-5994-ee10-7476f463a290@dronecode.org.uk> Date: Sat, 18 Sep 2021 15:11:01 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20210918203543.ed639fe3cfb4bd024b403612@nifty.ne.jp> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1192.2 required=5.0 tests=BAYES_00, FORGED_SPF_HELO, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, 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 14:11:26 -0000 On 18/09/2021 12:35, Takashi Yano wrote: > On Sat, 18 Sep 2021 07:12:56 -0400 > Ken Brown wrote: >>> 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. >> >> Yes, I remember now that the same issue came up a couple years ago: >> >> https://cygwin.com/pipermail/cygwin/2019-August/242060.html Oops. Somehow I missed the conclusion in that thread. >>> 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(); >> Thanks for the patch! >> This may be unnecessarily drastic, given the analysis in my message cited above. > > It seems resetting handler only for SIGPIPE is enough according to > the message you posted two years ago. Thanks. I've applied Takashi-san's patch as is, and rebuilt the xwin-xdg-menu package. I think NSIG is sufficiently small that it's worth doing this for all signals, just in case we ever ignore some other signal. I probably need to audit that code more carefully for anything else it's leaking into the child that it shouldn't be.