* [PATCH] posix: Ensure the initial signal disposition for tst-spawn7
@ 2023-03-07 16:31 Adhemerval Zanella
2023-03-08 9:44 ` Florian Weimer
0 siblings, 1 reply; 3+ messages in thread
From: Adhemerval Zanella @ 2023-03-07 16:31 UTC (permalink / raw)
To: libc-alpha
To avoid possible failure if any parent set any initial signal
disposition as SIG_IGN.
Checked on x86_64-linux-gnu.
---
posix/tst-spawn7.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/posix/tst-spawn7.c b/posix/tst-spawn7.c
index fedb09fb94..fb06915cb7 100644
--- a/posix/tst-spawn7.c
+++ b/posix/tst-spawn7.c
@@ -99,6 +99,12 @@ dummy_sa_handler (int signal)
static void
do_test_signals (void)
{
+ /* Ensure the initial signal disposition, ignore EINVAL for internal
+ signal such as SIGCANCEL. */
+ for (int sig = 1; sig < _NSIG; ++sig)
+ sigaction (sig, &(struct sigaction) { .sa_handler = SIG_DFL,
+ .sa_flags = 0 }, NULL);
+
{
/* Check if all signals handler are set to SIG_DFL on spawned process. */
spawn_signal_test ("SIG_DFL", NULL);
--
2.34.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] posix: Ensure the initial signal disposition for tst-spawn7
2023-03-07 16:31 [PATCH] posix: Ensure the initial signal disposition for tst-spawn7 Adhemerval Zanella
@ 2023-03-08 9:44 ` Florian Weimer
2023-03-08 13:08 ` Adhemerval Zanella Netto
0 siblings, 1 reply; 3+ messages in thread
From: Florian Weimer @ 2023-03-08 9:44 UTC (permalink / raw)
To: Adhemerval Zanella via Libc-alpha; +Cc: Adhemerval Zanella, H.J. Lu
* Adhemerval Zanella via Libc-alpha:
> To avoid possible failure if any parent set any initial signal
> disposition as SIG_IGN.
>
> Checked on x86_64-linux-gnu.
> ---
> posix/tst-spawn7.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/posix/tst-spawn7.c b/posix/tst-spawn7.c
> index fedb09fb94..fb06915cb7 100644
> --- a/posix/tst-spawn7.c
> +++ b/posix/tst-spawn7.c
> @@ -99,6 +99,12 @@ dummy_sa_handler (int signal)
> static void
> do_test_signals (void)
> {
> + /* Ensure the initial signal disposition, ignore EINVAL for internal
> + signal such as SIGCANCEL. */
> + for (int sig = 1; sig < _NSIG; ++sig)
> + sigaction (sig, &(struct sigaction) { .sa_handler = SIG_DFL,
> + .sa_flags = 0 }, NULL);
> +
> {
> /* Check if all signals handler are set to SIG_DFL on spawned process. */
> spawn_signal_test ("SIG_DFL", NULL);
Finally found out what's causing my failure: running the test suite with
“nohup”. Maybe you could mention this in the comment? Anyway, the
patch is fixing things.
I suspect H.J. is doing the same. 8-)
Tested-by: Florian Weimer <fweimer@redhat.com>
Reviewed-by: Florian Weimer <fweimer@redhat.com>
Thanks,
Florian
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] posix: Ensure the initial signal disposition for tst-spawn7
2023-03-08 9:44 ` Florian Weimer
@ 2023-03-08 13:08 ` Adhemerval Zanella Netto
0 siblings, 0 replies; 3+ messages in thread
From: Adhemerval Zanella Netto @ 2023-03-08 13:08 UTC (permalink / raw)
To: Florian Weimer, Adhemerval Zanella via Libc-alpha; +Cc: H.J. Lu
On 08/03/23 06:44, Florian Weimer wrote:
> * Adhemerval Zanella via Libc-alpha:
>
>> To avoid possible failure if any parent set any initial signal
>> disposition as SIG_IGN.
>>
>> Checked on x86_64-linux-gnu.
>> ---
>> posix/tst-spawn7.c | 6 ++++++
>> 1 file changed, 6 insertions(+)
>>
>> diff --git a/posix/tst-spawn7.c b/posix/tst-spawn7.c
>> index fedb09fb94..fb06915cb7 100644
>> --- a/posix/tst-spawn7.c
>> +++ b/posix/tst-spawn7.c
>> @@ -99,6 +99,12 @@ dummy_sa_handler (int signal)
>> static void
>> do_test_signals (void)
>> {
>> + /* Ensure the initial signal disposition, ignore EINVAL for internal
>> + signal such as SIGCANCEL. */
>> + for (int sig = 1; sig < _NSIG; ++sig)
>> + sigaction (sig, &(struct sigaction) { .sa_handler = SIG_DFL,
>> + .sa_flags = 0 }, NULL);
>> +
>> {
>> /* Check if all signals handler are set to SIG_DFL on spawned process. */
>> spawn_signal_test ("SIG_DFL", NULL);
>
> Finally found out what's causing my failure: running the test suite with
> “nohup”. Maybe you could mention this in the comment? Anyway, the
> patch is fixing things.
I will add the nohup note, thanks.
>
> I suspect H.J. is doing the same. 8-)
>
> Tested-by: Florian Weimer <fweimer@redhat.com>
> Reviewed-by: Florian Weimer <fweimer@redhat.com>
>
> Thanks,
> Florian
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-03-08 13:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-07 16:31 [PATCH] posix: Ensure the initial signal disposition for tst-spawn7 Adhemerval Zanella
2023-03-08 9:44 ` Florian Weimer
2023-03-08 13:08 ` Adhemerval Zanella Netto
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).