Compare commits
67 Commits
Author | SHA256 | Date | |
---|---|---|---|
a72fbb2e42 | |||
fc5a0a0a34 | |||
e93921811b | |||
1842082a57 | |||
ba1ba5e441 | |||
0d7ada46c3 | |||
560dddf812 | |||
c7e7330c19 | |||
68aa7eecfc | |||
0546611d0c | |||
57eee1cbd7 | |||
dc4797f7af | |||
ad0f0e7ab2 | |||
46b5284742 | |||
90602b0885 | |||
c0042219da | |||
f138d31d05 | |||
f33b905370 | |||
7a657f6c9c | |||
4eaf577c51 | |||
42640d1d9a | |||
800403b1b5 | |||
3c9d19195c | |||
6cbc8edd2d | |||
e6d90383d2 | |||
8c18ef0c11 | |||
59ba07dd30 | |||
87ad255f8d | |||
3045293718 | |||
8ba7e39f5f | |||
6b5d342911 | |||
16c6d74b3d | |||
49b583463b | |||
cb93fe3d34 | |||
|
98ce79d82e | ||
c7560583b0 | |||
|
0847817a33 | ||
f1b425638d | |||
|
a3fdc6f856 | ||
49b7fe1d27 | |||
|
3671b52f34 | ||
a8a00ffad1 | |||
|
40cdad45a3 | ||
|
36b3e8a712 | ||
|
0457c69ff9 | ||
|
fb28934278 | ||
|
08d927a87b | ||
|
8e1cc9f85a | ||
|
72003589d4 | ||
|
3efb3827e9 | ||
|
7ab62bc4f9 | ||
|
b700da6105 | ||
|
c4249be723 | ||
|
e8b868793e | ||
|
0a2cf593e6 | ||
|
f7f1269cce | ||
|
bb528972b6 | ||
|
de193f2dc8 | ||
|
4ef31b0050 | ||
|
4b2be49a6e | ||
|
c7164d2396 | ||
|
aee7c5b803 | ||
|
bd1839a801 | ||
|
b392cdf415 | ||
|
35c9262cba | ||
|
b24b887177 | ||
|
7286da4f52 |
@@ -1,122 +0,0 @@
|
||||
From f9e2b20a12a230efa30f1d479563ae07d276a94b Mon Sep 17 00:00:00 2001
|
||||
From: Paul Eggert <eggert@cs.ucla.edu>
|
||||
Date: Wed, 30 Sep 2020 13:50:36 -0700
|
||||
Subject: [PATCH] c-stack: stop using SIGSTKSZ
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
It’s been proposed to stop making SIGSTKSZ an integer constant:
|
||||
https://sourceware.org/pipermail/libc-alpha/2020-September/118028.html
|
||||
Also, using SIGSTKSZ in #if did not conform to current POSIX.
|
||||
Also, avoiding SIGSTKSZ makes the code simpler and easier to grok.
|
||||
* lib/c-stack.c (SIGSTKSZ): Remove.
|
||||
(alternate_signal_stack): Now a 64 KiB array, for simplicity.
|
||||
All uses changed.
|
||||
---
|
||||
ChangeLog | 9 +++++++++
|
||||
lib/c-stack.c | 42 ++++++++++++++++++------------------------
|
||||
lib/c-stack.h | 2 +-
|
||||
3 files changed, 28 insertions(+), 25 deletions(-)
|
||||
|
||||
Index: m4-1.4.18/lib/c-stack.c
|
||||
===================================================================
|
||||
--- m4-1.4.18.orig/lib/c-stack.c
|
||||
+++ m4-1.4.18/lib/c-stack.c
|
||||
@@ -50,15 +50,6 @@
|
||||
#if ! HAVE_STACK_T && ! defined stack_t
|
||||
typedef struct sigaltstack stack_t;
|
||||
#endif
|
||||
-#ifndef SIGSTKSZ
|
||||
-# define SIGSTKSZ 16384
|
||||
-#elif HAVE_LIBSIGSEGV && SIGSTKSZ < 16384
|
||||
-/* libsigsegv 2.6 through 2.8 have a bug where some architectures use
|
||||
- more than the Linux default of an 8k alternate stack when deciding
|
||||
- if a fault was caused by stack overflow. */
|
||||
-# undef SIGSTKSZ
|
||||
-# define SIGSTKSZ 16384
|
||||
-#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -89,6 +80,16 @@ typedef struct sigaltstack stack_t;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
+/* Storage for the alternate signal stack.
|
||||
+ 64 KiB is not too large for Gnulib-using apps, 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 alternate_signal_stack[(64 * 1024
|
||||
+ + sizeof (max_align_t) - 1)
|
||||
+ / sizeof (max_align_t)];
|
||||
+
|
||||
/* The user-specified action to take when a SEGV-related program error
|
||||
or stack overflow occurs. */
|
||||
static void (* volatile segv_action) (int);
|
||||
@@ -128,19 +129,6 @@ die (int signo)
|
||||
#if (HAVE_SIGALTSTACK && HAVE_DECL_SIGALTSTACK \
|
||||
&& HAVE_STACK_OVERFLOW_HANDLING) || HAVE_LIBSIGSEGV
|
||||
|
||||
-/* Storage for the alternate signal stack. */
|
||||
-static union
|
||||
-{
|
||||
- char buffer[SIGSTKSZ];
|
||||
-
|
||||
- /* These other members are for proper alignment. There's no
|
||||
- standard way to guarantee stack alignment, but this seems enough
|
||||
- in practice. */
|
||||
- long double ld;
|
||||
- long l;
|
||||
- void *p;
|
||||
-} alternate_signal_stack;
|
||||
-
|
||||
static void
|
||||
null_action (int signo __attribute__ ((unused)))
|
||||
{
|
||||
@@ -205,8 +193,8 @@ c_stack_action (void (*action) (int))
|
||||
|
||||
/* Always install the overflow handler. */
|
||||
if (stackoverflow_install_handler (overflow_handler,
|
||||
- alternate_signal_stack.buffer,
|
||||
- sizeof alternate_signal_stack.buffer))
|
||||
+ alternate_signal_stack,
|
||||
+ sizeof alternate_signal_stack))
|
||||
{
|
||||
errno = ENOTSUP;
|
||||
return -1;
|
||||
@@ -279,14 +267,14 @@ c_stack_action (void (*action) (int))
|
||||
stack_t st;
|
||||
struct sigaction act;
|
||||
st.ss_flags = 0;
|
||||
+ st.ss_sp = alternate_signal_stack;
|
||||
+ st.ss_size = sizeof alternate_signal_stack;
|
||||
# if SIGALTSTACK_SS_REVERSED
|
||||
/* Irix mistakenly treats ss_sp as the upper bound, rather than
|
||||
lower bound, of the alternate stack. */
|
||||
- st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ - sizeof (void *);
|
||||
- st.ss_size = sizeof alternate_signal_stack.buffer - sizeof (void *);
|
||||
-# else
|
||||
- st.ss_sp = alternate_signal_stack.buffer;
|
||||
- st.ss_size = sizeof alternate_signal_stack.buffer;
|
||||
+ st.ss_size -= sizeof (void *);
|
||||
+ char *ss_sp = st.ss_sp;
|
||||
+ st.ss_sp = ss_sp + st.ss_size;
|
||||
# endif
|
||||
r = sigaltstack (&st, NULL);
|
||||
if (r != 0)
|
||||
Index: m4-1.4.18/lib/c-stack.h
|
||||
===================================================================
|
||||
--- m4-1.4.18.orig/lib/c-stack.h
|
||||
+++ m4-1.4.18/lib/c-stack.h
|
||||
@@ -34,7 +34,7 @@
|
||||
A null ACTION acts like an action that does nothing.
|
||||
|
||||
ACTION must be async-signal-safe. ACTION together with its callees
|
||||
- must not require more than SIGSTKSZ bytes of stack space. Also,
|
||||
+ must not require more than 64 KiB of stack space. Also,
|
||||
ACTION should not call longjmp, because this implementation does
|
||||
not guarantee that it is safe to return to the original stack.
|
||||
|
@@ -1,145 +0,0 @@
|
||||
2018-03-05 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
fflush: adjust to glibc 2.28 libio.h removal
|
||||
Problem reported by Daniel P. Berrangé in:
|
||||
https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
|
||||
* lib/fbufmode.c (fbufmode):
|
||||
* lib/fflush.c (clear_ungetc_buffer_preserving_position)
|
||||
(disable_seek_optimization, rpl_fflush):
|
||||
* lib/fpending.c (__fpending):
|
||||
* lib/fpurge.c (fpurge):
|
||||
* lib/freadable.c (freadable):
|
||||
* lib/freadahead.c (freadahead):
|
||||
* lib/freading.c (freading):
|
||||
* lib/freadptr.c (freadptr):
|
||||
* lib/freadseek.c (freadptrinc):
|
||||
* lib/fseeko.c (fseeko):
|
||||
* lib/fseterr.c (fseterr):
|
||||
* lib/fwritable.c (fwritable):
|
||||
* lib/fwriting.c (fwriting):
|
||||
Check _IO_EOF_SEEN instead of _IO_ftrylockfile.
|
||||
* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]:
|
||||
Define if not already defined.
|
||||
|
||||
Index: m4-1.4.18/lib/fflush.c
|
||||
===================================================================
|
||||
--- m4-1.4.18.orig/lib/fflush.c
|
||||
+++ m4-1.4.18/lib/fflush.c
|
||||
@@ -33,7 +33,7 @@
|
||||
#undef fflush
|
||||
|
||||
|
||||
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
|
||||
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
|
||||
|
||||
/* Clear the stream's ungetc buffer, preserving the value of ftello (fp). */
|
||||
static void
|
||||
@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
|
||||
|
||||
#endif
|
||||
|
||||
-#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
|
||||
+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
|
||||
|
||||
# if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
|
||||
/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
|
||||
@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
|
||||
if (stream == NULL || ! freading (stream))
|
||||
return fflush (stream);
|
||||
|
||||
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
|
||||
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
|
||||
|
||||
clear_ungetc_buffer_preserving_position (stream);
|
||||
|
||||
Index: m4-1.4.18/lib/fpending.c
|
||||
===================================================================
|
||||
--- m4-1.4.18.orig/lib/fpending.c
|
||||
+++ m4-1.4.18/lib/fpending.c
|
||||
@@ -32,7 +32,7 @@ __fpending (FILE *fp)
|
||||
/* Most systems provide FILE as a struct and the necessary bitmask in
|
||||
<stdio.h>, because they need it for implementing getc() and putc() as
|
||||
fast macros. */
|
||||
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
|
||||
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
|
||||
return fp->_IO_write_ptr - fp->_IO_write_base;
|
||||
#elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
|
||||
/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
|
||||
Index: m4-1.4.18/lib/fpurge.c
|
||||
===================================================================
|
||||
--- m4-1.4.18.orig/lib/fpurge.c
|
||||
+++ m4-1.4.18/lib/fpurge.c
|
||||
@@ -62,7 +62,7 @@ fpurge (FILE *fp)
|
||||
/* Most systems provide FILE as a struct and the necessary bitmask in
|
||||
<stdio.h>, because they need it for implementing getc() and putc() as
|
||||
fast macros. */
|
||||
-# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
|
||||
+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
|
||||
fp->_IO_read_end = fp->_IO_read_ptr;
|
||||
fp->_IO_write_ptr = fp->_IO_write_base;
|
||||
/* Avoid memory leak when there is an active ungetc buffer. */
|
||||
Index: m4-1.4.18/lib/freadahead.c
|
||||
===================================================================
|
||||
--- m4-1.4.18.orig/lib/freadahead.c
|
||||
+++ m4-1.4.18/lib/freadahead.c
|
||||
@@ -25,7 +25,7 @@
|
||||
size_t
|
||||
freadahead (FILE *fp)
|
||||
{
|
||||
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
|
||||
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
|
||||
if (fp->_IO_write_ptr > fp->_IO_write_base)
|
||||
return 0;
|
||||
return (fp->_IO_read_end - fp->_IO_read_ptr)
|
||||
Index: m4-1.4.18/lib/freading.c
|
||||
===================================================================
|
||||
--- m4-1.4.18.orig/lib/freading.c
|
||||
+++ m4-1.4.18/lib/freading.c
|
||||
@@ -31,7 +31,7 @@ freading (FILE *fp)
|
||||
/* Most systems provide FILE as a struct and the necessary bitmask in
|
||||
<stdio.h>, because they need it for implementing getc() and putc() as
|
||||
fast macros. */
|
||||
-# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
|
||||
+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
|
||||
return ((fp->_flags & _IO_NO_WRITES) != 0
|
||||
|| ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
|
||||
&& fp->_IO_read_base != NULL));
|
||||
Index: m4-1.4.18/lib/fseeko.c
|
||||
===================================================================
|
||||
--- m4-1.4.18.orig/lib/fseeko.c
|
||||
+++ m4-1.4.18/lib/fseeko.c
|
||||
@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int when
|
||||
#endif
|
||||
|
||||
/* These tests are based on fpurge.c. */
|
||||
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
|
||||
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
|
||||
if (fp->_IO_read_end == fp->_IO_read_ptr
|
||||
&& fp->_IO_write_ptr == fp->_IO_write_base
|
||||
&& fp->_IO_save_base == NULL)
|
||||
@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int when
|
||||
return -1;
|
||||
}
|
||||
|
||||
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
|
||||
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
|
||||
fp->_flags &= ~_IO_EOF_SEEN;
|
||||
fp->_offset = pos;
|
||||
#elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
|
||||
Index: m4-1.4.18/lib/stdio-impl.h
|
||||
===================================================================
|
||||
--- m4-1.4.18.orig/lib/stdio-impl.h
|
||||
+++ m4-1.4.18/lib/stdio-impl.h
|
||||
@@ -18,6 +18,12 @@
|
||||
the same implementation of stdio extension API, except that some fields
|
||||
have different naming conventions, or their access requires some casts. */
|
||||
|
||||
+/* Glibc 2.28 made _IO_IN_BACKUP private. For now, work around this
|
||||
+ problem by defining it ourselves. FIXME: Do not rely on glibc
|
||||
+ internals. */
|
||||
+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
|
||||
+# define _IO_IN_BACKUP 0x100
|
||||
+#endif
|
||||
|
||||
/* BSD stdio derived implementations. */
|
||||
|
BIN
m4-1.4.18.tar.xz
(Stored with Git LFS)
BIN
m4-1.4.18.tar.xz
(Stored with Git LFS)
Binary file not shown.
@@ -1,11 +0,0 @@
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
|
||||
|
||||
iQEcBAABCAAGBQJYaDOKAAoJEKeha0olJ0NqT5oH/jyPC2chKyoCSrBAAmMT/0ac
|
||||
xbDOiymNbaj6twhoZNunE8m8OzySfBQxANFf0yepZ0dCPf8/SzCWt9eHs12xzTrs
|
||||
htcrsXBJ0woVdSG1SVaCzeOna8dvQ5fRJUHdWqTCa8sJdEBNk/zh2i72wGzMtpLo
|
||||
Ord+dXOplvRe+LTUyu7eMAQfccPb5PnL4sh6WgmvQpjUiP4y2BlpbcI7hU1OOPNz
|
||||
Gq63o3sO8OkwB2LP//M3fyi6Y4CHa7V6mfYz0PDboks1UruNYclbwVuJ8tLMYae+
|
||||
YlRMuMCs1hssICNcMyhtks8jdbXlMm7E8Nhk2+Uc6eRnA97zZQ0ADthNjA47/TA=
|
||||
=TQTI
|
||||
-----END PGP SIGNATURE-----
|
Reference in New Issue
Block a user