mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <dan@debian.org>
To: John Reiser <jreiser@BitWagon.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: ptrace unexpected SIGTRAP (trace bit) on x86, x86_64  kernel 2.6.13.2
Date: Thu, 29 Sep 2005 20:47:54 -0400	[thread overview]
Message-ID: <20050930004754.GA26866@nevyn.them.org> (raw)
In-Reply-To: <433C0F21.8070104@BitWagon.com>

On Thu, Sep 29, 2005 at 08:58:25AM -0700, John Reiser wrote:
> Ptrace is giving unexpected SIGTRAP (trace bit) in kernel 2.6.13.2
> on both x86 and x86_64.
> 
> The 8-instruction program below just execve()s itself over and over.
> When run under gdb, the first user-visible SIGTRAP is expected due to
> the 'int3'.  But the second user-visible SIGTRAP is unexpected, as
> there is no reason to trap.
> 
> Changing the line "nop; int3" to "nop; nop" gives a program that
> just spins merrily when run under /bin/bash.  But gdb sees a SIGTRAP,
> with the $pc pointing after the second 'nop'.  When run under strace
> (strace gdb ./execve; (gdb) run), the process spins merrily with
> no unexpected SIGTRAP.

Most likely GDB is receiving the SIGTRAP generated by execve().  I
don't know why it would appear to be after the int3 rather than before.
GDB has strictly limited support for programs which exec, mostly due to
thorny user interface issues.

-- 
Daniel Jacobowitz
CodeSourcery, LLC

      reply	other threads:[~2005-09-30  0:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-29 15:58 John Reiser
2005-09-30  0:47 ` Daniel Jacobowitz [this message]

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=20050930004754.GA26866@nevyn.them.org \
    --to=dan@debian.org \
    --cc=jreiser@BitWagon.com \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®