Sent on 2010-9-8 9:06, Roland McGrath wrote:
> On its face, there is no good reason why any one clone call ought to be
> treated different from another, in current kernels.  In practice, nobody
> ever uses CLONE_UNTRACED today.  AFAIK, it was only ever used by some
> old versions of linuxthreads (which has been obsolete for ages), and
> even those only wanted it for some ancient kernel versions where the
> ptrace wait interference was even worse than it is on non-ancient kernels.
> 
> I imagine that your motivation is to make strace's -f behavior today
> match what it would do if implemented via PTRACE_O_TRACECLONE, where
> we'd give up the option of tracing CLONE_UNTRACED children.  If that's
> so, then just be clear about it.
Yes, so it is. Actually, I am not sure whether there are someone or some
librarys using such flag. But I think since this flag still exists in
kernel, and maybe will not disappear in the near future, keep the same
logic with kernel may be a good idea.

> 
> Now, to the change itself.
> 
> I don't see why you've added a flag and everything.
> What doesn't work about just doing this:
> 
> diff --git a/process.c b/process.c
> index 59d7ba0..ebba77b 100644
> --- a/process.c
> +++ b/process.c
> @@ -796,7 +796,7 @@ int
>  internal_fork(struct tcb *tcp)
>  {
>       if (entering(tcp)) {
> -             if (!followfork)
> +             if (!followfork || (tcp->u_arg[ARG_FLAGS] & CLONE_UNTRACED))
>                       return 0;
>               fork_tcb(tcp);
>               if (setbpt(tcp) < 0)
> 
Yeah, I forgot the macro ARG_FLAGS. This change seems much simpler and
it's a good idea. Also we may add this check on syscall exit.

Thanks,
Wang Chao


------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Strace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to