Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch] Fix attaching to Linux stopped processes
Date: Sun, 17 Sep 2006 22:26:00 -0000	[thread overview]
Message-ID: <20060917222622.GA2150@nevyn.them.org> (raw)
In-Reply-To: <20060917221228.GA17263@host0.dyn.jankratochvil.net>

On Mon, Sep 18, 2006 at 12:12:28AM +0200, Jan Kratochvil wrote:
> Hi,
> 
> sleep 1h& pid=$!; kill -STOP $pid; gdb sleep $pid
> 	->
> Attaching to program: /bin/sleep, process 20768
> ../../gdb/linux-nat.c:1057: internal-error: linux_nat_attach: Assertion `pid == GET_PID (inferior_ptid) && WIFSTOPPED (status) && WSTOPSIG (status) == SIGSTOP' failed.

> +  /* Do not check `WSTOPSIG (status) == SIGSTOP' as the status may be
> +     arbitrary - depending on the signal that stopped the processes.
> +     If the process was running we get SIGSTOP, if it was already stopped
> +     by SIGSTOP we get 0.  The value gets used for `PTRACE_CONT'.  */

That's a very strange behavior.  It doesn't make much sense to me, and
it isn't familiar - which is strange because I've been all over the
kernel code for this.  So I checked.  Sure enough, on my 2.6.18-rc4
installation, this is _not_ what happens.  Instead, the traditional
thing happens: wait hangs and no new event is returned.

Is this new in kernel.org?  Or is it a Red Hat kernel patch?  Where
did it come from?

-- 
Daniel Jacobowitz
CodeSourcery


  reply	other threads:[~2006-09-17 22:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-17 22:12 Jan Kratochvil
2006-09-17 22:26 ` Daniel Jacobowitz [this message]
2006-09-18  9:53   ` Jan Kratochvil
2006-09-18 13:16     ` Daniel Jacobowitz
2006-09-18 20:49       ` Jan Kratochvil
2006-09-18 20:54         ` Daniel Jacobowitz
2006-09-23 17:37     ` Mark Kettenis
2006-09-25 10:52       ` Jan Kratochvil

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=20060917222622.GA2150@nevyn.them.org \
    --to=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@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