public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <dan@debian.org>
To: Albert Cahalan <acahalan@gmail.com>
Cc: torvalds@osdl.org, alan@lxorguk.ukuu.org.uk, ak@suse.de,
	mingo@elte.hu, arjan@infradead.org, akpm@osdl.org,
	linux-kernel@vger.kernel.org, roland@redhat.com
Subject: Re: ptrace bugs and related problems
Date: Mon, 31 Jul 2006 15:00:18 -0400	[thread overview]
Message-ID: <20060731190018.GA13735@nevyn.them.org> (raw)
In-Reply-To: <787b0d920607281528w56472db2u81268aad523d5c72@mail.gmail.com>

On Fri, Jul 28, 2006 at 06:28:34PM -0400, Albert Cahalan wrote:
> I was using the data to look up which task just got split away
> from the parent. Judging by Chuck Ebbert's email, I'm not the
> only person to expect the data to be valid.

So it seems!  It seems a reasonable addition if anyone wants to submit
it.

> >Or just present things as if the leader task did the execve, which is
> >effectively what happens, and what I thought would happen for ptrace
> >too.
> 
> That makes things even weirder. A successful execve done in one
> thread appears to be done by another (which might not be
> traced if the debugger was a bit odd), while a failing execve
> appears... where?

Not at all, unless you're doing syscall tracing, I don't think.  The
exec notification is after the mm is replaced.

> >The interface was never designed to handle unsharing.  I don't really
> >think it should be extended to; whoever needs this functionality should
> >design something cleaner for utrace.
> 
> I'm not sure utrace will be accepted. (many ptrace alternatives
> have been born and died over the years) Even if utrace does get
> accepted, initially we only get:
> 
> 1. a clean-up that provides hope for the future
> 2. a hopefully-compatible ptrace on top of utrace
> 3. some sort of demo interface
> 
> That alone won't replace ptrace.

That's why I suggested someone design a cleaner debugging interface to
be implemented on top of utrace - which is how it's supposed to be
used.  Like David, I am confident that this is the future direction of
Linux debugging.

> >> PTRACE_GETSIGINFO has 0x0605 as si_code when a process exits.
> >> This is not defined anywhere.
> >
> >It's garbage.  PTRACE_GETSIGINFO is only valid after the process stops
> >with a signal.
> 
> The process does indeed stop with a signal. It gets SIGTRAP
> as part of sending the ptrace event.

Sure, but you must know what I meant.  PTRACE_GETSIGINFO is only valid
when there is a real signal, i.e. generated by something other than
ptrace.  Which is true whenever wait reports a signal without any of
the special event bits set (except for the legacy SIGTRAP on execve).

-- 
Daniel Jacobowitz
CodeSourcery

  parent reply	other threads:[~2006-07-31 19:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-27  6:55 ptrace bugs and related problems Albert Cahalan
2006-07-27  7:19 ` David Miller
2006-07-27 20:31 ` Daniel Jacobowitz
2006-07-28  1:17   ` Albert Cahalan
2006-07-28  3:47     ` Daniel Jacobowitz
2006-07-28 22:28       ` Albert Cahalan
2006-07-28 22:36         ` David Miller
2006-07-31 19:00         ` Daniel Jacobowitz [this message]
2006-08-01  0:08           ` Albert Cahalan
2006-08-01  1:37             ` Daniel Jacobowitz
2006-08-01  5:22               ` Albert Cahalan
  -- strict thread matches above, loose matches on Subject: below --
2006-07-28 20:07 Chuck Ebbert
2006-07-31  6:21 Chuck Ebbert
2006-08-01  0:30 ` Albert Cahalan
2006-08-01  5:52 Chuck Ebbert

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=20060731190018.GA13735@nevyn.them.org \
    --to=dan@debian.org \
    --cc=acahalan@gmail.com \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=arjan@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=roland@redhat.com \
    --cc=torvalds@osdl.org \
    /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