Changeset View
Standalone View
sys/kern/sys_procdesc.c
Show First 20 Lines • Show All 410 Lines • ▼ Show 20 Lines | if (p->p_state == PRS_ZOMBIE) { | ||||
procdesc_free(pd); | procdesc_free(pd); | ||||
/* | /* | ||||
* Next, reparent it to its reaper (usually init(8)) so | * Next, reparent it to its reaper (usually init(8)) so | ||||
* that there's someone to pick up the pieces; finally, | * that there's someone to pick up the pieces; finally, | ||||
* terminate with prejudice. | * terminate with prejudice. | ||||
*/ | */ | ||||
p->p_sigparent = SIGCHLD; | p->p_sigparent = SIGCHLD; | ||||
proc_reparent(p, p->p_reaper, true); | proc_reparent(p, p->p_reaper, true); | ||||
markj: You forgot to remove the old call. | |||||
oshogboAuthorUnsubmitted Done Inline ActionsAghr. Screw up while rebasing. Thanks! oshogbo: Aghr. Screw up while rebasing. Thanks! | |||||
if ((p->p_flag & P_TRACED) == 0) { | |||||
proc_reparent(p, p->p_reaper, true); | |||||
} else { | |||||
clear_orphan(p); | |||||
p->p_oppid = p->p_reaper->p_pid; | |||||
} | |||||
markjUnsubmitted Not Done Inline ActionsI think this is necessary but it's not obvious to me that it's sufficient. Looking at proc_reparent(), it also calls sigqueue_take(), but I don't think we need to do that in the traced case. Is there any other state that might need to be updated? markj: I think this is necessary but it's not obvious to me that it's sufficient. Looking at… | |||||
kibUnsubmitted Not Done Inline ActionsI am not sure how would it work. The process must be on the orphans' list for its old parent, otherwise premature exit of the debugger or even detach would see unexpected state. kib: I am not sure how would it work. The process must be on the orphans' list for its old parent… | |||||
markjUnsubmitted Not Done Inline ActionsThe parent has disassociated itself from the process by closing the process descriptor. Your comment makes me think that p should be added to the orphan list of the reaper. I noted however that the code in exit1() that raises SIGKILL to children of an exiting debugger does not do this. markj: The parent has disassociated itself from the process by closing the process descriptor. Your… | |||||
kibUnsubmitted Not Done Inline ActionsYes, inserting into the reapper' orphan list is the most obvious option. In exit1() case, when debugger exits, the traced children are reparented back, there is no need to do anything about new orphanage. kib: Yes, inserting into the reapper' orphan list is the most obvious option.
In exit1() case… | |||||
if ((pd->pd_flags & PDF_DAEMON) == 0) | if ((pd->pd_flags & PDF_DAEMON) == 0) | ||||
kern_psignal(p, SIGKILL); | kern_psignal(p, SIGKILL); | ||||
PROC_UNLOCK(p); | PROC_UNLOCK(p); | ||||
sx_xunlock(&proctree_lock); | sx_xunlock(&proctree_lock); | ||||
} | } | ||||
} | } | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 144 Lines • Show Last 20 Lines |
You forgot to remove the old call.