emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-27 647a9353a3: Port alternate signal stack to upcoming glibc 2.34


From: Stefan Kangas
Subject: emacs-27 647a9353a3: Port alternate signal stack to upcoming glibc 2.34
Date: Fri, 15 Jul 2022 07:53:50 -0400 (EDT)

branch: emacs-27
commit 647a9353a35bb6f97a8494f1765400f8a34081ea
Author: Paul Eggert <eggert@cs.ucla.edu>
Commit: Stefan Kangas <stefan@marxist.se>

    Port alternate signal stack to upcoming glibc 2.34
    
    * src/sysdep.c (sigsegv_stack): Increase size to 64 KiB and align
    it to max_align_t.  This copies from Gnulib’s c-stack.c, and works
    around a portability bug in draft glibc 2.34, which no longer
    defines SIGSTKSZ when _GNU_SOURCE is defined.
    
    (cherry picked from commit f97e07ea807cc6d38774a3888a15091b20645ac6)
---
 src/sysdep.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/sysdep.c b/src/sysdep.c
index d100a5cb50..f0b97767ba 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -1818,7 +1818,15 @@ handle_arith_signal (int sig)
 
 /* Alternate stack used by SIGSEGV handler below.  */
 
-static unsigned char sigsegv_stack[SIGSTKSZ];
+/* Storage for the alternate signal stack.
+   64 KiB is not too large for Emacs, and is large enough
+   for all known platforms.  Smaller sizes may run into trouble.
+   For example, libsigsegv 2.6 through 2.8 have a bug where some
+   architectures use more than the Linux default of an 8 KiB alternate
+   stack when deciding if a fault was caused by stack overflow.  */
+static max_align_t sigsegv_stack[(64 * 1024
+                                 + sizeof (max_align_t) - 1)
+                                / sizeof (max_align_t)];
 
 
 /* Return true if SIGINFO indicates a stack overflow.  */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]