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

Denys Vlasenko dvlasenk at redhat.com
Mon Aug 15 10:01:56 UTC 2011

On Tue, 2011-08-02 at 01:45 +0400, Dmitry V. Levin wrote:
> 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?

The internal_exit function, whose reason for existence is to 
support "detach on exit" behavior, is from 1995.

I tried to test whether this is still needed on kernel 2.4.20,
but this kernel oopses (somewhere in ptrace_check_attach).

Do you think it would be better if we recommend users of
2.4 kernels to simply stick with older strace versions?


More information about the Strace-devel mailing list