[<prev] [next>] [day] [month] [year] [list]
Message-ID: <78c1131a-532f-313d-3823-40e34421ac87@fujitsu.com>
Date: Mon, 20 Dec 2021 07:48:09 +0000
From: "lizhijian@...itsu.com" <lizhijian@...itsu.com>
To: Kees Cook <keescook@...omium.org>
CC: kernel test robot <lkp@...el.com>,
"Li, Philip" <philip.li@...el.com>,
"zhoujie2011@...itsu.com" <zhoujie2011@...itsu.com>,
Shuah Khan <shuah@...nel.org>,
"linux-kselftest@...r.kernel.org" <linux-kselftest@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>,
"andrea.righi@...onical.com" <andrea.righi@...onical.com>
Subject: ./kselftest/prefix.pl read from pipe will block until the front
command and its child processes all exit
Hi folks, Kees
This issue confuses the LKP/0Day robot for a long time.
Take below script as an example:
lizj@...TPC:~/workspace/colo/linux/tools/testing/selftests$ cat a.sh
#!/bin/bash
sleep 10 &
echo 1000000000000000
lizj@...TPC:~/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
Powered by blists - more mailing lists