[lkml]   [2001]   [Sep]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
SubjectRe: [PATCH][RFC] preemptive kernel: ptrace fix
On Sat, 2001-09-22 at 23:52, Robert Love wrote:
> However, doing an `strace strace whatever' (ie, stracing strace), it
> still enters a stopped state about 20% of the time (before the patch, it
> locked almost 100%). I can't figure out why. Comments?

I fixed it. I am not overly sure why it fixes it, but the following
patch (on top of the previous) fixes all the ptrace problems I can find.

In auditing the code, I fixed another problem which I will explain...

I'll put out a final patch in a bit...

diff -urN linux-2.4.9-ac14-preempt/arch/i386/kernel/signal.c linux/arch/i386/kernel/signal.c
--- linux-2.4.9-ac14-preempt/arch/i386/kernel/signal.c Sat Sep 22 23:20:41 2001
+++ linux/arch/i386/kernel/signal.c Sun Sep 23 00:51:15 2001
@@ -611,9 +611,11 @@
if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) {
/* Let the debugger run. */
current->exit_code = signr;
+ ctx_sw_off();
current->state = TASK_STOPPED;
notify_parent(current, SIGCHLD);
+ ctx_sw_on();

/* We're back. Did the debugger cancel the sig? */
if (!(signr = current->exit_code))
@@ -667,11 +669,13 @@

+ ctx_sw_off();
current->state = TASK_STOPPED;
current->exit_code = signr;
if (!(current->p_pptr->sig->action[SIGCHLD-1].sa.sa_flags & SA_NOCLDSTOP))
notify_parent(current, SIGCHLD);
+ ctx_sw_on();

case SIGQUIT: case SIGILL: case SIGTRAP:

Robert M. Love
rml at
rml at

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:03    [W:0.038 / U:1.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site