Re: [PATCH] ptrace: add ability to get clear_tid_address

From: Jan Kratochvil
Date: Wed Feb 08 2012 - 14:21:33 EST


On Wed, 08 Feb 2012 20:02:50 +0100, Oleg Nesterov wrote:
> If only I understood why do we need CLONE_CHILD_SETTID... at least
> I certainly do not understand why glibc translates fork() into
> clone(CLONE_CHILD_SETTID) on my system. The child write into its
> memory, the parent can't see this change. IIRC, initially
> CLONE_CHILD_SETTID wrote child->pid into the parent's memory, and
> even before the child was actually created.

IIUC your question correctly it is because if you PTRACE_SYSCALL SYS_fork
(therefore you PTRACE_SYSCALL SYS_clone) twice (therefore you stop on the
fork/clone syscall exit) you should have struct pthread contents valid for
iterating and examinating the thread structures via libthread_db.

This cannot be achieved by any userland code.


Regards,
Jan
--
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/