[PATCH v2 2/2] ioctl console test v2

Bran S archsbran at gmail.com
Fri Mar 13 10:55:03 UTC 2020


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[1] 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 ?
Wouldn't it be enough to just confirm that a process whose pid is
equal to ppid exists ?

Would this solve the issue ?

diff --git a/tests/strace-DDD.test b/tests/strace-DDD.test
index e478ae5e..fd1b0068 100755
--- a/tests/strace-DDD.test
+++ b/tests/strace-DDD.test
@@ -35,7 +35,7 @@ sid0="$sid"

 run_strace -D "$@" > "$OUT"
 read -r ppid pgid sid < "$OUT" &&
-[ "$ppid" -eq 1 ] &&
+[ "$ppid" -ge 1 ] &&
 [ "$pgid" = "$pgid0" ] &&
 [ "$sid" = "$sid0" ] || {
        cat < "$OUT" > "$LOG"
@@ -45,7 +45,7 @@ match_diff

 run_strace -DD "$@" > "$OUT"
 read -r ppid pgid sid < "$OUT" &&
-[ "$ppid" -eq 1 ] &&
+[ "$ppid" -ge 1 ] &&
 [ "$pgid" -gt 1 ] &&
 [ "$pgid" != "$pgid0" ] &&
 [ "$pgid" != "$sid" ] &&
@@ -57,7 +57,7 @@ match_diff

 run_strace -DDD "$@" > "$OUT"
 read -r ppid pgid sid < "$OUT" &&
-[ "$ppid" -eq 1 ] &&
+[ "$ppid" -ge 1 ] &&
 [ "$pgid" -gt 1 ] &&
 [ "$pgid" != "$pgid0" ] &&
 [ "$sid" = "$pgid" ] &&


> > [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=947396


More information about the Strace-devel mailing list