[lkml]   [2011]   [May]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 03/10] ptrace: implement PTRACE_SEIZE

On Wed, May 25, 2011 at 08:29:19PM +0200, Oleg Nesterov wrote:
> > > And. Currently there is no way to detach a zombie leader. Perhaps we
> > > should change do_wait(), but it is not clear what should we do if the
> > > tracer is the real parent (we already discussed this a bit).
> >
> > Hmmm... maybe just allow detaching zombie leader?
> Yes, I think we should do this.
> If we change PTRACE_DETACH (or add the new request) to allow this, then
> I think it it should detach any zombie, leader or not.

I think we can just make PTRACE_DETACH to succeed for zombies. No
reason to add a new request for this.

> Or we can change do_wait() to detach a zombie leader. In this case it
> is not clear what should we do if the debugger is the real parent.
> Perhaps do_wait() should do the same: detach a leader (but not reap).
> When the last thread does, the real parent will be notified again.
> IOW, wait(tgid) can succeed twice.

Just letting PTRACE_DETACH work for zombies sounds much simpler to me.

> > As it's guaranteed to be not running, we don't have problem with
> > ptrace_disable.
> Agreed. In fact it can be running, but it can't return to the user-space,
> and I think this is enough.
> ptrace_detach()->ptrace_disable() can race with SIGKILL anyway, this means
> it should safe to call it if the tracee is exiting/exited.

Yeap, unless userland gets to run again, I don't think there's any



 \ /
  Last update: 2011-05-26 11:17    [W:0.112 / U:0.624 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site