From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from re-prd-fep-041.btinternet.com (mailomta6-re.btinternet.com [213.120.69.99]) by sourceware.org (Postfix) with ESMTPS id 19EE8385E001 for ; Wed, 23 Jun 2021 16:41:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 19EE8385E001 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-041.btinternet.com with ESMTP id <20210623164153.NZMU31350.re-prd-fep-041.btinternet.com@re-prd-rgout-005.btmx-prd.synchronoss.net>; Wed, 23 Jun 2021 17:41:53 +0100 Authentication-Results: btinternet.com; auth=pass (PLAIN) smtp.auth=jonturney@btinternet.com X-SNCR-Rigid: 5ED9C74D38DB4C17 X-Originating-IP: [86.139.156.26] X-OWM-Source-IP: 86.139.156.26 (GB) X-OWM-Env-Sender: jonturney@btinternet.com X-VadeSecure-score: verdict=clean score=0/300, class=clean X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgeduledrfeegfedguddtiecutefuodetggdotefrodftvfcurfhrohhfihhlvgemuceutffkvffkuffjvffgnffgvefqofdpqfgfvfenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnegoufhushhpvggtthffohhmrghinhculdegledmnecujfgurhepuffvfhfhkffffgggjggtgfesthejredttdefjeenucfhrhhomheplfhonhcuvfhurhhnvgihuceojhhonhdrthhurhhnvgihsegurhhonhgvtghouggvrdhorhhgrdhukheqnecuggftrfgrthhtvghrnhepfeehudeuveejvedvffeukeeujeeuffeitdduhfetledvjeetfeejjeeufeevleejnecuffhomhgrihhnpehimhhguhhrrdgtohhmnecukfhppeekiedrudefledrudehiedrvdeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehhvghloheplgduledvrdduieekrddurdduuddungdpihhnvghtpeekiedrudefledrudehiedrvdeipdhmrghilhhfrhhomhepoehjohhnrdhtuhhrnhgvhiesughrohhnvggtohguvgdrohhrghdruhhkqecuuefqffgjpeekuefkvffokffogfdprhgtphhtthhopeeotgihghifihhnsegthihgfihinhdrtghomheqpdhrtghpthhtohepoehtrghkrghshhhirdihrghnohesnhhifhhthidrnhgvrdhjpheq X-RazorGate-Vade-Verdict: clean 0 X-RazorGate-Vade-Classification: clean Received: from [192.168.1.111] (86.139.156.26) by re-prd-rgout-005.btmx-prd.synchronoss.net (5.8.340) (authenticated as jonturney@btinternet.com) id 5ED9C74D38DB4C17; Wed, 23 Jun 2021 17:41:53 +0100 Subject: Re: xwin-xdg-menu high cpu usage with rxvt-unicode To: Takashi Yano , The Cygwin Mailing List References: <20210623120858.83e471aa7ddbc20cd41efb2c@nifty.ne.jp> From: Jon Turney Message-ID: <608c8616-52a3-bbfb-f8f0-983a6c4453b1@dronecode.org.uk> Date: Wed, 23 Jun 2021 17:41:25 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210623120858.83e471aa7ddbc20cd41efb2c@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=-3569.7 required=5.0 tests=BAYES_00, FORGED_SPF_HELO, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Wed, 23 Jun 2021 16:41:57 -0000 On 23/06/2021 04:08, Takashi Yano wrote: > On Mon, 21 Jun 2021 05:49:28 +0000 > Viet-Duc Le wrote: >> Hi, >> >> I've encountered a peculiar issue with rxvt-unicode launched from xwin-xdg-menu (20170321-1) >> The image below corresponds to two rxvt-unicode instances, each occupies 30% of system resouce. >> https://imgur.com/a/FTFwIrZ >> I'm using the the latest version of cygwin. 'cygcheck.out' is attached per guideline. >> >> Steps to reproduce: >> - Start XWin Server from Start menu >> - X applications menu -> System Tools -> rxvt-unicode >> - Kill rxvt-unicode to free the resource again >> >> Other observations: >> - XTerm does not incur high resources. >> - Manually launching rxvt-unicode from XTerm does not incur high resources. >> >> I think this is not an issue with rxvt but with xwin-xdg-menu. >> On laptop, it is very noticeable when the fan kicks in. >> Insights and suggestions are much appreciated. >> >> Thanks. >> Viet-Duc > > I looked into this problem and found the cause. > urxvt seems to close stdout while xwin-xdg-menu use select() > to read stdout of the launched apps. Since stdout is closed, > select() returns repeatedly without any output. This causes > high cpu load. > > I also confirmed that the following patch for xwin-xdg-menu > resolves the issue. > [...] > > Jon, could you please have a look? Thanks very much for looking into this, and the patch. That looks right. I applied the patch, and built and uploaded a xwin-xdg-menu-20210623-1 test package. Perhaps you could try that, and see if it improves things for you? (Similar code is used in XWin, so I also need to make a similar change there)