[LTP] [PATCH] waitpid01: Test all standard deadly signals

Martin Doucha mdoucha@suse.cz
Tue Feb 6 11:01:21 CET 2024


On 05. 02. 24 18:34, Petr Vorel wrote:
> Hi Martin,
> 
> first this change (merged as ed5ccf6c1 ("waitpid01: Test all standard deadly
> signals") is failing on 6.6 on Debian:
> 
> ed5ccf6c1 ("waitpid01: Test all standard deadly signals")
> 
> waitpid01.c:88: TINFO: Testing child: raise(sig)
> waitpid01.c:109: TPASS: waitpid() returned correct pid 236064
> waitpid01.c:118: TPASS: WIFSIGNALED() set in status
> waitpid01.c:126: TPASS: WTERMSIG() == SIGIOT/SIGABRT
> waitpid01.c:143: TPASS: Child dumped core as expected
> waitpid01.c:109: TPASS: waitpid() returned correct pid 236071
> waitpid01.c:118: TPASS: WIFSIGNALED() set in status
> waitpid01.c:126: TPASS: WTERMSIG() == SIGALRM
> waitpid01.c:109: TPASS: waitpid() returned correct pid 236072
> waitpid01.c:118: TPASS: WIFSIGNALED() set in status
> waitpid01.c:126: TPASS: WTERMSIG() == SIGBUS
> waitpid01.c:143: TPASS: Child dumped core as expected
> waitpid01.c:109: TPASS: waitpid() returned correct pid 236082
> waitpid01.c:113: TFAIL: WIFSIGNALED() not set in status (exited with 0)
> ...
> waitpid01.c:88: TINFO: Testing child: kill(getpid(), sig)
> waitpid01.c:109: TPASS: waitpid() returned correct pid 236165
> waitpid01.c:118: TPASS: WIFSIGNALED() set in status
> waitpid01.c:126: TPASS: WTERMSIG() == SIGIOT/SIGABRT
> waitpid01.c:143: TPASS: Child dumped core as expected
> waitpid01.c:109: TPASS: waitpid() returned correct pid 236176
> waitpid01.c:118: TPASS: WIFSIGNALED() set in status
> waitpid01.c:126: TPASS: WTERMSIG() == SIGALRM
> waitpid01.c:109: TPASS: waitpid() returned correct pid 236177
> waitpid01.c:118: TPASS: WIFSIGNALED() set in status
> waitpid01.c:126: TPASS: WTERMSIG() == SIGBUS
> waitpid01.c:143: TPASS: Child dumped core as expected
> waitpid01.c:109: TPASS: waitpid() returned correct pid 236187
> waitpid01.c:113: TFAIL: WIFSIGNALED() not set in status (exited with 0)
> ...
> 
> But it works on 6.8.0-rc1-2.gf4ba5db-default Tumbleweed, which I tested it
> before.

I've tested the patch on kernel v6.6.1 on Tumbleweed and all testcases 
pass. The failure shows that SIGFPE doesn't trigger coredump for some 
reason, that's either a system bug or some parent process left over a 
SIGFPE handler. Could you try the Debian test again with this patch?

diff --git a/testcases/kernel/syscalls/waitpid/waitpid01.c 
b/testcases/kernel/syscalls/waitpid/waitpid01.c
index 367f7875c..a42b7e8ac 100644
--- a/testcases/kernel/syscalls/waitpid/waitpid01.c
+++ b/testcases/kernel/syscalls/waitpid/waitpid01.c
@@ -94,6 +94,9 @@ static void run(unsigned int n)
         int status;
         const struct testcase *tc = testcase_list + n;

+       if (tc->sig != SIGKILL)
+               SAFE_SIGNAL(tc->sig, SIG_DFL);
+
         pid = SAFE_FORK();
         if (!pid)
                 variant_list[tst_variant].func(tc->sig);

-- 
Martin Doucha   mdoucha@suse.cz
SW Quality Engineer
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic



More information about the ltp mailing list