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

From: Oleg Nesterov
Date: Tue May 31 2011 - 15:10:20 EST


On 05/30, Linus Torvalds wrote:
>
> Guys, changing interfaces is not going to help user space. The current ones
> may not be wonderful, but they work.
>
> Making up some new "better" interface would be just worse for users, they
> still need to support the old one anyway.

IOW, you are starting to agree that ptrace is not fixable ;)

On a seriouse note, of course you are right, but what we should do?

Speaking of this particular problem, it is really annoying. The leader
exits, and it even notifies the tracer. For what? waitpid() returns 0
or hangs depending on WNOHANG, any ptrace() request fails with ESRCH.

Ironically, recently I got the bug-report which blaims this behaviour,
although it was mentioned many times during the previous discussions.

I agree, we can't change the current behaviour of WEXITED in this case.

I also agree that if we, say, add WPTRACE_EXITED or change the semantics
of WEXITED when the traced leader is PT_SEIZED, then probably this new
feature won't be used by gdb/etc in the forseeable future.

So what should we do?

OK, this particular problem is minor, perhaps we can simply ignore it
and do not try to help the userspace.

But the same objection applies to any new feature in this area. Say,
PTRACE_INTERRUPT. To me, this request is obviously good/useful and
nobody argued so far. But, will it ever be used by gdb? I am not sure,
but at least we add the possibility.

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/