Package: emacs24 Version: 24.4+1-5 Severity: normal Tags: upstream patch Dear Maintainer,
Emacs 24.4 and 24.5 suffer from a signal-handling bug which can cause X11 Emacs to hang during a paste/yank operation. This was reported as an Emacs bug at http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16737 and eventually fixed on both master(0592cefd03f1de2f04b721d07a16e6e0a9e48f73) and the emacs-24 branch (a27ae9d7650a1230d4359eaf0a949f827315a6d2). I've been running with emacs24 24.4+1-5 (from Jessie) with a27ae9d7650a1230d4359eaf0a949f827315a6d2 (attached) applied for a month now and the bug seems to be well and truly fixed. It seems unlikely that there will be another upstream emacs-24 release. Is there any chance that you could apply this fix for Stretch and then potentially as a stable update for Jessie? Thanks. Mike. -- System Information: Debian Release: 8.1 APT prefers stable APT policy: (990, 'stable'), (500, 'unstable') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores) Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Init: systemd (via /run/systemd/system) Versions of packages emacs24 depends on: ii emacs24-bin-common 24.4+1-5 ii gconf-service 3.2.6-3 ii libacl1 2.2.52-2 ii libasound2 1.0.28-1 ii libatk1.0-0 2.14.0-1 ii libc6 2.19-18 ii libcairo-gobject2 1.14.0-2.1 ii libcairo2 1.14.0-2.1 ii libdbus-1-3 1.8.18-0+deb8u1 ii libfontconfig1 2.11.0-6.3 ii libfreetype6 2.5.2-3 ii libgconf-2-4 3.2.6-3 ii libgdk-pixbuf2.0-0 2.31.1-2+b1 ii libgif4 4.1.6-11 ii libglib2.0-0 2.42.1-1 ii libgnutls-deb0-28 3.3.8-6+deb8u2 ii libgomp1 4.9.2-10 ii libgpm2 1.20.4-6.1+b2 ii libgtk-3-0 3.14.5-1 ii libice6 2:1.0.9-1+b1 ii libjpeg62-turbo 1:1.3.1-12 ii libm17n-0 1.6.4-3 ii libmagickcore-6.q16-2 8:6.8.9.9-5 ii libmagickwand-6.q16-2 8:6.8.9.9-5 ii libotf0 0.9.13-2 ii libpango-1.0-0 1.36.8-3 ii libpangocairo-1.0-0 1.36.8-3 ii libpng12-0 1.2.50-2+b2 ii librsvg2-2 2.40.5-1 ii libselinux1 2.3-2 ii libsm6 2:1.2.2-1+b1 ii libtiff5 4.0.3-12.3 ii libtinfo5 5.9+20140913-1+b1 ii libx11-6 2:1.6.2-3 ii libxft2 2.3.2-1 ii libxinerama1 2:1.1.3-1+b1 ii libxml2 2.9.1+dfsg1-5 ii libxpm4 1:3.5.11-1+b1 ii libxrandr2 2:1.4.2-1+b1 ii libxrender1 1:0.9.8-1+b1 ii zlib1g 1:1.2.8.dfsg-2+b1 emacs24 recommends no packages. Versions of packages emacs24 suggests: pn emacs24-common-non-dfsg <none>
commit a27ae9d7650a1230d4359eaf0a949f827315a6d2 Author: Paul Eggert <[email protected]> Date: Fri Jul 17 11:54:24 2015 -0700 Fix hang with large yanks Backport of master commit 0592cefd03f1de2f04b721d07a16e6e0a9e48f73. 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. diff --git a/src/dispextern.h b/src/dispextern.h index 239c442..cf3d1ec 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -3349,7 +3349,6 @@ void unrequest_sigio (void); bool tabs_safe_p (int); void init_baud_rate (int); void init_sigio (int); -void ignore_sigio (void); /* Defined in xfaces.c. */ diff --git a/src/emacs.c b/src/emacs.c index 9b78a70..b5d3ab4 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -2028,7 +2028,6 @@ shut_down_emacs (int sig, Lisp_Object stuff) /* There is a tendency for a SIGIO signal to arrive within exit, and cause a SIGHUP because the input descriptor is already closed. */ unrequest_sigio (); - ignore_sigio (); /* Do this only if terminating normally, we want glyph matrices etc. in a core dump. */ diff --git a/src/keyboard.c b/src/keyboard.c index 945019e..77af44a 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -3663,8 +3663,7 @@ kbd_buffer_store_event_hold (register struct input_event *event, /* Don't read keyboard input until we have processed kbd_buffer. This happens when pasting text longer than KBD_BUFFER_SIZE/2. */ hold_keyboard_input (); - if (!noninteractive) - ignore_sigio (); + unrequest_sigio (); stop_polling (); } #endif /* subprocesses */ @@ -3829,6 +3828,7 @@ kbd_buffer_get_event (KBOARD **kbp, /* Start reading input again because we have processed enough to be able to accept new events again. */ unhold_keyboard_input (); + request_sigio (); start_polling (); } #endif /* subprocesses */ diff --git a/src/sysdep.c b/src/sysdep.c index 01692c2..4b4801d 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -649,15 +649,6 @@ unrequest_sigio (void) interrupts_deferred = 1; #endif } - -void -ignore_sigio (void) -{ -#ifdef USABLE_SIGIO - signal (SIGIO, SIG_IGN); -#endif -} - /* Saving and restoring the process group of Emacs's terminal. */

