linux/tools/testing/selftests/powerpc
Breno Leitao 8e676abeaf selftests/powerpc: Kill child processes on SIGINT
[ Upstream commit 7c27a26e1e ]

There are some powerpc selftests, as tm/tm-unavailable, that run for a long
period (>120 seconds), and if it is interrupted, as pressing CRTL-C
(SIGINT), the foreground process (harness) dies but the child process and
threads continue to execute (with PPID = 1 now) in background.

In this case, you'd think the whole test exited, but there are remaining
threads and processes being executed in background. Sometimes these
zombies processes are doing annoying things, as consuming the whole CPU or
dumping things to STDOUT.

This patch fixes this problem by attaching an empty signal handler to
SIGINT in the harness process. This handler will interrupt (EINTR) the
parent process waitpid() call, letting the code to follow through the
normal flow, which will kill all the processes in the child process group.

This patch also fixes a typo.

Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Gustavo Romero <gromero@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-15 09:40:39 +02:00
..
benchmarks powerpc/selftest: Add gettimeofday() benchmark 2015-10-01 16:52:02 +10:00
copyloops powerpc updates for 4.1 2015-04-16 13:53:32 -05:00
dscr selftests/powerpc: Add gitignore file for the new DSCR tests 2015-06-07 19:38:20 +10:00
mm selftests/powerpc: Skip the subpage_prot tests if the syscall is unavailable 2018-05-30 07:49:03 +02:00
pmu selftest/powerpc: Wrong PMC initialized in pmc56_overflow test 2017-01-26 08:23:50 +01:00
primitives selftests/powerpc: Fix build failure of load_unaligned_zeropad test 2015-10-13 15:08:37 +11:00
stringloops selftests: Add install support for the powerpc tests 2015-03-19 12:38:51 -06:00
switch_endian selftests/powerpc: Add install support to more powerpc tests 2015-06-02 16:54:49 +10:00
syscalls selftests/powerpc: Add tests of unmuxed IPC calls 2015-10-15 20:32:03 +11:00
tm selftests/powerpc: Fix TM resched DSCR test with some compilers 2018-04-13 19:50:08 +02:00
vphn selftests/powerpc: Add install support to more powerpc tests 2015-06-02 16:54:49 +10:00
harness.c selftests/powerpc: Kill child processes on SIGINT 2018-09-15 09:40:39 +02:00
Makefile selftests/powerpc: Sort the list of SUB_DIRS to build 2015-10-15 20:32:03 +11:00
subunit.h selftests/powerpc: Add support for skipping tests 2014-06-11 17:03:54 +10:00
utils.h selftests/powerpc: Move get_auxv_entry() to harness.c 2015-04-11 20:49:20 +10:00