[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110302073236.GC19669@htj.dyndns.org>
Date: Wed, 2 Mar 2011 08:32:36 +0100
From: Tejun Heo <tj@...nel.org>
To: Denys Vlasenko <vda.linux@...glemail.com>
Cc: Oleg Nesterov <oleg@...hat.com>,
Roland McGrath <roland@...hat.com>, jan.kratochvil@...hat.com,
linux-kernel@...r.kernel.org, torvalds@...ux-foundation.org,
akpm@...ux-foundation.org
Subject: Re: [RFC] Proposal for ptrace improvements
Hey,
On Tue, Mar 01, 2011 at 11:59:02PM +0100, Denys Vlasenko wrote:
> Currently strace has to keep precise track on the alternating sequence
> of syscall enter/syscall exit stops. Which gets even trickier
> with extra magic SIGTRAP thrown in by execve and such.
I see. Yeah, it would be a good idea to make sure each trap condition
can be uniquely identified by siginfo and this should definitely be
documented in the man page.
> There were (and I suspect will be) hard to debug bugs when strace
> was getting out-of sync and printing garbage.
>
> Defining the PTRACE_GETSIGINFO's si_code so that each of these stops
> can be easily distinguished would be useful. I propose using values
> of SI_KERNEL + 1, SI_KERNEL + 2 etc, suitably #defined of course.
>
>
> We also have magic SIGSTOPs (magic in a sense they aren't
> real signals sent by other processes):
> * at PTRACE_ATTACH
> * in child (if PTRACE_O_TRACE[V]FORK or PTRACE_O_TRACECLONE opt is on)
>
> For example, flagging PTRACE_ATTACH SIGSTOP so that it can be
> uniquely identified would solve some problems gdb is having with it.
This, I don't agree with. All we need is a better attach call without
the implied SIGSTOP, there's no reason to diddle with PTRACE_ATTACH
further.
Thanks.
--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists