[Top][All Lists]

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

Re: Thread safety of coroutine-sigaltstack

From: Laszlo Ersek
Subject: Re: Thread safety of coroutine-sigaltstack
Date: Fri, 22 Jan 2021 22:41:26 +0100

On 01/22/21 22:34, Laszlo Ersek wrote:
> On 01/22/21 21:38, Laszlo Ersek wrote:

>> The behavior of "savemask=0" is a platform trait that platforms are not
>> required to document (the behavior is unspecified, not
>> implementation-defined), so it really boils down to where this code
>> actually runs...
>> NB Linux is more specific:
>> https://man7.org/linux/man-pages/man3/setjmp.3.html
>>    sigsetjmp() and siglongjmp()
>>        sigsetjmp() and siglongjmp() also perform nonlocal gotos, but
>>        provide predictable handling of the process signal mask.
>>        If, and only if, the savesigs argument provided to sigsetjmp() is
>>        nonzero, the process's current signal mask is saved in env and
>>        will be restored if a siglongjmp() is later performed with this
>>        env.
>> Cue "and only if".
> ... I notice commit 6ab7e5465a4d ("Replace all setjmp()/longjmp() with
> sigsetjmp()/siglongjmp()", 2013-02-23) chose the Linux definition, not
> the POSIX one.

My bad: the commit message is correct. While the effect of savemask=0 is
indeed unspecified for sigsetjmp(), it is completely defined for


Commit 6ab7e5465a4d even carries my R-b :/

Sorry about the noise,

reply via email to

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