[PATCH 3/8] nptl: Fix testcases for new pthread cancellation, mechanism
Adhemerval Zanella
azanella@linux.vnet.ibm.com
Thu Oct 9 12:27:00 GMT 2014
On 08-10-2014 20:12, Joseph S. Myers wrote:
> On Wed, 8 Oct 2014, Adhemerval Zanella wrote:
>
>> For testcases that are not tested in blocked case (pread64 for instance)
>> tst-cancel4/5 tests for its cancellation point as 'early exit'. Although
>> this is not ideal, 'tst-cancel-wrappers.sh' also does not offer more
>> coverage. Ideally and as pointed out in testcases itself, the best option
>> would be to create a way to actually block some cancellable entrypoint.
>> However, for some syscalls calls this is very trick (pread64 for instance
>> does not work on pipe-type descriptors).
> I still don't understand exactly what the effects are on test coverage.
>
> Could you provide a list of all the functions tested in
> tst-cancel-wrappers.sh, with, for each function, a statement either of the
> other testcase that tests cancellation of that function, or of why it is
> not possible to test cancellation of that function in a useful way?
>
I understand your hesitation about remove tst-cancel-wrappers.sh testcase,
however currently it does not offer any more coverage than current other tests.
Below is a chart I compiled with the function tst-cancel-wrappers.sh is intended
to check:
syscall | testcase | blocked case | early exit | Notes
----------------|----------------|--------------|------------|------
accept | tst-cancel4.c | yes | yes |
close | tst-cancel4.c | no | yes |
connect | tst-cancel4.c | no | yes |
creat | tst-cancel4.c | no | yes |
fcntl | tst-cancel16.c | no | yes | *
fdatasync | tst-cancel4.c | no | yes |
fsync | tst-cancel4.c | no | yes |
msgrcv | tst-cancel4.c | yes | yes |
msgsnd | tst-cancel4.c | no | yes |
msync | tst-cancel4.c | no | yes |
nanosleep | tst-cancel4.c | yes | yes |
open/open64 | tst-cancel4.c | no | yes |
pause | tst-cancel4.c | yes | yes |
poll | tst-cancel4.c | yes | yes |
pread/pread64 | tst-cancel4.c | no | yes |
pselect | tst-cancel4.c | yes | yes |
pwrite/pwrite64 | tst-cancel4.c | no | yes |
read | tst-cancel4.c | yes | yes |
readv | tst-cancel4.c | yes | yes |
recv | tst-cancel4.c | yes | yes |
recvfrom | tst-cancel4.c | yes | yes |
recvmsg | tst-cancel4.c | yes | yes |
select | tst-cancel4.c | yes | yes |
send | tst-cancel4.c | yes | yes |
sendmsg | tst-cancel4.c | no | yes |
sendto | tst-cancel4.c | no | yes |
sigpause | tst-cancel4.c | yes | yes |
sigsuspend | tst-cancel4.c | yes | yes |
sigwait | tst-cancel4.c | yes | yes |
sigwaitinfo | tst-cancel4.c | yes | yes |
tcdrain | tst-cancel4.c | no | yes |
wait | tst-cancel4.c | yes | yes |
waitid | tst-cancel4.c | yes | yes |
waitpid | tst-cancel4.c | yes | yes |
write | tst-cancel4.c | yes | yes |
writev | tst-cancel4.c | yes | yes |
* tested through lockf (F_LOCK) which calls fctnl (F_SETLK)
The 'blocked case' case refers to a cancellation signal send while the syscall
is blocked and the test checks cancellation is done properly. As the 'tst-cancel4.c'
states, some syscalls are hard to put in a blocked case (pread/close for instance)
to exercise all code patch. If you have suggestion of how to add blocked cases
I can add them in a following patch.
The 'early exit' checks if the cancellation entrypoint will check for pending
cancellation signal and act accordingly. As you can for this case 'tst-cancel4.c'
already cover alls the syscalls.
More information about the Libc-alpha
mailing list