sched/task/task_exithook.c: nxtask_signalparent() in task_exithook.c may invalidate the group's parent task ID (tg_ppid) too soon. The tg_ppid field is use only to remember the parent tasks ID so that it can send the SIGCHLD signal to it. So it must stay valid until SIGCHLD has been sent. In nxtask_signalparent(), it calls nxtask_sigchild() to send SIGCHLD to the parent, then invalidates tg_ppid. That would be okay, except that the SIGCHLD is only sent when the last member of the group terminates. That is incorrect; tg_ppid can be invalidated too soon and, as a consequence, SIGCHLD would never be sent.
Noted by Jeongchan Kim in the Google group: https://groups.google.com/forum/#!topic/nuttx/SXd8fVwVKBk
This commit is contained in:
parent
7712d15867
commit
eda7f5f379
2
COPYING
2
COPYING
@ -49,7 +49,7 @@ files will vary):
|
||||
/****************************************************************************
|
||||
* directory path/filename
|
||||
*
|
||||
* Copyright (C) 2007-2018 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007-2019 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -476,10 +476,6 @@ static inline void nxtask_signalparent(FAR struct tcb_s *ctcb, int status)
|
||||
/* Send SIGCHLD to all members of the parent's task group */
|
||||
|
||||
nxtask_sigchild(ptcb, ctcb, status);
|
||||
|
||||
/* Forget who our parent was */
|
||||
|
||||
ctcb->group->tg_ppid = INVALID_PROCESS_ID;
|
||||
sched_unlock();
|
||||
#endif
|
||||
}
|
||||
|
@ -60,7 +60,7 @@
|
||||
* Name: nxtask_terminate
|
||||
*
|
||||
* Description:
|
||||
* This function causes a specified task to cease to exist. Its stack and
|
||||
* This function causes a specified task to cease to exist. Its stack and
|
||||
* TCB will be deallocated. This function is the internal implementation
|
||||
* of the task_delete() function. It includes and additional parameter
|
||||
* to determine if blocking is permitted or not.
|
||||
|
Loading…
Reference in New Issue
Block a user