On Sun, Dec 16, 2018 at 2:38 PM Bruno Haible <br...@clisp.org> wrote:
> While testing a 'grep' snapshot on Linux/sparc64, I noticed that this
> test failure (both in 32-bit and 64-bit mode):
> FAIL: test-c-stack2.sh
> ======================
> cannot tell stack overflow from crash, in spite of libsigsegv
> FAIL test-c-stack2.sh (exit status: 1)
> The message "in spite of libsigsegv" is a bit misleading: libsigsegv
> was available, but c-stack.c was compiled in such a way that it did
> not use libsigsegv. configure defined HAVE_XSI_STACK_OVERFLOW_HEURISTIC
> to 1; this is what leads to the test failure. If I
> in c-stack.c, then libsigsegv gets used, and the test-c-stack2.sh
> test succeeds.
> SIGSEGV handling on Linux/sparc is special; see
> https://git.savannah.gnu.org/gitweb/?p=libsigsegv.git;a=commitdiff;h=0db93a4c0e2a6881ad6781a9746fc112971aab17
> Two things are particular:
>   - The third argument passed to the SIGSEGV handler is not an 'ucontext_t *'.
>   - In 64-bit mode, an offset of 2047 needs to be considered.
> Since the problem here occurs also in 32-bit mode, where no offset is
> involved, the cause of the issue must be the nature of the third argument.
> With this knowledge, it's easy to adjust the Autoconf test. This patch
> fixes the test failure in both 32-bit and 64-bit mode; therefore I'm
> pushing it.
> 2018-12-16  Bruno Haible  <br...@clisp.org>
>         c-stack: Fix for Linux/sparc.
>         * m4/c-stack.m4 (AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC): Set
>         ac_cv_sys_xsi_stack_overflow_heuristic to 'no' on Linux/sparc.

Nice work.
This is cause for one more update from gnulib before I release grep-3.2
Thanks again!

Reply via email to