aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2021-03-09 11:22:59 -0800
committerPaul Eggert2021-03-09 11:26:33 -0800
commitf97e07ea807cc6d38774a3888a15091b20645ac6 (patch)
treee7efa82c5616fdc1bf240c7c0ae393b80cc564dc /src
parentc6ed17cc70ee49250f7d3999bb56918f0e925757 (diff)
downloademacs-f97e07ea807cc6d38774a3888a15091b20645ac6.tar.gz
emacs-f97e07ea807cc6d38774a3888a15091b20645ac6.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/sysdep.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/sysdep.c b/src/sysdep.c
index 941b4e2fa24..24d8832b2f3 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -1785,7 +1785,15 @@ handle_arith_signal (int sig)
1785 1785
1786/* Alternate stack used by SIGSEGV handler below. */ 1786/* Alternate stack used by SIGSEGV handler below. */
1787 1787
1788static unsigned char sigsegv_stack[SIGSTKSZ]; 1788/* Storage for the alternate signal stack.
1789 64 KiB is not too large for Emacs, and is large enough
1790 for all known platforms. Smaller sizes may run into trouble.
1791 For example, libsigsegv 2.6 through 2.8 have a bug where some
1792 architectures use more than the Linux default of an 8 KiB alternate
1793 stack when deciding if a fault was caused by stack overflow. */
1794static max_align_t sigsegv_stack[(64 * 1024
1795 + sizeof (max_align_t) - 1)
1796 / sizeof (max_align_t)];
1789 1797
1790 1798
1791/* Return true if SIGINFO indicates a stack overflow. */ 1799/* Return true if SIGINFO indicates a stack overflow. */