GNU bug report logs -
#63865
29.0.90; call-process while owning the X selection hangs other processes
Previous Next
Full log
Message #50 received at 63865 <at> debbugs.gnu.org (full text, mbox):
> From: Spencer Baugh <sbaugh <at> janestreet.com>
> Cc: luangruo <at> yahoo.com, 63865 <at> debbugs.gnu.org
> Date: Sat, 03 Jun 2023 10:41:15 -0400
>
> Eli Zaretskii <eliz <at> 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.
This bug report was last modified 1 year and 357 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.