From 3c58f96ddb39eefa68b361c6a0ef2f047992e5c2 Mon Sep 17 00:00:00 2001 From: Jiuzhu Dong Date: Wed, 12 May 2021 15:27:03 +0800 Subject: [PATCH] group/group_signal: cancel dispatch signal when the number MIRTOS-647 of members in the group is zero. Repetition step: If using waitpid() to wait a task has exited, the waitpid will use nxsing_kill with signal number 0 to determine if that task is still alive, and will call group_signal to dispatch signal for each member of the group and perform signal handing checks, it will assert at sched/group/group_signal.c:261. Change-Id: I75ef015a261101277436d742897ce68fed44b5da Signed-off-by: Jiuzhu Dong (cherry picked from commit 73008471e4e4a5b1e3aa6cc0d25b5295aec32bb1) --- sched/group/group_signal.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sched/group/group_signal.c b/sched/group/group_signal.c index 85796f6d257..fdb26e3f8cd 100644 --- a/sched/group/group_signal.c +++ b/sched/group/group_signal.c @@ -245,11 +245,15 @@ int group_signal(FAR struct task_group_s *group, FAR siginfo_t *siginfo) * signal to a pending state. */ - else /* if (info.dtcb) */ + else if (info.dtcb) { - DEBUGASSERT(info.dtcb); tcb = info.dtcb; } + else + { + ret = -ECHILD; + goto errout; + } /* Now deliver the signal to the selected group member */