This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v4] Block all signals on timer_create thread (BZ#10815)
On 19/02/2020 07:34, Florian Weimer wrote:
> * Adhemerval Zanella:
>
>> diff --git a/nptl/tst-cancel28.c b/nptl/tst-cancel28.c
>> new file mode 100644
>> index 0000000000..f126dd8bcb
>> --- /dev/null
>> +++ b/nptl/tst-cancel28.c
>
>> +/* A stall in cancellation is a regression. */
>> +#define TIMEOUT 5
>> +#include <support/test-driver.c>
>
> I don't think we should reduce the test timeout below the default.
Ack.
>
>> diff --git a/rt/tst-timer-sigmask.c b/rt/tst-timer-sigmask.c
>> new file mode 100644
>> index 0000000000..1ed60e9d85
>> --- /dev/null
>> +++ b/rt/tst-timer-sigmask.c
>
>> +#ifdef __linux__
>> + /* POSIX timers threads created to handle SIGEV_THREAD block all
>> + signals except SIGKILL, SIGSTOP and glibc internals one except
>> + SIGTIMER. */
>> + if (!sigismember (&ss, sig)
>> + && (sig != SIGSETXID && sig != SIGCANCEL
>> + && sig != SIGKILL && sig != SIGSTOP))
>> + {
>> + thread_handler_failure = true;
>
> I think you can use TEST_VERIFY here. Then you won't need the
> thread_handler_failure variable.
Right, I changed to:
if (sigismember (&ss, sig))
TEST_VERIFY (sig != SIGSETXID && sig != SIGCANCEL
&& sig != SIGKILL && sig != SIGSTOP);
>
>> + }
>> +#endif
>
> Is __linux__ really the right conditional to check here?
I think we can use the following, since Hurd uses the default
pthread implementation that already blocks all signals as default
(and assuming Hurd also does not allow block SIGKILL and SIGSTOP):
/* POSIX timers threads created to handle SIGEV_THREAD block all
signals except SIGKILL, SIGSTOP and glibc internals ones. */
if (sigismember (&ss, sig))
{
TEST_VERIFY (sig != SIGKILL && sig != SIGSTOP);
TEST_VERIFY (!__is_internal_signal (sig));
}
>
> Rest of the patch looks okay.
>
> Thanks,
> Florian
>