diff options
| author | Paul Eggert | 2015-07-17 11:54:24 -0700 |
|---|---|---|
| committer | Paul Eggert | 2015-07-17 11:55:02 -0700 |
| commit | 0592cefd03f1de2f04b721d07a16e6e0a9e48f73 (patch) | |
| tree | 1a4f3ee25e0c76efda45b4603039cf289103e925 /src | |
| parent | eed81d277f5f095399611d52b4ff814622d44f1c (diff) | |
| download | emacs-0592cefd03f1de2f04b721d07a16e6e0a9e48f73.tar.gz emacs-0592cefd03f1de2f04b721d07a16e6e0a9e48f73.zip | |
Fix hang with large yanks This should fix the bug fixed by Mike
Crowe's patch in:
https://lists.gnu.org/archive/html/emacs-devel/2015-07/msg00106.html
A problem in this area has been reported by several users; see
Bug#16737, Bug#17101, Bug#17026, Bug#17172, Bug#19320, Bug#20283.
This fix differs from Mike Crowe's patch in that it should avoid a
race condition that could lose SIGIO signals. ignore_sigio dates
back to the 1980s when some platforms couldn't block signals, and
could only ignore them, which led to races when signals arrived
while being ignored. We shouldn't have to worry about those old
platforms now.
* src/dispextern.h, src/sysdep.c (ignore_sigio): Remove.
* src/emacs.c (shut_down_emacs):
Don't call ignore_sigio; unrequest_sigio should suffice.
* src/keyboard.c (kbd_buffer_store_buffered_event):
Use unrequest_sigio, not ignore_sigio.
(kbd_buffer_get_event):
Call request_sigio when getting the ball rolling again.
Diffstat (limited to 'src')
| -rw-r--r-- | src/dispextern.h | 1 | ||||
| -rw-r--r-- | src/emacs.c | 1 | ||||
| -rw-r--r-- | src/keyboard.c | 4 | ||||
| -rw-r--r-- | src/sysdep.c | 8 |
4 files changed, 2 insertions, 12 deletions
diff --git a/src/dispextern.h b/src/dispextern.h index 5202142313a..37ebab04ddf 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -3373,7 +3373,6 @@ void unrequest_sigio (void); | |||
| 3373 | bool tabs_safe_p (int); | 3373 | bool tabs_safe_p (int); |
| 3374 | void init_baud_rate (int); | 3374 | void init_baud_rate (int); |
| 3375 | void init_sigio (int); | 3375 | void init_sigio (int); |
| 3376 | void ignore_sigio (void); | ||
| 3377 | 3376 | ||
| 3378 | /* Defined in xfaces.c. */ | 3377 | /* Defined in xfaces.c. */ |
| 3379 | 3378 | ||
diff --git a/src/emacs.c b/src/emacs.c index aad930633d8..93fb5870247 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -2011,7 +2011,6 @@ shut_down_emacs (int sig, Lisp_Object stuff) | |||
| 2011 | /* There is a tendency for a SIGIO signal to arrive within exit, | 2011 | /* There is a tendency for a SIGIO signal to arrive within exit, |
| 2012 | and cause a SIGHUP because the input descriptor is already closed. */ | 2012 | and cause a SIGHUP because the input descriptor is already closed. */ |
| 2013 | unrequest_sigio (); | 2013 | unrequest_sigio (); |
| 2014 | ignore_sigio (); | ||
| 2015 | 2014 | ||
| 2016 | /* Do this only if terminating normally, we want glyph matrices | 2015 | /* Do this only if terminating normally, we want glyph matrices |
| 2017 | etc. in a core dump. */ | 2016 | etc. in a core dump. */ |
diff --git a/src/keyboard.c b/src/keyboard.c index c5a392f862d..6bd123c6710 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -3649,8 +3649,7 @@ kbd_buffer_store_buffered_event (union buffered_input_event *event, | |||
| 3649 | /* Don't read keyboard input until we have processed kbd_buffer. | 3649 | /* Don't read keyboard input until we have processed kbd_buffer. |
| 3650 | This happens when pasting text longer than KBD_BUFFER_SIZE/2. */ | 3650 | This happens when pasting text longer than KBD_BUFFER_SIZE/2. */ |
| 3651 | hold_keyboard_input (); | 3651 | hold_keyboard_input (); |
| 3652 | if (!noninteractive) | 3652 | unrequest_sigio (); |
| 3653 | ignore_sigio (); | ||
| 3654 | stop_polling (); | 3653 | stop_polling (); |
| 3655 | } | 3654 | } |
| 3656 | #endif /* subprocesses */ | 3655 | #endif /* subprocesses */ |
| @@ -3849,6 +3848,7 @@ kbd_buffer_get_event (KBOARD **kbp, | |||
| 3849 | /* Start reading input again because we have processed enough to | 3848 | /* Start reading input again because we have processed enough to |
| 3850 | be able to accept new events again. */ | 3849 | be able to accept new events again. */ |
| 3851 | unhold_keyboard_input (); | 3850 | unhold_keyboard_input (); |
| 3851 | request_sigio (); | ||
| 3852 | start_polling (); | 3852 | start_polling (); |
| 3853 | } | 3853 | } |
| 3854 | #endif /* subprocesses */ | 3854 | #endif /* subprocesses */ |
diff --git a/src/sysdep.c b/src/sysdep.c index 30a55f11409..df3e573a6ea 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -659,14 +659,6 @@ unrequest_sigio (void) | |||
| 659 | interrupts_deferred = 1; | 659 | interrupts_deferred = 1; |
| 660 | #endif | 660 | #endif |
| 661 | } | 661 | } |
| 662 | |||
| 663 | void | ||
| 664 | ignore_sigio (void) | ||
| 665 | { | ||
| 666 | #ifdef USABLE_SIGIO | ||
| 667 | signal (SIGIO, SIG_IGN); | ||
| 668 | #endif | ||
| 669 | } | ||
| 670 | 662 | ||
| 671 | #ifndef MSDOS | 663 | #ifndef MSDOS |
| 672 | /* Block SIGCHLD. */ | 664 | /* Block SIGCHLD. */ |