On 03/29, Oleg Nesterov wrote:Also, I think ptrace_exit() is not right, if (p->exit_signal != -1 && !thread_group_empty(p)) do_notify_parent(p, p->exit_signal); note the "!thread_group_empty()" above, I guess this is typo, thread group must be empty if we are going to release the task or notify its parent. IOW, perhaps something like the patch below makes sense. Oleg. --- x/kernel/exit.c~x 2008-03-29 17:14:54.000000000 +0300 +++ x/kernel/exit.c 2008-03-29 17:28:17.000000000 +0300 @@ -596,6 +596,16 @@ static void exit_mm(struct task_struct * mmput(mm); } +static void xxx(struct task_struct *p, struct list_head *dead) +{ + if (p->exit_state == EXIT_ZOMBIE) { + if (p->exit_signal != -1 && thread_group_empty(p)) + do_notify_parent(p, p->exit_signal); + if (p->exit_signal == -1) + list_add(&p->ptrace_list, dead); + } +} + /* * Detach any ptrace attachees (not our own natural children). * Any that need to be release_task'd are put on the @dead list. @@ -616,12 +626,7 @@ static void ptrace_exit(struct task_stru * reap itself, add it to the @dead list. We can't call * release_task() here because we already hold tasklist_lock. */ - if (p->exit_state == EXIT_ZOMBIE) { - if (p->exit_signal != -1 && !thread_group_empty(p)) - do_notify_parent(p, p->exit_signal); - if (p->exit_signal == -1) - list_add(&p->ptrace_list, dead); - } + xxx(p, dead); } } @@ -661,13 +666,6 @@ static void reparent_thread(struct task_ if (p->exit_signal != -1) p->exit_signal = SIGCHLD; - /* If we'd notified the old parent about this child's death, - * also notify the new parent. - */ - if (p->exit_state == EXIT_ZOMBIE && - p->exit_signal != -1 && thread_group_empty(p)) - do_notify_parent(p, p->exit_signal); - /* * process group orphan check * Case ii: Our child is in a different pgrp @@ -720,6 +718,7 @@ static void forget_original_parent(struc p->parent = p->real_parent; } reparent_thread(p, father); + xxx(p, &ptrace_dead); } write_unlock_irq(&tasklist_lock); --
| David Miller | Slow DOWN, please!!! |
| KAMEZAWA Hiroyuki | Re: 2.6.22-rc1-mm1 |
| Steven Rostedt | [RFC PATCH 1/3] Unified trace buffer |
| Steven Rostedt | [RFC PATCH 0/6] Convert all tasklets to workqueues |
git: | |
| Peter Klavins | Re: CRLF problems with Git on Win32 |
| J. Bruce Fields | Re: Git User's Survey 2007 unfinished summary continued |
| Linus Torvalds | Re: VCS comparison table |
| Junichi Uekawa | Re: [ANNOUNCE] GIT 1.5.4 |
| Arjan van de Ven | Re: [GIT]: Networking |
| Rémi | [PATCH 0/6] [RFC] Phonet pipes protocol (v2) |
| Jarek Poplawski | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Jozsef Kadlecsik | Re: TCP connection stalls under 2.6.24.7 |
| Richard Stallman | Real men don't attack straw men |
| Rogier Krieger | Re: bcw(4) is gone |
| Leon Dippenaar | New tcp stack attack |
| Brandon Lee | DELL PERC 5iR slow performance |
| high memory | 5 hours ago | Linux kernel |
| semaphore access speed | 8 hours ago | Applications and Utilities |
| the kernel how to power off the machine | 9 hours ago | Linux kernel |
| Easter Eggs in windows XP | 12 hours ago | Windows |
| Shared swap partition | 13 hours ago | Linux general |
| Root password | 13 hours ago | Linux general |
| Where/when DNOTIFY is used? | 15 hours ago | Linux kernel |
| How to convert Linux Kernel built-in module into a loadable module | 17 hours ago | Linux kernel |
| Linux 2.6.24 and I/O schedulers | 18 hours ago | Linux kernel |
| USB Driver -- Interrupt Polling -- A Little Help Please | 23 hours ago | Linux general |
