lkml.org 
[lkml]   [2015]   [Mar]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 6/6] clone4: Introduce new CLONE_FD flag to get task exit notification via fd
On 03/12, Josh Triplett wrote:
>
> @@ -598,7 +600,9 @@ static void exit_notify(struct task_struct *tsk, int group_dead)
> if (group_dead)
> kill_orphaned_pgrp(tsk->group_leader, NULL);
>
> - if (unlikely(tsk->ptrace)) {
> + if (tsk->autoreap) {
> + autoreap = true;
> + } else if (unlikely(tsk->ptrace)) {
> int sig = thread_group_leader(tsk) &&
> thread_group_empty(tsk) &&
> !ptrace_reparented(tsk) ?
> @@ -612,8 +616,10 @@ static void exit_notify(struct task_struct *tsk, int group_dead)
> }
>
> tsk->exit_state = autoreap ? EXIT_DEAD : EXIT_ZOMBIE;
> - if (tsk->exit_state == EXIT_DEAD)
> + if (tsk->exit_state == EXIT_DEAD) {
> list_add(&tsk->ptrace_entry, &dead);
> + clonefd_do_notify(tsk);
> + }

And even ignoring semantics issues, this change looks simply buggy anyway ;)

How can we do list_add(&tsk->ptrace_entry) if it is traced by _another_ task?
->ptrace_entry is used by debugger.

Oleg.



\
 
 \ /
  Last update: 2015-03-14 16:01    [W:0.465 / U:6.068 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site