Re: CVS commit: src/tests/kernel

2016-11-03 Thread Kamil Rytarowski
On 03.11.2016 15:24, Christos Zoulas wrote:
> In article <19801.1478175...@andromeda.noi.kre.to>,
> Robert Elz   wrote:
>>
>> Which is actually correct?   (That is, which makes more sense, if it is
>> not actually specified somewhere.)
>>
>> Please make the tests test correct behaviour, not just what NetBSD happens
>> to do today.   If NetBSD is doing something that is not correct, file a PR
>> and use atf_expect_fail() referencing the PR so it can get fixed, someday.
>>
>> Of course, it is also possible that the linux behaviour is the one that's
>> wrong.
>>
>>  | This code covers (uncovers issues?) WIFCONTINUED() and is the last planned
>>  | test in the ptraceme category.
>>
>> It would be kind of nice to have some (similar) tests that use waitid()
>> (or wait6()) instead of waitpid() given that waitid() is the more modern
>> (and more flexible) interface.
> 
> Well, having both WIFSTOPPED and WIFCONTINUED set does not make a lot of 
> sense.
> It would seem that the right behavior is that WIFCONTINUED should be set
> and WIFSTOPPED not set after PT_CONTINUE (unless the child stopped again).
> 
> Anyway, for FreeBSD WIFSTOPPED is set and WIFCONTINUED is not, so my guess
> is that the child is stopped again and we are wrong somewhere forgetting
> to clear the continued flag.
> 
> christos
> 

I will file a bug for it assuming that Linux (and apparently FreeBSD) is
correct here and adjust it in the test-case.

For now I'm focusing on functional tests, which are equivalent to
FreeBSD capabilities. This is why I will reschedule combination of
wait(2) usage functions for later and move to on other ptrace(2) use-cases.

I will replace sys_errlist(3) with strerror(3).



signature.asc
Description: OpenPGP digital signature


Re: CVS commit: src/tests/kernel

2016-11-03 Thread Christos Zoulas
In article <19801.1478175...@andromeda.noi.kre.to>,
Robert Elz   wrote:
>
>Which is actually correct?   (That is, which makes more sense, if it is
>not actually specified somewhere.)
>
>Please make the tests test correct behaviour, not just what NetBSD happens
>to do today.   If NetBSD is doing something that is not correct, file a PR
>and use atf_expect_fail() referencing the PR so it can get fixed, someday.
>
>Of course, it is also possible that the linux behaviour is the one that's
>wrong.
>
>  | This code covers (uncovers issues?) WIFCONTINUED() and is the last planned
>  | test in the ptraceme category.
>
>It would be kind of nice to have some (similar) tests that use waitid()
>(or wait6()) instead of waitpid() given that waitid() is the more modern
>(and more flexible) interface.

Well, having both WIFSTOPPED and WIFCONTINUED set does not make a lot of sense.
It would seem that the right behavior is that WIFCONTINUED should be set
and WIFSTOPPED not set after PT_CONTINUE (unless the child stopped again).

Anyway, for FreeBSD WIFSTOPPED is set and WIFCONTINUED is not, so my guess
is that the child is stopped again and we are wrong somewhere forgetting
to clear the continued flag.

christos



Re: CVS commit: src/tests/kernel

2016-11-03 Thread Robert Elz
Date:Thu, 3 Nov 2016 11:20:45 +
From:"Kamil Rytarowski" 
Message-ID:  <20161103112045.a48aaf...@cvs.netbsd.org>

  | This test verifies calling raise(2) with the SIGCONT argument in the child.
  | The parent is notified with it and asserts that WIFCONTINUED() and
  | WIFSTOPPED() are both set.
  | 
  | XXX: This behavior is surprising. Linux for the same code-path returns false
  | for WIFCONTINUED() and true for WIFSTOPPED().

Which is actually correct?   (That is, which makes more sense, if it is
not actually specified somewhere.)

Please make the tests test correct behaviour, not just what NetBSD happens
to do today.   If NetBSD is doing something that is not correct, file a PR
and use atf_expect_fail() referencing the PR so it can get fixed, someday.

Of course, it is also possible that the linux behaviour is the one that's
wrong.

  | This code covers (uncovers issues?) WIFCONTINUED() and is the last planned
  | test in the ptraceme category.

It would be kind of nice to have some (similar) tests that use waitid()
(or wait6()) instead of waitpid() given that waitid() is the more modern
(and more flexible) interface.

kre

ps: I notice that the code you included in the commit log references
sys_errlist[] explicitly - please don't do that, use strerror() instead.