public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Children first in fork
@ 2001-04-19 11:35 Éric Brunet
  2001-04-19 12:07 ` David Schwartz
  0 siblings, 1 reply; 11+ messages in thread
From: Éric Brunet @ 2001-04-19 11:35 UTC (permalink / raw)
  To: linux-kernel

Hello all,

I have read on lwn.net that the patch that makes children run first after
a fork has been integrated in the latest pre-kernel.

I am a little bit concerned by that, as I have begun to write a program
that monitors process using ptrace. The difficulty is to ptrace-attach
the child in a fork before it can do anything unmonitored. When the
parent runs first, the return from the fork system called is trapped by
the monitor program which has enough time to ptrace-attach the child. If
the child runs first, it is not even remotely the case anymore.

I understand that performance is more important that the possibility to
ptrace across forks, but I still think that there should be a way to
attach the children of a ptraced-process. Is there currently a way to
achieve this in the kernel that I am not aware of ?

Éric Brunet

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: Children first in fork
@ 2001-04-20 14:56 Mark Kettenis
  2001-04-20 17:49 ` Linus Torvalds
  0 siblings, 1 reply; 11+ messages in thread
From: Mark Kettenis @ 2001-04-20 14:56 UTC (permalink / raw)
  To: linux-kernel; +Cc: wichert, ebrunet, torvalds

The behaviour of CLONE_PTRACE in Linux 2.4.x is different from the
behaviour in 2.2.x.  Linus is describing the 2.4.x. behaviour, where
the program that's doing the tracing will get the events instead of
the "real" parent.  I believe the 2.2.x behaviour was pretty much
useless, and IIRC that was the reason that Linus accepted a patch for
the new behaviour.  I've tested CLONE_PTRACE in the sense that the
development version of GDB contains some code that allows debugging of
any clone() based thread stuff if the threads implementationion
specifies CLONE_PTRACE in its clone() calls.  That way GDB notices new
threads automagically.  It only works on Linux 2.4.x of course, and I
still have to hack something up to make this functionality in GDB
available to the user.

Mark

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2001-04-20 17:51 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-04-19 11:35 Children first in fork Éric Brunet
2001-04-19 12:07 ` David Schwartz
2001-04-19 12:56   ` Éric Brunet
2001-04-19 16:31     ` Wichert Akkerman
2001-04-19 17:58       ` Linus Torvalds
2001-04-20  7:46         ` Wichert Akkerman
2001-04-20 10:13         ` Éric Brunet
2001-04-20 17:47           ` Linus Torvalds
2001-04-20 10:27         ` Thomas Pornin
  -- strict thread matches above, loose matches on Subject: below --
2001-04-20 14:56 Mark Kettenis
2001-04-20 17:49 ` Linus Torvalds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox