# HG changeset patch # User Bruno Haible # Date 1232802348 -3600 # Node ID ddb65537c2d0c4c4d5970acdfe8f1f48fd02f6e3 # Parent 9902261768561ff97ea36ffe0982135e6194bbb5 On HP-UX, don't pretend it was a SIGSEGV when it was a stack overflow. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-01-24 Bruno Haible + + * lib/c-stack.c (segv_handler): If !HAVE_XSI_STACK_OVERFLOW_HEURISTIC, + set signo = 0 also if info->si_code <= 0. Needed on HP-UX 11.11. + Reported by Gary V. Vaughan . + 2009-01-24 Bruno Haible * lib/c-strtod.h (c_strtod, c_strtold): Add specification. diff --git a/lib/c-stack.c b/lib/c-stack.c --- a/lib/c-stack.c +++ b/lib/c-stack.c @@ -239,21 +239,21 @@ void *context __attribute__ ((unused))) { /* Clear SIGNO if it seems to have been a stack overflow. */ +# if ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC + /* We can't easily determine whether it is a stack overflow; so + assume that the rest of our program is perfect (!) and that + this segmentation violation is a stack overflow. + + Note that although both Linux and Solaris provide + sigaltstack, SA_ONSTACK, and SA_SIGINFO, currently only + Solaris satisfies the XSI heueristic. This is because + Solaris populates uc_stack with the details of the + interrupted stack, while Linux populates it with the details + of the current stack. */ + signo = 0; +# else if (0 < info->si_code) { -# if ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC - /* We can't easily determine whether it is a stack overflow; so - assume that the rest of our program is perfect (!) and that - this segmentation violation is a stack overflow. - - Note that although both Linux and Solaris provide - sigaltstack, SA_ONSTACK, and SA_SIGINFO, currently only - Solaris satisfies the XSI heueristic. This is because - Solaris populates uc_stack with the details of the - interrupted stack, while Linux populates it with the details - of the current stack. */ - signo = 0; -# else /* If the faulting address is within the stack, or within one page of the stack end, assume that it is a stack overflow. */ @@ -278,8 +278,8 @@ write (STDERR_FILENO, buf, strlen (buf)); } # endif + } # endif - } die (signo); }