[PATCH v2 2/2] ioctl console test v2
Dmitry V. Levin
ldv at altlinux.org
Mon Mar 16 10:12:28 UTC 2020
On Mon, Mar 16, 2020 at 03:37:07PM +0530, Bran S wrote:
> On Fri, 13 Mar 2020 at 23:42, Eugene Syromiatnikov <esyr at redhat.com> wrote:
> > On Fri, Mar 13, 2020 at 04:25:03PM +0530, Bran S wrote:
> > > On Wed, 11 Mar 2020 at 19:15, Eugene Syromiatnikov <esyr at redhat.com> wrote:
> > > > On Wed, Mar 11, 2020 at 03:01:38PM +0530, Bran S wrote:
> > > > > > Have you considered fixing strace-DDD.test?
> > > > >
> > > > > It is mentioned here that it doesn't fail when built outside
> > > > > systemd user slice.
> > > >
> > > > There are actually two issues: one is itermittent and is common with
> > > > strace-DD.test, namingly, the waiting of the strace's termination is not
> > > > done properly, so it checks the actual strace's output too early
> > > > sometimes; the other one is the one you've referenced, yes.
> > >
> > > Will get to strace-DD.test after solving strace-DDD.test ?
> > > Or are they somehow dependent and need to be solve at once ?
> > >
> > > > > So should we check if the ppid is of the systemd instead of checking for pid 1 ?
> > > > > Would that be a solution or something else ?
> > > >
> > > > Why systemd? Any process can be child subreaper for whatever reasons.
> > > > Yes, it's likely that the solution is to get the subreaper's PID and
> > > > check against it instead of checking against hard-coded 1.
> > >
> > > So if any process can be subreaper i.e. ppid can be anything greater
> > > than equal to 1, then what is the point of matching the process id ?
> > Well, matching PPID against child subreaper's PID confirms that
> > the tracer is re-parented by it.
> > ...
> > Well, the check that PPID is no less than 0 is effectively useless,
> > as it is always no less than 1. As I said, it has to be checked
> > against test's child subreaper, or at least checked that it is outside
> > tracee's PID tree (however, checking it against child subreaper's PID
> > is easier and makes the test more precise).
> There can be any number of subreapers right ?
No, I don't think it's the case, see descriptions of PR_SET_CHILD_SUBREAPER
and PR_GET_CHILD_SUBREAPER in prctl(2).
More information about the Strace-devel