GNU bug report logs - #51820
29.0.50; process_pending_signals is almost useless without SIGIO

Previous Next

Package: emacs;

Reported by: Ken Brown <kbrown <at> cornell.edu>

Date: Sat, 13 Nov 2021 23:10:02 UTC

Severity: normal

Found in version 29.0.50

Done: Ken Brown <kbrown <at> cornell.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 51820 in the body.
You can then email your comments to 51820 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to eggert <at> cs.ucla.edu, bug-gnu-emacs <at> gnu.org:
bug#51820; Package emacs. (Sat, 13 Nov 2021 23:10:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ken Brown <kbrown <at> cornell.edu>:
New bug report received and forwarded. Copy sent to eggert <at> cs.ucla.edu, bug-gnu-emacs <at> gnu.org. (Sat, 13 Nov 2021 23:10:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ken Brown <kbrown <at> cornell.edu>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.50; process_pending_signals is almost useless without SIGIO
Date: Sat, 13 Nov 2021 17:49:59 -0500
I might be missing something, but it seems to me that the main purpose of 
process_pending_signals is to read input in case the user typed C-g.  This is in 
fact done on systems with SIGIO, via a call to handle_async_input.  But 
handle_async_input is a NOOP on systems without SIGIO.  This has been the case 
since the following commit:

commit 4d7e6e51dd4acecff466a28d958c50f34fc130b8
Author: Paul Eggert <eggert <at> cs.ucla.edu>
Date:   Sun Sep 23 01:44:20 2012 -0700

    Simplify and avoid signal-handling races.
[...]
    Fixes: debbugs:12471

I can't find anything in the commit message or in the discussion of Bug#12471 
that explains this.  Paul, I realize that the commit was 9 years ago, but do you 
remember why you made this change?

On systems without SIGIO, an atimer "poll_timer" is created that fires every 2 
seconds.  This causes pending_signals to be set, which has practically no effect 
AFAICT.  The only thing I see that poll_timer accomplishes is that if emacs 
happens to be in the select call in wait_reading_process_output when the timer 
fires, then select will return.

Ken




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51820; Package emacs. (Sat, 13 Nov 2021 23:13:01 GMT) Full text and rfc822 format available.

Message #8 received at 51820 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Ken Brown <kbrown <at> cornell.edu>
Cc: 51820 <at> debbugs.gnu.org
Subject: Re: bug#51820: 29.0.50; process_pending_signals is almost useless
 without SIGIO
Date: Sat, 13 Nov 2021 15:12:46 -0800
As I vaguely recall, every system using this code has SIGIO nowadays. It 
sounds like we should assume SIGIO here, and simplify the code 
accordingly, so as to avoid confusion in the future.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51820; Package emacs. (Sat, 13 Nov 2021 23:18:02 GMT) Full text and rfc822 format available.

Message #11 received at 51820 <at> debbugs.gnu.org (full text, mbox):

From: Ken Brown <kbrown <at> cornell.edu>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 51820 <at> debbugs.gnu.org
Subject: Re: bug#51820: 29.0.50; process_pending_signals is almost useless
 without SIGIO
Date: Sat, 13 Nov 2021 18:17:02 -0500
On 11/13/2021 6:12 PM, Paul Eggert wrote:
> As I vaguely recall, every system using this code has SIGIO nowadays. It sounds 
> like we should assume SIGIO here, and simplify the code accordingly, so as to 
> avoid confusion in the future.

Cygwin uses this code and doesn't have SIGIO.

Ken




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51820; Package emacs. (Sat, 13 Nov 2021 23:19:01 GMT) Full text and rfc822 format available.

Message #14 received at 51820 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Ken Brown <kbrown <at> cornell.edu>
Cc: 51820 <at> debbugs.gnu.org
Subject: Re: bug#51820: 29.0.50; process_pending_signals is almost useless
 without SIGIO
Date: Sat, 13 Nov 2021 15:18:24 -0800
On 11/13/21 15:17, Ken Brown wrote:
> Cygwin uses this code and doesn't have SIGIO.

In that case, perhaps someone using Cygwin (i.e., not me) could look 
into this. Evidently it has not been much of a practical problem all 
these years.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51820; Package emacs. (Sat, 13 Nov 2021 23:27:01 GMT) Full text and rfc822 format available.

Message #17 received at 51820 <at> debbugs.gnu.org (full text, mbox):

From: Ken Brown <kbrown <at> cornell.edu>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 51820 <at> debbugs.gnu.org
Subject: Re: bug#51820: 29.0.50; process_pending_signals is almost useless
 without SIGIO
Date: Sat, 13 Nov 2021 18:25:55 -0500
On 11/13/2021 6:18 PM, Paul Eggert wrote:
> On 11/13/21 15:17, Ken Brown wrote:
>> Cygwin uses this code and doesn't have SIGIO.
> 
> In that case, perhaps someone using Cygwin (i.e., not me) could look into this. 
> Evidently it has not been much of a practical problem all these years.

It's hard to know whether it's been a problem.  Maybe emacs would be more 
responsive to C-g on Cygwin if we removed the #ifdef from handle_async_input. 
My preference would be to try that (on master of course) and see if anything breaks.

Eli, WDYT?

Ken




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51820; Package emacs. (Sun, 14 Nov 2021 02:27:02 GMT) Full text and rfc822 format available.

Message #20 received at 51820 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Ken Brown <kbrown <at> cornell.edu>
Cc: 51820 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>,
 Paul Eggert <eggert <at> cs.ucla.edu>
Subject: Re: bug#51820: 29.0.50; process_pending_signals is almost useless
 without SIGIO
Date: Sun, 14 Nov 2021 03:26:01 +0100
Ken Brown <kbrown <at> cornell.edu> writes:

> It's hard to know whether it's been a problem.  Maybe emacs would be
> more responsive to C-g on Cygwin if we removed the #ifdef from
> handle_async_input. My preference would be to try that (on master of
> course) and see if anything breaks.

Also see bug#50043 -- there's other stuff that also doesn't work very
well without SIGIO.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51820; Package emacs. (Sun, 14 Nov 2021 06:49:02 GMT) Full text and rfc822 format available.

Message #23 received at 51820 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ken Brown <kbrown <at> cornell.edu>
Cc: 51820 <at> debbugs.gnu.org, eggert <at> cs.ucla.edu
Subject: Re: bug#51820: 29.0.50; process_pending_signals is almost useless
 without SIGIO
Date: Sun, 14 Nov 2021 08:47:45 +0200
> Date: Sat, 13 Nov 2021 18:25:55 -0500
> Cc: 51820 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
> From: Ken Brown <kbrown <at> cornell.edu>
> 
> > In that case, perhaps someone using Cygwin (i.e., not me) could look into this. 
> > Evidently it has not been much of a practical problem all these years.
> 
> It's hard to know whether it's been a problem.  Maybe emacs would be more 
> responsive to C-g on Cygwin if we removed the #ifdef from handle_async_input. 
> My preference would be to try that (on master of course) and see if anything breaks.
> 
> Eli, WDYT?

Sure, feel free to install such a change on master.  I don't know how
many Cygwin users track the Emacs master branch, but if there are more
than a couple, perhaps even provide a variable exposed to Lisp that
users could tweak to see the result without rebuilding and without
leaving the session.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51820; Package emacs. (Sun, 14 Nov 2021 16:10:01 GMT) Full text and rfc822 format available.

Message #26 received at 51820 <at> debbugs.gnu.org (full text, mbox):

From: Ken Brown <kbrown <at> cornell.edu>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 51820 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>,
 Paul Eggert <eggert <at> cs.ucla.edu>
Subject: Re: bug#51820: 29.0.50; process_pending_signals is almost useless
 without SIGIO
Date: Sun, 14 Nov 2021 11:09:43 -0500
On 11/13/2021 9:26 PM, Lars Ingebrigtsen wrote:
> Ken Brown <kbrown <at> cornell.edu> writes:
> 
>> It's hard to know whether it's been a problem.  Maybe emacs would be
>> more responsive to C-g on Cygwin if we removed the #ifdef from
>> handle_async_input. My preference would be to try that (on master of
>> course) and see if anything breaks.
> 
> Also see bug#50043 -- there's other stuff that also doesn't work very
> well without SIGIO.

Thanks, I'll take a look.

Ken




Reply sent to Ken Brown <kbrown <at> cornell.edu>:
You have taken responsibility. (Wed, 17 Nov 2021 18:12:01 GMT) Full text and rfc822 format available.

Notification sent to Ken Brown <kbrown <at> cornell.edu>:
bug acknowledged by developer. (Wed, 17 Nov 2021 18:12:01 GMT) Full text and rfc822 format available.

Message #31 received at 51820-done <at> debbugs.gnu.org (full text, mbox):

From: Ken Brown <kbrown <at> cornell.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: eggert <at> cs.ucla.edu, 51820-done <at> debbugs.gnu.org
Subject: Re: bug#51820: 29.0.50; process_pending_signals is almost useless
 without SIGIO
Date: Wed, 17 Nov 2021 13:11:06 -0500
On 11/14/2021 1:48 AM, Eli Zaretskii wrote:
>> Date: Sat, 13 Nov 2021 18:25:55 -0500
>> Cc: 51820 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
>> From: Ken Brown <kbrown <at> cornell.edu>
>>
>>> In that case, perhaps someone using Cygwin (i.e., not me) could look into this.
>>> Evidently it has not been much of a practical problem all these years.
>>
>> It's hard to know whether it's been a problem.  Maybe emacs would be more
>> responsive to C-g on Cygwin if we removed the #ifdef from handle_async_input.
>> My preference would be to try that (on master of course) and see if anything breaks.
>>
>> Eli, WDYT?
> 
> Sure, feel free to install such a change on master.

Done.

> I don't know how
> many Cygwin users track the Emacs master branch, but if there are more
> than a couple, perhaps even provide a variable exposed to Lisp that
> users could tweak to see the result without rebuilding and without
> leaving the session.

Good idea.  I think I'll wait a couple weeks so that I can see how the change 
works myself, as well as to see if anyone notices.  But then I might do that. 
For now I'm closing the bug.

Ken




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 16 Dec 2021 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 93 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.