public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <dan@debian.org>
To: Roland McGrath <roland@redhat.com>
Cc: Linus Torvalds <torvalds@osdl.org>,
	Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andrew Cagney <cagney@redhat.com>
Subject: Re: More trouble with i386 EFLAGS and ptrace
Date: Sun, 6 Mar 2005 23:49:20 -0500	[thread overview]
Message-ID: <20050307044920.GA25093@nevyn.them.org> (raw)
In-Reply-To: <200503070316.j273Gb4G027048@magilla.sf.frob.com>

On Sun, Mar 06, 2005 at 07:16:37PM -0800, Roland McGrath wrote:
> > I think mine is more correct; the problem doesn't occur because the
> > debugger cancelled a signal, it occurs because a bogus TF bit was saved
> > to the signal context.  I like keeping solutions close to their
> > problems.  But that's just aesthetic.
> 
> I understand the scenario.  Understanding how it comes about made me
> recognize there is another scenario that is also handled wrong.  
> I didn't say the second scenario was what you are seeing.
> 
> Dan's patch covers the case of PTRACE_SINGLESTEP called to deliver a signal
> that has a handler to run.  That's because there TF is set after the ptrace
> stop, when it's resuming.  This is a "normalize register state" operation.
> I think it would be a little clearer to do this in handle_signal where the
> similar case of tweaking register state to back up a system call is done.
> 
> The patch I posted moves the resetting of TF from the trap handler to
> ptrace_signal_deliver.  This is necessary to ensure that TF is not shown as
> set in the registers retrieved by the debugger when the process stops for
> something other than the single-step trap requested by PTRACE_SINGLESTEP.

Is this semantically different from the patch I posted, i.e. is there
any case which one of them covers and not the other?

> Here is a patch that does both of those things.  This had no effect on any
> of the gdb testsuite cases (for good or ill) aside from sigstep.exp, and:
> 
> $ grep 'FAIL.*sigstep' testsuite/gdb.sum
> KFAIL: gdb.base/sigstep.exp: finish from handleri; leave handler (could not set breakpoint) (PRMS: gdb/1736)
> 
> I don't know what that one is about, but it was KFAIL before the change too.

That is an inability to set breakpoints in the vsyscall page.  Andrew
told me (last May, wow) that he thought this worked in Fedora, but I
haven't seen any signs of the code.  It would certainly be a Good Thing
if it is possible!

> 

-- 
Daniel Jacobowitz
CodeSourcery, LLC

  parent reply	other threads:[~2005-03-07  4:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-06 19:38 More trouble with i386 EFLAGS and ptrace Daniel Jacobowitz
2005-03-06 20:03 ` Linus Torvalds
2005-03-06 21:14   ` Daniel Jacobowitz
2005-03-07  0:46     ` Linus Torvalds
2005-03-06 21:22   ` Roland McGrath
2005-03-06 22:13     ` Daniel Jacobowitz
     [not found]       ` <200503070316.j273Gb4G027048@magilla.sf.frob.com>
2005-03-07  4:49         ` Daniel Jacobowitz [this message]
2005-03-07 21:29           ` Roland McGrath
2005-03-09  0:12             ` Daniel Jacobowitz
2005-03-13  8:27               ` Roland McGrath
2005-03-13 20:06                 ` Daniel Jacobowitz
2005-03-07 19:13     ` Andi Kleen
2005-03-06 20:26 ` Daniel Jacobowitz
  -- strict thread matches above, loose matches on Subject: below --
2005-03-14  4:06 Jesse Allen
2005-03-14  4:12 Jesse Allen

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=20050307044920.GA25093@nevyn.them.org \
    --to=dan@debian.org \
    --cc=cagney@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --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