Re: More waitpid issues with CLONE_DETACHED/CLONE_THREAD

From: Linus Torvalds
Date: Sun Feb 01 2004 - 00:14:47 EST




On Sat, 31 Jan 2004, Daniel Jacobowitz wrote:
> >
> > Can you verify that that process doesn't have any sub-threads? (Again,
> > that should be easily visible in /proc/<pid>/task/).
>
> It is quite easily visible - in fact, it's hilarious.
>
> 8454 pts/8 Z 0:00 [linux-dp] <defunct>
>
> drow@nevyn:~% ls /proc/8454
> auxv cmdline cwd@ environ exe@ fd/ maps mem mounts root@ stat
>
> drow@nevyn:~% ls /proc/8454/task
> ls: /proc/8454/task: No such file or directory

Oh damn. Yeah, we don't allow you to even see the threads in this case (it
checks "pid_alive(task)". We don't want you to try to confuse things by
opening files of processes that we think are dead.

For the case of trying to figure out sub-threads of a dead thread group
leader, that may actually be a bug.

Just for testing this, you might remove the check for

if (!pid_alive(task))
goto out;

in proc_pident_lookup() in fs/proc/base.c.

Ingo - comments? We really want the sysadmin to be able to find threads
that have a dead group leader, and right now that seems to be impossible.

Linus
-
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/