From: Daniel Jacobowitz <dan@debian.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: Dave McCracken <dmccr@us.ibm.com>,
Linus Torvalds <torvalds@transmeta.com>,
linux-kernel@vger.kernel.org
Subject: Re: [patch] O(1) sys_exit(), threading, scalable-exit-2.5.31-A6
Date: Mon, 19 Aug 2002 23:21:30 -0400 [thread overview]
Message-ID: <20020820032130.GA15912@nevyn.them.org> (raw)
In-Reply-To: <Pine.LNX.4.44.0208192251540.2201-100000@localhost.localdomain>
On Mon, Aug 19, 2002 at 10:59:17PM +0200, Ingo Molnar wrote:
>
> On Mon, 19 Aug 2002, Dave McCracken wrote:
>
> > In looking at the code I was wondering something. What happens to the
> > real parent of a ptraced task when it calls wait4()? If that's its only
> > child, won't it return ECHILD?
>
> hm, so this could be fixed by iterating over the ptraced tasks as well
> when doing a wait4.
>
> the problem is that the debugger wants to do a wait4 as well, to receive
> the SIGSTOP result. Now if the original parent 'steals' the wait4 result,
> what will happen?
>
> this whole mess can only be fixed by decoupling the ptrace() mechanism
> from signals and wait4 completely, it's a nasty relationship that infests
> both the kernel and userspace code [check out strace.c once to see the
> kind of pain it has to go through to isolate ptrace events from other
> signals.]
>
> I'm not quite sure whether this is possible, how deeply do ptrace
> applications depend on a real SIGSTOP signal interrupting the task? Would
> it be equally good if it was a different interruption/signalling method
> that did this? [with a few minor and straightforward cleanups to entry.S i
> think we could use a task ornament flag for ptrace interruption. This
> would result in a few orders better behavior on all fronts.]
I have in my mailbox somewhere the beginnings of an implementation of
this, from David Howells (the ornaments approach); I think he ran out
of time to work on it. Rather than pursue it, if there's someone
interested in giving Linux a way to access at least some of the
Solaris/BSD procfs debug interface...
The biggest problem with ptrace is the way it overloads signals. It
makes figuring out what events are pretty tricky (see the patches I
just posted for some workarounds on this), and it makes debugging a
signal-intensive process extremely awkward. For instance, in a lot of
cases you'll lose or confuse the realtime payload entirely.
I don't think there is anything you could do here that would not break
strace/gdb's uses of ptrace, however; any incremental changes would
toast them.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
next prev parent reply other threads:[~2002-08-20 3:17 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-19 12:16 [patch] O(1) sys_exit(), threading, scalable-exit-2.5.31-A6 Ingo Molnar
2002-08-19 16:15 ` [patch] O(1) sys_exit(), threading, scalable-exit-2.5.31-B4 Ingo Molnar
2002-08-19 17:42 ` [patch] O(1) sys_exit(), threading, scalable-exit-2.5.31-A6 Linus Torvalds
2002-08-19 17:44 ` Larry McVoy
2002-08-19 18:08 ` Ingo Molnar
2002-08-19 18:31 ` Dave McCracken
2002-08-19 18:36 ` Ingo Molnar
2002-08-19 18:51 ` Dave McCracken
2002-08-19 19:37 ` Ingo Molnar
2002-08-19 20:59 ` Ingo Molnar
2002-08-19 21:01 ` Dave McCracken
2002-08-19 21:29 ` Linus Torvalds
2002-08-19 21:42 ` Dave McCracken
2002-08-19 22:36 ` Ingo Molnar
2002-08-20 14:32 ` Dave McCracken
2002-08-20 14:36 ` Ingo Molnar
2002-08-27 15:39 ` Daniel Jacobowitz
2002-08-28 2:53 ` Daniel Jacobowitz
2002-08-20 3:21 ` Daniel Jacobowitz [this message]
2002-08-19 19:10 ` Linus Torvalds
2002-08-19 18:55 ` george anzinger
2002-08-19 19:15 ` Ingo Molnar
2002-08-19 20:03 ` george anzinger
2002-08-20 10:36 ` Richard Zidlicky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020820032130.GA15912@nevyn.them.org \
--to=dan@debian.org \
--cc=dmccr@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=torvalds@transmeta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox