GNU bug report logs - #11049
24.0.93; SIGABRT when closing terminal, emacs running in TTY mode

Previous Next

Package: emacs;

Reported by: Rotem <vmalloc <at> gmail.com>

Date: Tue, 20 Mar 2012 16:45:02 UTC

Severity: normal

Tags: confirmed, patch

Merged with 22008

Found in versions 24.0.93, 25.1

Done: Alan Third <alan <at> idiocy.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Alan Third <alan <at> idiocy.org>
To: 11049 <at> debbugs.gnu.org
Subject: bug#11049: [PATCH] Prevent NS event loop being re-entered (bug#11049)
Date: Sun, 26 Jun 2016 01:42:59 +0100
* nsterm.m (ns_read_socket, ns_select): Return -1 if already in event
loop instead of aborting.
---
 src/nsterm.m | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/nsterm.m b/src/nsterm.m
index eba75f1..60c0da8 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -4094,6 +4094,9 @@ in certain situations (rapid incoming events).
 
   NSTRACE_WHEN (NSTRACE_GROUP_EVENTS, "ns_read_socket");
 
+  if (apploopnr > 0)
+    return -1; /* Already within event loop. */
+
 #ifdef HAVE_NATIVE_FS
   check_native_fs ();
 #endif
@@ -4178,6 +4181,9 @@ in certain situations (rapid incoming events).
 
   NSTRACE_WHEN (NSTRACE_GROUP_EVENTS, "ns_select");
 
+  if (apploopnr > 0)
+    return -1; /* Already within event loop. */
+
 #ifdef HAVE_NATIVE_FS
   check_native_fs ();
 #endif
-- 
I'm happier with this one. There's already a mechanism available to
say that we can't process input just now, just return -1. This seems
neater than sending SIGABRT. I thought I could perhaps lose the
emacs_abort further down in both functions, but presumably the
function can be pre-empted between the check and ++apploopnr, which
could be a problem, so I just left it in.

-- 
Alan Third




This bug report was last modified 8 years and 324 days ago.

Previous Next


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