diff options
| author | Paul Eggert | 2021-03-09 11:22:59 -0800 |
|---|---|---|
| committer | Stefan Kangas | 2022-07-15 13:56:20 +0200 |
| commit | a6632fee28d5c0befa192c92692e4204656a29a0 (patch) | |
| tree | 7293091063094bcc0985284c45b4a46fc1e6ca16 | |
| parent | 7497ee44b471f69ce59d131a6dece261e871534f (diff) | |
| download | emacs-26.tar.gz emacs-26.zip | |
Port alternate signal stack to upcoming glibc 2.34emacs-26
* 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)
| -rw-r--r-- | src/sysdep.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/sysdep.c b/src/sysdep.c index b2aecc0ddac..1f7f02cb003 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -1792,7 +1792,15 @@ handle_arith_signal (int sig) | |||
| 1792 | 1792 | ||
| 1793 | /* Alternate stack used by SIGSEGV handler below. */ | 1793 | /* Alternate stack used by SIGSEGV handler below. */ |
| 1794 | 1794 | ||
| 1795 | static unsigned char sigsegv_stack[SIGSTKSZ]; | 1795 | /* Storage for the alternate signal stack. |
| 1796 | 64 KiB is not too large for Emacs, and is large enough | ||
| 1797 | for all known platforms. Smaller sizes may run into trouble. | ||
| 1798 | For example, libsigsegv 2.6 through 2.8 have a bug where some | ||
| 1799 | architectures use more than the Linux default of an 8 KiB alternate | ||
| 1800 | stack when deciding if a fault was caused by stack overflow. */ | ||
| 1801 | static max_align_t sigsegv_stack[(64 * 1024 | ||
| 1802 | + sizeof (max_align_t) - 1) | ||
| 1803 | / sizeof (max_align_t)]; | ||
| 1796 | 1804 | ||
| 1797 | 1805 | ||
| 1798 | /* Return true if SIGINFO indicates a stack overflow. */ | 1806 | /* Return true if SIGINFO indicates a stack overflow. */ |