[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
siglongjmp().
https://pubs.opengroup.org/onlinepubs/9699919799/functions/siglongjmp.html
Commit 6ab7e5465a4d even carries my R-b :/
Sorry about the noise,
Laszlo
- Re: Thread safety of coroutine-sigaltstack, (continued)
- Re: Thread safety of coroutine-sigaltstack, Paolo Bonzini, 2021/01/21
- Re: Thread safety of coroutine-sigaltstack, Daniel P . Berrangé, 2021/01/21
- Re: Thread safety of coroutine-sigaltstack, Peter Maydell, 2021/01/21
- Re: Thread safety of coroutine-sigaltstack, Paolo Bonzini, 2021/01/21
- Re: Thread safety of coroutine-sigaltstack, Laszlo Ersek, 2021/01/22
- Re: Thread safety of coroutine-sigaltstack, Laszlo Ersek, 2021/01/22
- Re: Thread safety of coroutine-sigaltstack,
Laszlo Ersek <=
- Re: Thread safety of coroutine-sigaltstack, Markus Armbruster, 2021/01/22
Re: Thread safety of coroutine-sigaltstack, Max Reitz, 2021/01/22
- Re: Thread safety of coroutine-sigaltstack, Peter Maydell, 2021/01/22
- Re: Thread safety of coroutine-sigaltstack, Max Reitz, 2021/01/22
- Re: Thread safety of coroutine-sigaltstack, Laszlo Ersek, 2021/01/22
- Re: Thread safety of coroutine-sigaltstack, Laszlo Ersek, 2021/01/22
- Re: Thread safety of coroutine-sigaltstack, Peter Maydell, 2021/01/23
- Re: Thread safety of coroutine-sigaltstack, Laszlo Ersek, 2021/01/25
- Re: Thread safety of coroutine-sigaltstack, Paolo Bonzini, 2021/01/25
- Re: Thread safety of coroutine-sigaltstack, Laszlo Ersek, 2021/01/26