lkml.org 
[lkml]   [2005]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: sigsuspend() and ptrace()
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-11-19 05:25    [W:0.112 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site