lkml.org 
[lkml]   [2008]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: inconsistent behavior with ptrace(TRACEME) and fork/exec
On Mon, Oct 27, 2008 at 10:56, Jan Kratochvil wrote:
> On Wed, 19 Jul 2006 21:18:29 +0200, Mike Frysinger wrote:
>> my understanding is that if a parent forks and the child does
>> a ptrace(TRACEME) right before doing an exec(), the kernel should always
>> halt it and wait indefinitely for the parent to start ptracing it.
>
> Yes, just the parent must process the event (signal). In your testcase the
> parent finished before the signal could be delivered. If the tracer exits the
> tracee's tracing is finished and it continues freely.

no signal should have been generated. the child should have gone
straight to the exec and waited for the parent to process it.

>> unfortunately, this behavior seems to be unreliable.
>
> Fixed the races in your code and I do not see there any problem, do you?
> The ptrace problems/testsuite is being maintained at:
> http://sourceware.org/systemtap/wiki/utrace/tests

there is no race condition ... it's using vfork here remember ? it is
impossible for the parent to have executed anything after the vfork()
before the child made it into the exec() and gone to sleep
-mike


\
 
 \ /
  Last update: 2008-10-27 18:41    [W:0.069 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site