From: Robert Love <rml@ufl.edu>
To: Robert Love <rml@tech9.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH][RFC] preemptive kernel: ptrace fix
Date: 23 Sep 2001 01:18:08 -0400 [thread overview]
Message-ID: <1001222290.864.3.camel@phantasy> (raw)
In-Reply-To: <1001217135.1390.19.camel@phantasy>
In-Reply-To: <1001217135.1390.19.camel@phantasy>
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);
schedule();
+ ctx_sw_on();
/* We're back. Did the debugger cancel the sig? */
if (!(signr = current->exit_code))
@@ -667,11 +669,13 @@
/* FALLTHRU */
case SIGSTOP:
+ 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);
schedule();
+ ctx_sw_on();
continue;
case SIGQUIT: case SIGILL: case SIGTRAP:
--
Robert M. Love
rml at ufl.edu
rml at tech9.net
prev parent reply other threads:[~2001-09-23 5:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-09-23 3:52 [PATCH][RFC] preemptive kernel: ptrace fix Robert Love
2001-09-23 5:18 ` Robert Love [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=1001222290.864.3.camel@phantasy \
--to=rml@ufl.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=rml@tech9.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.