From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#63865: 29.0.90; call-process while owning the X selection hangs other processes Date: Sat, 03 Jun 2023 18:02:31 +0300 Message-ID: <835y848u7s.fsf@gnu.org> References: <83edmt9j8i.fsf@gnu.org> <87bkhxnhpk.fsf@yahoo.com> <87wn0kn3zu.fsf@yahoo.com> <83mt1g9044.fsf@gnu.org> <83leh08xmn.fsf@gnu.org> <83a5xg8vzo.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35271"; mail-complaints-to="usenet@ciao.gmane.io" Cc: luangruo@yahoo.com, 63865@debbugs.gnu.org To: Spencer Baugh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 03 17:02:21 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q5Slo-0008yH-Kj for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 03 Jun 2023 17:02:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q5SlX-00060U-Tx; Sat, 03 Jun 2023 11:02:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q5SlW-000608-DF for bug-gnu-emacs@gnu.org; Sat, 03 Jun 2023 11:02:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q5SlW-0006ui-4a for bug-gnu-emacs@gnu.org; Sat, 03 Jun 2023 11:02:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q5SlW-0008AW-00 for bug-gnu-emacs@gnu.org; Sat, 03 Jun 2023 11:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 03 Jun 2023 15:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63865 X-GNU-PR-Package: emacs Original-Received: via spool by 63865-submit@debbugs.gnu.org id=B63865.168580451031378 (code B ref 63865); Sat, 03 Jun 2023 15:02:01 +0000 Original-Received: (at 63865) by debbugs.gnu.org; 3 Jun 2023 15:01:50 +0000 Original-Received: from localhost ([127.0.0.1]:44121 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5SlJ-0008A1-Oh for submit@debbugs.gnu.org; Sat, 03 Jun 2023 11:01:50 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:37144) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5SlI-00089m-7o for 63865@debbugs.gnu.org; Sat, 03 Jun 2023 11:01:49 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q5SlC-0006qs-JY; Sat, 03 Jun 2023 11:01:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=RGz+2gXiInYH8DtwGPcIsWr5LnyDq3rODI5Z57khEIY=; b=Mdpqh0C9gfvt kTsl5fiw59dlCQ0DGryxAiznCrYTEdA2tQ0bgigdigFnLHbl2QDnxbNIih67DdFrQGbNXpyd9pI9M FvsZnM2a6VdcX1V9nzGdMuzpAI/lkkmB9UN/P7crolnM8n8Zd4oc0p5LBiNhvWMyXU92jG2UxFWUp aIpqIS9AZ4hYhUbIcjAurZUznWwoaxjdPSxc109CCBH9cYZJf4lMMMhMkS854XguznFmM/rf29TJm GsNuDQ745ftjbguvv9N+KJIbYIc5wH1c/FLD/wxWm61LlFIgBCsHvk6GWuujRKWY/MLVwAvAABkDK tt4vbY7w0+W9E2ddX9cczw==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q5SlA-0003qk-DV; Sat, 03 Jun 2023 11:01:40 -0400 In-Reply-To: (message from Spencer Baugh on Sat, 03 Jun 2023 10:41:15 -0400) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:262861 Archived-At: > From: Spencer Baugh > Cc: luangruo@yahoo.com, 63865@debbugs.gnu.org > Date: Sat, 03 Jun 2023 10:41:15 -0400 > > Eli Zaretskii writes: > > > Please be specific. For example, "grep" runs in an async subprocess; > > we run it with call-process when we probe it for support of some > > command-line option. If you can show that these calls take "prolonged > > period of time", please describe what you do and show the timing. > > No, I mean "grep" called specifically by call-process. As, for example, > I see happening in mh-grep-execute-search and nnspool-find-id. In the > former case, it's a recursive grep which could take many seconds. > > Or as I already mentioned: xref-matches-in-files (used by > project-find-regexp, C-x p g) uses call-process-region to run recursive > grep in an arbitrary directory. Which could easily take minutes. I hope the respective developers will consider whether it is reasonably feasible to make those features non-blocking. > These are understandable designs, and I'm not too bothered by the fact > that they block Emacs. But this becomes much worse when they are also > blocking other applications because of this X selection bug. Only the buggy ones, let's not forget. The non-buggy ones could wait without blocking, just like you expect Emacs to do. > > AFAIU, the only "everything" that is blocked is an application that > > happens to request an X selection at that precise time. That should > > be rare for short enough call-process runs, since the same user is > > doing that. > > No, as I mentioned earlier, some (buggy, of course) applications > frequently request the X selection; such as Slack (and possibly all > other Electron applications too). Such applications just immediately > hang during the entire call-process run without any user interaction. It is unreasonable to expect Emacs to solve bugs in other applications. We are having hard time to solve our own. > I would be happy with a targeted, specific fix for the bad behavior I > reported. > > Here's a specific instance that would be good to fix: If I run "M-! > sleep 30 RET", that will cause some applications to hang while Emacs is > waiting on the sleep; sometimes (as with Slack) without user > interaction, or sometimes only if the user tries to paste in them. Do > you have a suggestion on how to fix that? No, I don't. And I explained why at the very beginning. I invite you to read xselect.c and see what kind of processing we do there to handle selection requests.