linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ./kselftest/prefix.pl read from pipe will block until the front command and its child processes all exit
@ 2021-12-20  7:48 lizhijian
  0 siblings, 0 replies; only message in thread
From: lizhijian @ 2021-12-20  7:48 UTC (permalink / raw)
  To: Kees Cook
  Cc: kernel test robot, Li, Philip, zhoujie2011, Shuah Khan,
	linux-kselftest, open list, andrea.righi

Hi folks, Kees

This issue confuses the LKP/0Day robot for a long time.
Take below script as an example:

lizj@FNSTPC:~/workspace/colo/linux/tools/testing/selftests$ cat a.sh
#!/bin/bash
sleep 10 &
echo 1000000000000000

lizj@FNSTPC:~/workspace/colo/linux/tools/testing/selftests$ time ./a.sh | ./kselftest/prefix.pl
# 1000000000000000

real    0m10.004s
user    0m0.012s
sys    0m0.001s
------------------------------------

Although the first script already exited,  ./kselftest/prefix.pl will block until "sleep 10 &" exit.
That means once some of the child process cannot finish/exit itself, for example, one test
becomes *zombie* for some reasons, the whole ksefltest framework will hang forever.

In addition,  currently ksefltest timeout scheme[1][2] will not signal/kil the child processes, that
make the blocking often happens.

Since i'm not familiar with perl, not sure whether it can finish itself *directly* when first/front
command(excluding child processes) exits.


[1]: https://lkml.org/lkml/2021/12/17/140
[2]: http://lkml.iu.edu/hypermail/linux/kernel/2004.1/02379.html
$ man timeout
        --foreground
               when not running timeout directly from a shell prompt,
               allow COMMAND to read from the TTY and get TTY signals; in this mode, children of COMMAND will not be timed out


Thanks
Zhijian

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-12-20  7:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-20  7:48 ./kselftest/prefix.pl read from pipe will block until the front command and its child processes all exit lizhijian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).