[PATCH] RFC: do not detach when we think tracee is going to die

Dmitry V. Levin ldv at altlinux.org
Mon Aug 1 21:45:37 UTC 2011


On Sat, Jun 25, 2011 at 11:34:23AM +0200, Denys Vlasenko wrote:
> This is a big change. I am not entirely sure it is correct,
> so this patch is meant more like a RFC rather than a proposal
> to apply it right away.

I've read your series of patches several times and tested it with several
kernel versions.  It looks correct.

> Current code plays some ungodly tricks, trying to not detach
> thread group leader until all threads exit.
> 
> Also, it detaches from a tracee when signal delivery is detected
> which will cause tracee to exit.
[...]
> I need to look in the past to figure out why we even do it.
> First guess is that it's a workaround for old kernel bugs.

How old those buggy kernels might be?

> -#ifdef TCB_GROUP_EXITING
> -			handle_group_exit(tcp, -1);
> -#else
> +			if (!cflag /* && (qual_flags[WTERMSIG(status)] & QUAL_SIGNAL) */ ) {
> +				printleader(tcp);
> +				tprintf("+++ exited with %d +++", WEXITSTATUS(status));
> +				printtrailer();
> +			}
>  			droptcb(tcp);
> -#endif

I agree, this kind of notification is certainly useful.
Maybe some control to suppress it should be provided, though.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20110802/d95e6564/attachment.bin>


More information about the Strace-devel mailing list