bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH 2/4] Use SA_ONSTACK even if SA_SIGINFO is unavailable.


From: Ingo Weinhold
Subject: Re: [PATCH 2/4] Use SA_ONSTACK even if SA_SIGINFO is unavailable.
Date: Thu, 06 Nov 2008 01:21:34 +0100
User-agent: Beam 1.1.2

Eric Blake wrote:
> Ingo Weinhold <ingo_weinhold <at> gmx.de> writes:
> > 
> > If SA_ONSTACK exists, use it even if SA_SIGINFO doesn't. This does at 
least
> > allow for a somewhat controlled program termination on stack overflow. 
E.g.
> > in Haiku this prevents the debug server dialog box from popping up.
> 
> In my mind, it would be cleaner if we provided a stub
> 
> #ifndef SA_SIGINFO
> # define SA_SIGINFO 0
> #endif
> 
> in signal.in.h rather than using #if inside the body of a method, similar 
to 
> the SA_NODEFER stub added for Interix.  Does that approach work for you?

Then both SA_SIGINFO and SA_ONSTACK were defined and the SIGACTION_WORKS 
macro in c-stack.c would be defined to 1. Which would obviously go horribly 
wrong in the signal handler.

If both SA_SIGINFO and SA_ONSTACK were stubbed, SIGACTION_WORKS could be 
defined differently:

#define SIGACTION_WORKS (SA_SIGINFO && SA_ONSTACK)

All "#if defined SA_SIGINFO" and "#if defined SA_ONSTACK" checks would need 
to be changed, too. Not sure if that's such a good idea.

Stubbing only SA_ONSTACK as Paolo suggests should be relatively harmless, I 
suppose.

CU, Ingo




reply via email to

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