From: Shuah Khan <skhan@linuxfoundation.org>
To: Dev Jain <dev.jain@arm.com>, Oleg Nesterov <oleg@redhat.com>
Cc: shuah@kernel.org, mingo@kernel.org, tglx@linutronix.de,
mark.rutland@arm.com, ryan.roberts@arm.com, broonie@kernel.org,
suzuki.poulose@arm.com, Anshuman.Khandual@arm.com,
DeepakKumar.Mishra@arm.com, aneesh.kumar@kernel.org,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH v4 2/2] selftests: Add a test mangling with uc_sigmask
Date: Tue, 23 Jul 2024 09:55:15 -0600 [thread overview]
Message-ID: <2ee0f5df-9a9e-4625-ab09-b21596a0685f@linuxfoundation.org> (raw)
In-Reply-To: <01e41c46-255a-419a-9b72-485a2798205f@arm.com>
On 7/22/24 22:30, Dev Jain wrote:
>
> On 7/22/24 20:28, Shuah Khan wrote:
>> On 7/15/24 05:49, Dev Jain wrote:
>>>
>>> On 6/30/24 20:48, Oleg Nesterov wrote:
>>>> I see nothing wrong, but perhaps this test can be simplified?
>>>> Feel free to ignore.
>>>>
>>>> Say,
>>>>
>>>> On 06/27, Dev Jain wrote:
>>>>> +void handler_usr(int signo, siginfo_t *info, void *uc)
>>>>> +{
>>>>> + int ret;
>>>>> +
>>>>> + /*
>>>>> + * Break out of infinite recursion caused by raise(SIGUSR1) invoked
>>>>> + * from inside the handler
>>>>> + */
>>>>> + ++cnt;
>>>>> + if (cnt > 1)
>>>>> + return;
>>>>> +
>>>>> + ksft_print_msg("In handler_usr\n");
>>
>> This message isn't very useful. Why do you need this message?
>
>
> There isn't any specific use; I am just showing the progress
>
> of the test. If you think this is just waste output....
Showing progress will not be useful unless it is also giving useful
information to the user. It doesn't look like it in this case.
You can drop this message.
>
>>
>>>>> +
>>>>> + /* SEGV blocked during handler execution, delivered on return */
>>>>> + if (raise(SIGSEGV))
>>>>> + ksft_exit_fail_perror("raise");>>> +
>>>>> + ksft_print_msg("SEGV bypassed successfully\n");
>>>> You could simply do sigprocmask(SIG_SETMASK, NULL, &oldset) and check if
>>>> SIGSEGV is blocked in oldset. SIG_SETMASK has no effect if newset == NULL.
>>>>
>>>
>>> IMHO, isn't raising the signal, and the process not terminating, a stricter test? I have already included your described approach in
>>> the last testcase; so, the test includes both ways: raising the
>>> signal -> process not terminating, and checking blockage with sigprocmask().
>>
thanks,
-- Shuah
next prev parent reply other threads:[~2024-07-23 15:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-27 3:52 [PATCH v4 0/2] Add test to distinguish between thread's signal mask and ucontext_t Dev Jain
2024-06-27 3:52 ` [PATCH v4 1/2] selftests: Rename sigaltstack to generic signal Dev Jain
2024-06-27 3:52 ` [PATCH v4 2/2] selftests: Add a test mangling with uc_sigmask Dev Jain
2024-06-27 16:20 ` Mark Brown
2024-06-30 15:18 ` Oleg Nesterov
2024-07-15 11:49 ` Dev Jain
2024-07-22 14:58 ` Shuah Khan
2024-07-23 4:30 ` Dev Jain
2024-07-23 15:55 ` Shuah Khan [this message]
2024-07-16 9:44 ` [PATCH v4 0/2] Add test to distinguish between thread's signal mask and ucontext_t Dev Jain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2ee0f5df-9a9e-4625-ab09-b21596a0685f@linuxfoundation.org \
--to=skhan@linuxfoundation.org \
--cc=Anshuman.Khandual@arm.com \
--cc=DeepakKumar.Mishra@arm.com \
--cc=aneesh.kumar@kernel.org \
--cc=broonie@kernel.org \
--cc=dev.jain@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@kernel.org \
--cc=oleg@redhat.com \
--cc=ryan.roberts@arm.com \
--cc=shuah@kernel.org \
--cc=suzuki.poulose@arm.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®