On Mon, Aug 09, 2010 at 06:32:44PM -0700, Roland McGrath wrote: > > There is a possibility to count a process with both CLONE_THREAD and > > CLONE_DETACHED flags set twice, but I'm doubt that such a combination of > > CLONE_ flags is real, since CLONE_DETACHED is officially no-op in kernel > > for a very long time. Maybe it would be even better to drop this > > nclone_detached completely from strace. > > CLONE_DETACHED is indeed obsolete. But when it existed, CLONE_THREAD and > CLONE_DETACHED both being set was the norm. I don't think CLONE_DETACHED > really matters to strace's logic. CLONE_THREAD is what indicates that > exit_group syscalls and fatal signals will kill all sibling threads. > But one should double-check how nclone_detached is being used in strace.
There are exactly two places in the strace code where nclone_detached is checked. First one is that calculation of got_kids in internal_wait() where, if I got all right, nclone_detached should not be taken into account since linux 2.6.2. Second one is handle_group_exit() where nclone_detached is used only if CLONE_THREAD is not in effect; in that case, the use seems to have no consequences. That is, I think that nclone_detached could be safely removed: it would be a no-op change besides a fix for CLONE_THREAD|CLONE_DETACHED handling in internal_wait(). -- ldv
pgpjb8Ezj3mdd.pgp
Description: PGP signature
------------------------------------------------------------------------------ This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev
_______________________________________________ Strace-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/strace-devel
