[lkml]   [2011]   [Sep]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Why I want PTRACE_O_TRACESTOP option
On Fri, September 9, 2011 18:26, Oleg Nesterov wrote:
> On 09/09, Indan Zupancic wrote:
>> It is very useful to set options atomically at SEIZE time.
> Nobody argues with this.
>> Another important reason to make PTRACE_O_TRACESTOP an option is
>> because not everyone uses SEIZE: Users using PTRACE_TRACEME can't
>> set this option at all.
> Yes. This was already discussed, PTRACE_TRACEME obviously doesn't
> work if you need the new features. So far it was decided TRACEME
> should be avoided,

How do you want to attach/seize a just forked child without races
in a less ugly way than with TRACEME?

> but perhaps we can add SEIZE_ME. And, unlike
> TRACEME it should probably stop immediately to simplify the
> synchronization with parent. Afaik, any user of TRACEME does
> something like kill(getpid(), SIGSTOP), this doesn't look very
> good.

I let the child send a SIGTERM to itself, so if anything goes wrong
it terminates. It's only needed because you have to set options.

> But personally I'd prefer to avoid SEIZE_ME.

Me too. There is no need for it if PTRACE_O_TRACESTOP exists.

Alternatively, if you do want to add it, just allow PTRACE_SEIZE
with zero/own PID to achieve the same.



 \ /
  Last update: 2011-09-10 01:13    [W:0.062 / U:11.016 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site