From ddc319e7fae046d9cef37752ff8b2c7f72257d5f Mon Sep 17 00:00:00 2001 From: Ian Beckwith Date: Sat, 23 Oct 2010 23:09:58 +0100 Subject: [PATCH] c-stack: work around libsigsegv 2.8 bug * lib/c-stack.c (SIGSTKSZ): Increase size to avoid alternate stack overflow on at least PowerPC64. Signed-off-by: Eric Blake (cherry picked from commit b86f488e783121f54dbd44e17741fa3b29e9be9b) --- ChangeLog | 6 ++++++ NEWS.stable | 1 + lib/c-stack.c | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/ChangeLog b/ChangeLog index fdb1dde78..5cec4fbf6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-10-21 Eric Blake + + c-stack: work around libsigsegv 2.8 bug + * lib/c-stack.c (SIGSTKSZ): Increase size to avoid alternate stack + overflow on at least PowerPC64. + 2010-10-16 Bruno Haible nextafter: Fix configure check. diff --git a/NEWS.stable b/NEWS.stable index 99571ad3e..34d39d4aa 100644 --- a/NEWS.stable +++ b/NEWS.stable @@ -18,6 +18,7 @@ with the following additional commits: * [61241ea]->[25d72f8] termios: Update documentation. * [94617c2]->[a964f9e] Fix date in ChangeLog. * [3f75f63]->[7966020] nextafter: Fix configure check. + * [b86f488]->[] c-stack: work around libsigsegv 2.8 bug __NEXTCOMMITMARKER__ ---------------------------------------------------------------------- diff --git a/lib/c-stack.c b/lib/c-stack.c index 46575489d..0cf6b052d 100644 --- a/lib/c-stack.c +++ b/lib/c-stack.c @@ -53,6 +53,12 @@ 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 -- 2.11.0