Re: [PATCH 1/1] prctl: pdeath_signal sent when parent thread(instead of parent process) dies

From: Oleg Nesterov
Date: Fri Jun 01 2012 - 15:04:07 EST


On 05/29, Filipe Brandenburger wrote:
>
> --- a/kernel/exit.c
> +++ b/kernel/exit.c
> @@ -806,7 +806,8 @@ static void forget_original_parent(struct task_struct *father)
> BUG_ON(t->ptrace);
> t->parent = t->real_parent;
> }
> - if (t->pdeath_signal)
> + if (t->pdeath_signal &&
> + !same_thread_group(father, reaper))
> group_send_sig_info(t->pdeath_signal,
> SEND_SIG_NOINFO, t);
> } while_each_thread(p, t);

Filipe, you can't even imagine how much do I like this change
personally ;) Although I think that pdeath_signal code should
be moved into reparent_leader(). I suggested this many times.

But I was told there are users which depend on current behaviour,
they really want to know when the parent _thread_ exits.

Why? I have no idea. And I agree this is ugly, but we can't
break user-space.

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/