From: Daniel Jacobowitz <dan@debian.org>
To: Greg <gkurz@fr.ibm.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: sigsuspend() and ptrace()
Date: Fri, 18 Nov 2005 23:22:40 -0500 [thread overview]
Message-ID: <20051119042240.GA31395@nevyn.them.org> (raw)
In-Reply-To: <436B228D.2000309@fr.ibm.com>
On Fri, Nov 04, 2005 at 09:57:49AM +0100, Greg wrote:
> Hi,
>
> My program uses gdb to attach to a process and make it execute a specific
> function thanks to the gdb 'call' command. This works quite well unless the
> attached process is sleeping in sigsuspend(). I peeked into the kernel sources
> and saw that the typical sigsuspend() implementation is like this :
>
> while (1) {
> schedule();
> if (do_signal())
> return -EINTR;
> }
>
> When using ptrace attach, the target process receives a SIGSTOP but there
> isn't *of course* any handler to SIGSTOP. And no way for the process to return
> to userland... is it implemented that way on purpose ? How can I make suspending
> processes do some *alternative* work with gdb ?
Sorry, I'm a bit behind on lkml.
What's _supposed_ to happen is that sigsuspend should be interrupted by
the SIGSTOP even though there is no handler. SIGSTOP can't be blocked.
You didn't say what kernel version or architecture you were having
trouble with; which is it? It looks right in current 2.6 for i386 and
ppc, which were the only ones I checked.
--
Daniel Jacobowitz
CodeSourcery, LLC
next prev parent reply other threads:[~2005-11-19 4:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-04 8:57 sigsuspend() and ptrace() Greg
2005-11-19 4:22 ` Daniel Jacobowitz [this message]
2005-11-23 20:23 ` Greg
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=20051119042240.GA31395@nevyn.them.org \
--to=dan@debian.org \
--cc=gkurz@fr.ibm.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