[PATCH 2/2] ksefltest: pidfd: Fix wait_states: Test terminated by timeout

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



0Day/LKP observed that the kselftest blocks foever since one of the
pidfd_wait doesn't terminate in 1 of 30 runs. After digging into
the source, we found that it blocks at:
ASSERT_EQ(sys_waitid(P_PIDFD, pidfd, &info, WCONTINUED, NULL), 0);

we can reproduce it by:
$ while true; do make run_tests -C pidfd; done

a delay to ensure that the parent can see child process WCONTINUED.

CC: Christian Brauner <christian@xxxxxxxxxx>
CC: Shuah Khan <shuah@xxxxxxxxxx>
CC: Philip Li <philip.li@xxxxxxxxx>
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Signed-off-by: Li Zhijian <lizhijian@xxxxxxxxxxxxxx>
---
 tools/testing/selftests/pidfd/pidfd_wait.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/testing/selftests/pidfd/pidfd_wait.c b/tools/testing/selftests/pidfd/pidfd_wait.c
index be2943f072f6..5abd26da4caa 100644
--- a/tools/testing/selftests/pidfd/pidfd_wait.c
+++ b/tools/testing/selftests/pidfd/pidfd_wait.c
@@ -107,7 +107,9 @@ TEST(wait_states)
 
 	if (pid == 0) {
 		kill(getpid(), SIGSTOP);
+		usleep(1000);
 		kill(getpid(), SIGSTOP);
+		usleep(1000);
 		exit(EXIT_SUCCESS);
 	}
 
-- 
2.33.0






[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux