[PATCH 4/4] signal: Only handle on NSIG signals on signal functions (BZ #25657)

Florian Weimer fw@deneb.enyo.de
Wed Apr 22 08:32:00 GMT 2020


* Andreas Schwab:

> On Apr 21 2020, Adhemerval Zanella wrote:
>
>> On 21/04/2020 15:40, Andreas Schwab wrote:
>>> On Apr 21 2020, Adhemerval Zanella wrote:
>>> 
>>>> I have added the following comment on linux sigsetopts.h:
>>>>
>>>>   /* Linux sig* functions only handle up to __NSIG_WORDS words instead of
>>>>      full _SIGSET_NWORDS sigset size.  The signal numbers are 1-based, and
>>>>      bit 0 of a signal mask is for signal 1.  */
>>> 
>>> You forgot to fix __NSIG_WORDS.
>>
>> Hum what exactly? I missing to see what might be missing here. Is the
>> related to comment or the __NSIG_WORDS value itself?
>
> The problem really is that _NSIG is bogus, it is actually the number of
> signals plus one.  That doesn't change the value of __NSIG_WORDS, but if
> there would actually be 65 signals then __NSIG_WORDS would be too small.
>
> Note also that mips has the wrong value for __SIGRTMAX (it should be
> 128).

Adhemerval, if you address this, please also fix these whitespace
issue:

+# define __NSIG_WORDS (_NSIG / (8 * sizeof (unsigned long int )))

(Space before define (it's not nested) and after “unsigned long int”.)


More information about the Libc-alpha mailing list