[PATCH v2 1/2] setjmp: Use BSD sematic as default for setjmp

Adhemerval Zanella Netto adhemerval.zanella@linaro.org
Mon Aug 7 20:49:55 GMT 2023



On 07/08/23 16:51, Florian Weimer wrote:
> * Adhemerval Zanella Netto:
> 
>> I still think unblocking the signal on raise is not fully correct, since
>> calling abort in the SIGABRT handler itself leads to a recursive call
>> to the handler, which will eventually lead to a stack overflow.
> 
> We can't know that, it depends on how the handler is written.

But the idea of making abort AS-safe is also to allow it being called
in SIGABRT handler.  Adding UB is not really an improvement, specially
if the idea to moving the interface to be AS-safe.

> 
> I think it's better to call the handler at least once (even if the
> signal was blocked) and risk terminating with SIGSEGV due to recursive
> signals.
> 
I disagree and SIGSEGV can be non deterministic depending of the defined 
stack size.  And I am meant with default signal mask, using SA_NODEFER 
for SIGABR handler will require additional synchronization by the handler.


More information about the Libc-alpha mailing list