diff -NurpP --minimal linux-2.4.25-rc1-vs1.3.7/kernel/exit.c linux-2.4.25-rc1-vs1.3.7.1.y/kernel/exit.c --- linux-2.4.25-rc1-vs1.3.7/kernel/exit.c 2004-02-09 12:43:48.000000000 +0100 +++ linux-2.4.25-rc1-vs1.3.7.1.y/kernel/exit.c 2004-02-14 03:14:47.000000000 +0100 @@ -178,29 +178,47 @@ static inline void forget_original_paren { struct task_struct * p; struct task_struct *vchild_reaper = child_reaper; + pid_t initpid = 1; read_lock(&tasklist_lock); + printk("··· forget_original_parent(%p[#%d],A): reaper=%p[#%d]\n", + father, father->pid, vchild_reaper, vchild_reaper->pid); + if (father->vx_info) { - pid_t initpid = father->vx_info->vx_initpid; - if ((initpid != 0) && (father->pid != initpid)) { + initpid = father->vx_info->vx_initpid; + printk("··· forget_original_parent(%p[#%d],B): initpid=#%d\n", + father, father->pid, initpid); + if (initpid && (father->pid != initpid)) { struct task_struct *r = find_task_by_pid(initpid); if (r != NULL) vchild_reaper = r; - } + } } + printk("··· forget_original_parent(%p[#%d],C): reaper=%p[#%d]\n", + father, father->pid, vchild_reaper, vchild_reaper->pid); for_each_task(p) { - if (p->p_opptr == father) { - /* We dont want people slaying init */ - p->exit_signal = SIGCHLD; - p->self_exec_id++; + if (p->p_opptr != father) + continue; + printk("··· forget_original_parent(%p[#%d],D) child=%p[#%d]\n", + father, father->pid, p, p->pid); + /* We dont want people slaying init */ + p->exit_signal = SIGCHLD; + p->self_exec_id++; - /* Make sure we're not reparenting to ourselves */ + /* Make sure we're not reparenting to ourselves */ + if (p != vchild_reaper) p->p_opptr = vchild_reaper; - - if (p->pdeath_signal) send_sig(p->pdeath_signal, p, 0); + else { + /* should become parent reaper ;) */ + p->p_opptr = child_reaper; + printk("··· forget_original_parent(%p[#%d],E) init=%p[#%d]\n", + father, father->pid, p, p->pid); } + + if (p->pdeath_signal) + send_sig(p->pdeath_signal, p, 0); } read_unlock(&tasklist_lock); } @@ -484,6 +502,9 @@ fake_volatile: if (tsk->binfmt && tsk->binfmt->module) __MOD_DEC_USE_COUNT(tsk->binfmt->module); +// if (current->vx_info && current->vx_info->vx_initpid == tsk->pid) +// current->vx_info->vx_initpid = 0; + printk("··· do_exit(%ld) task=%p[#%d]\n", code, tsk, tsk->pid); tsk->exit_code = code; exit_notify(); schedule(); diff -NurpP --minimal linux-2.4.25-rc1-vs1.3.7/kernel/signal.c linux-2.4.25-rc1-vs1.3.7.1.y/kernel/signal.c --- linux-2.4.25-rc1-vs1.3.7/kernel/signal.c 2004-02-09 12:43:48.000000000 +0100 +++ linux-2.4.25-rc1-vs1.3.7.1.y/kernel/signal.c 2004-02-14 01:41:59.000000000 +0100 @@ -266,10 +266,10 @@ dequeue_signal(sigset_t *mask, siginfo_t { int sig = 0; -#if DEBUG_SIG +// #if DEBUG_SIG printk("SIG dequeue (%s:%d): %d ", current->comm, current->pid, signal_pending(current)); -#endif +//#endif sig = next_signal(current, mask); if (sig) { @@ -790,6 +790,7 @@ void do_notify_parent(struct task_struct struct siginfo info; int why, status; + printk("··· do_notify_parent(%p[#%d], %d)\n", tsk, tsk->pid, sig); info.si_signo = sig; info.si_errno = 0; info.si_pid = tsk->pid; @@ -824,6 +825,10 @@ void do_notify_parent(struct task_struct info.si_code = why; info.si_status = status; +// if (tsk == tsk->p_pptr) +// return; + printk("··· do_notify_parent(%p[#%d]) sig_info: %d, %p[#%d]\n", + tsk, tsk->pid, sig, tsk->p_pptr, tsk->p_pptr->pid); send_sig_info(sig, &info, tsk->p_pptr); wake_up_parent(tsk->p_pptr); }