Re: [PATCH 03/10] ptrace: implement PTRACE_SEIZE

From: Oleg Nesterov
Date: Mon May 23 2011 - 08:44:50 EST


On 05/18, Tejun Heo wrote:
>
> I've been thinking about Jan's suggestion to make ATTACH and DETACH
> not require tracee to trap. We already have this for DETACH for cases
> where the tracer is killed

Yes, I still think that the new DETACH_XXX request which doesn't need
the stopped tracee makes sense. Yes, we have PTRACE_INTERRUPT. But please
recall the previous discussion, it is possible that the tracee can't
react to PTRACE_INTERRUPT and trap because it waits for other threads
we are tracing.

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).

> and it seems it wouldn't be too difficult
> to make that happen for ATTACH either

Yes, I think this is simple to do. Do we need this? I leave this up
to you and Jan.

To me personally attach-implies-trap looks more natural, but probably
gdb has another opinion.


Anyway. IIUC, gdb wants the auto-attach-on-clone without the trap,
this is more important but this opens a lot of problems.


> and for that to be truly useful
> I suppose PTRACE_SETOPTIONS shouldn't require trapped state either.

Hmm. Why? we could pass this options along with PTRACE_SEIZE?

> Jan, would that be enough for the use cases you have on mind?

Jan?

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/