unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Spencer Baugh <sbaugh@janestreet.com>
Cc: luangruo@yahoo.com, 63865@debbugs.gnu.org
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	[thread overview]
Message-ID: <835y848u7s.fsf@gnu.org> (raw)
In-Reply-To: <ier8rd0a9ro.fsf@janestreet.com> (message from Spencer Baugh on Sat, 03 Jun 2023 10:41:15 -0400)

> From: Spencer Baugh <sbaugh@janestreet.com>
> Cc: luangruo@yahoo.com,  63865@debbugs.gnu.org
> Date: Sat, 03 Jun 2023 10:41:15 -0400
> 
> Eli Zaretskii <eliz@gnu.org> 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.





  reply	other threads:[~2023-06-03 15:02 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-03  1:55 bug#63865: 29.0.90; call-process while owning the X selection hangs other processes Spencer Baugh
2023-06-03  6:02 ` Eli Zaretskii
2023-06-03  7:11   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-03  9:12     ` Eli Zaretskii
2023-06-03  9:31       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-03 11:10     ` Spencer Baugh
2023-06-03 11:16       ` Eli Zaretskii
2023-06-03 12:07       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-03 12:30         ` Spencer Baugh
2023-06-03 12:55           ` Eli Zaretskii
2023-06-03 13:10             ` Spencer Baugh
2023-06-03 13:48               ` Eli Zaretskii
2023-06-03 14:12                 ` Spencer Baugh
2023-06-03 14:24                   ` Eli Zaretskii
2023-06-03 14:41                     ` Spencer Baugh
2023-06-03 15:02                       ` Eli Zaretskii [this message]
2023-06-03 15:34                         ` Spencer Baugh
2023-06-03 15:50                           ` Eli Zaretskii
2023-06-04  0:18                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-03 16:21               ` Andreas Schwab
2023-06-03 17:03                 ` Spencer Baugh
2023-06-03 17:07                   ` Eli Zaretskii
2023-06-04  0:15                   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-04  0:13               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-04  0:12           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-23 14:26 ` Spencer Baugh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=835y848u7s.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=63865@debbugs.gnu.org \
    --cc=luangruo@yahoo.com \
    --cc=sbaugh@janestreet.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).