bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: grep-3.5 fails to build on Solaris when libsigsegv is installed


From: Paul Eggert
Subject: Re: grep-3.5 fails to build on Solaris when libsigsegv is installed
Date: Sun, 4 Oct 2020 16:26:51 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

On 9/28/20 7:02 PM, Bruno Haible wrote:
#define USE_LIBSIGSEGV (HAVE_XSI_STACK_OVERFLOW_HEURISTIC && HAVE_LIBSIGSEGV)

There seems to be a logic mistake, here.

You're right, it's a typo: there should be a "!" before the HAVE_XSI_STACK_OVERFLOW_HEURISTIC. As a result of this mistake, libsigsegv is used only on Solaris-like platforms, where it's not needed, and libsigsegv is not used on other platforms like GNU/Linux where it can be helpful.

This mistake causes some configuration failures on Solaris on platforms where libsigsegv has been installed but grep was not configured correctly. It also means that the stack-overflow reporting on GNU/Linux is too generous, in that segmentation violations that are not stack overflows get reported as stack overflows. I installed the first attached patch to correct this. I would guess that this is not much of a problem in practice except when installing on Solaris with badly-configured libsigsegv, since from the user's point of view the problem is only that when grep crashes the wrong message might be printed.

While looking into this error I noticed that c-stack assumes SIGSTKSZ is an integer constant expression, but there have been moves to make it non-constant (and this may already be in effect on some platforms). I installed the second attached patch to work around this potential portability bug; it has a URL pointing to recent discussions in this area.

The third patch merely streamlines 'configure' when running on platforms like Solaris that need not use libsigsegv.

Attachment: 0001-c-stack-fix-libsigsegv-typo.patch
Description: Text Data

Attachment: 0002-c-stack-stop-using-SIGSTKSZ.patch
Description: Text Data

Attachment: 0003-c-stack-streamline-Solaris-configuration.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]