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

Denys Vlasenko dvlasenk at redhat.com
Wed Aug 17 17:33:57 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?

We might have moderately bad news. I tested current git
on 2.4.32 kernel (ISO image from
http://mirrors.kernel.org/openwall/Owl/2.0-release/iso/Owl-2.0-release-i386.iso.gz
)

and test/childthread.c testcase apparently shows that exit_group
syscall *returns* under ptrace.

IOW: the "detach before exit" might be a necessity even
on latest 2.4 kernels. Need to test 2.4.37...

-- 
vda






More information about the Strace-devel mailing list