aboutsummaryrefslogtreecommitdiffstats
path: root/src/sysdep.c
diff options
context:
space:
mode:
authorPaul Eggert2021-03-09 11:22:59 -0800
committerStefan Kangas2022-07-15 14:03:06 +0200
commite0677de7f3f222ea42977e718601b2a2abaf71b6 (patch)
treeae66fd426309cc5410c6ede6adeefdeccbd95f9d /src/sysdep.c
parentc3ff6712ad24fcf45874dc0665a8606e9b2208a4 (diff)
downloademacs-e0677de7f3f222ea42977e718601b2a2abaf71b6.tar.gz
emacs-e0677de7f3f222ea42977e718601b2a2abaf71b6.zip
Port alternate signal stack to upcoming glibc 2.34emacs-25
* 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)
Diffstat (limited to 'src/sysdep.c')
-rw-r--r--src/sysdep.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/sysdep.c b/src/sysdep.c
index 2c80280bc74..fa41ed70c86 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -1624,7 +1624,15 @@ handle_arith_signal (int sig)
1624 1624
1625/* Alternate stack used by SIGSEGV handler below. */ 1625/* Alternate stack used by SIGSEGV handler below. */
1626 1626
1627static unsigned char sigsegv_stack[SIGSTKSZ]; 1627/* Storage for the alternate signal stack.
1628 64 KiB is not too large for Emacs, and is large enough
1629 for all known platforms. Smaller sizes may run into trouble.
1630 For example, libsigsegv 2.6 through 2.8 have a bug where some
1631 architectures use more than the Linux default of an 8 KiB alternate
1632 stack when deciding if a fault was caused by stack overflow. */
1633static max_align_t sigsegv_stack[(64 * 1024
1634 + sizeof (max_align_t) - 1)
1635 / sizeof (max_align_t)];
1628 1636
1629 1637
1630/* Return true if SIGINFO indicates a stack overflow. */ 1638/* Return true if SIGINFO indicates a stack overflow. */