public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: John Blackwood <john.blackwood@ccur.com>
To: linux-kernel@vger.kernel.org
Cc: ak@suse.de, bugsy@ccur.com, roland@redhat.com, akpm@osdl.org
Subject: Re: [PATCH] ptrace(2) single-stepping into signal handlers
Date: Mon, 06 Jun 2005 08:54:07 -0400	[thread overview]
Message-ID: <42A4476F.2070704@ccur.com> (raw)

 > Subject: Re: [PATCH] ptrace(2) single-stepping into signal handlers
 > From: Andi Kleen <ak@suse.de>
 > Date: Sun, 5 Jun 2005 13:21:19 +0200
 > To: John Blackwood <john.blackwood@ccur.com>
 > CC: linux-kernel@vger.kernel.org, roland@redhat.com, ak@suse.de, 
akpm@osdl.org, bugsy@ccur.com
 >
 > On Fri, Jun 03, 2005 at 01:21:20PM -0400, John Blackwood wrote:
 >
 > >> 1. Make the default behavior that we single-step to the next 
instruction
 > >>    in the main (non-signal handler) stream of execution, instead of
 > >>    single-stepping into the user's signal handler.
 >
 >
 > I think it is better to not change the default behaviour. You risk
 > breaking programs and there are much more that use ptrace than just gdb.

O.K.  Yes, it seems that this is definitely not a popular idea.   :-)


 > >> 2. Add a new ptrace PTRACE_SETOPTIONS command flag,
 >
 >
 > I think it would be better to just define a new ptrace singlestep command
 > with the new semantics instead of adding options.

Yes, this is a good idea...  I just might re-post this approach
as a suggestion.


 > >> - The ptraced process has a pending signal and
 > >>   it stops to notify the debugger.
 > >>
 > >> - The debugger then single-steps into the ptraced process's signal 
handler.
 > >>
 > >> - On the next eventual continue (PTRACE_CONT) command, we run 
through the
 > >>   signal handler, and we stop once again at the next instruction 
before
 > >>   we changed our execution stream and single-stepped into the user's
 > >>   signal handler.
 > >>
 > >> - At this point, we can no longer continue the ptraced process
 > >>   with a PTRACE_CONT command.  Instead, all ptrace(2) PTRACE_CONT 
calls
 > >>   are treated as if we had made a ptrace(2) PTRACE_SINGLESTEP call.
 >
 >
 > Have you actually seen this in practice?

Yes, but Andrew Morton suggested I try out the above test scenario on:

 
ftp://ftp.kernel.org/pub/linux/kernel/v2.6/testing/linux-2.6.12-rc5.tar.bz2

And the problem has indeed been fixed - there is some new code in the
i386 version of handle_signal() that fixes this problem.

(I saw the problem on earlier 2.6.11.10 and 2.6.11.11 kernels.)


Thanks for the feedback, Andrew.



             reply	other threads:[~2005-06-06 12:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-06 12:54 John Blackwood [this message]
     [not found] <d7q7jf$2s8$1@trex.ccur.com>
2005-06-04 13:03 ` [PATCH] ptrace(2) single-stepping into signal handlers John Blackwood
  -- strict thread matches above, loose matches on Subject: below --
2005-06-03 18:07 John Blackwood
2005-06-03 18:11 ` Daniel Jacobowitz
2005-06-03 17:21 John Blackwood
2005-06-03 17:34 ` Daniel Jacobowitz
2005-06-05 11:21 ` Andi Kleen
2005-06-05 14:37   ` cutaway

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=42A4476F.2070704@ccur.com \
    --to=john.blackwood@ccur.com \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=bugsy@ccur.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=roland@redhat.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