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

Martin Doucha mdoucha@suse.cz
Wed Jan 31 10:05:10 CET 2024


On 30. 01. 24 18:22, Petr Vorel wrote:
> Hi Martin,
> 
> nice work.
> 
> Reviewed-by: Petr Vorel <pvorel@suse.cz>
> 
> ...
>> +++ b/testcases/kernel/syscalls/waitpid/waitpid01.c
>> @@ -5,25 +5,57 @@
>>    * Copyright (c) 2018 Cyril Hrubis <chrubis@suse.cz>
> 
> Very nice cleanup, you deserve copyright, right?
>   * Copyright (C) 2024 SUSE LLC <mdoucha@suse.cz>
>>    */

It's not that big of a change.

> 
>> Extend waitpid01 to test all standard signals that kill the target
>> process unless caught. Also remove waitpid02 since testing SIGFPE
>> in waitpid01 makes it redundant.
>> +static int testcase_list[] = {
>> +	SIGABRT,
>> +	SIGALRM,
>> +	SIGBUS,
>> +	SIGFPE,
>> +	SIGHUP,
>> +	SIGILL,
>> +	SIGINT,
>> +	SIGKILL,
>> +	SIGPIPE,
>> +	SIGPOLL,
>> +	SIGPROF,
>> +	SIGQUIT,
>> +	SIGSEGV,
>> +	SIGSYS,
>> +	SIGTERM,
>> +	SIGTRAP,
>> +	SIGVTALRM,
>> +	SIGXCPU,
>> +	SIGXFSZ
>> +};
> 
> I suppose you ignored from the list of signals in man signal(7) these with
> action "Core" "Term" unless without standard ("-"), right?
> So user defined signals (SIGUSR1, SIGUSR2) does not make sense to test?

I've skipped all non-standard signals (some of which are just aliases 
for standard ones) and I think it's better to avoid SIGUSR* since we use 
them internally. But we could also add signal(sig, SIG_DFL); before 
raise() and add SIGUSR* to the list.

> Kind regards,
> Petr

-- 
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