From: Roland McGrath <roland@redhat.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Jerome Marchand <jmarchan@redhat.com>,
Denys Vlasenko <dvlasenk@redhat.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] ptrace_untrace: fix the SIGNAL_STOP_STOPPED check
Date: Sun, 8 Feb 2009 17:50:29 -0800 (PST) [thread overview]
Message-ID: <20090209015029.45AA7FC330@magilla.sf.frob.com> (raw)
In-Reply-To: Oleg Nesterov's message of Sunday, 8 February 2009 19:47:30 +0100 <20090208184730.GA27086@redhat.com>
Yes, I believe this is correct. It matches the flip side of the
bookkeeping where we adjust group_stop_count when going into TASK_TRACED
(ptrace_stop). I think it warrants a comment with your change, saying that
treating group_stop_count as "we should be already stopped" is consistent
with decrementing an active group_stop_count when we enter TASK_TRACED.
> - if the process/thread was traced, SIGNAL_STOP_STOPPED
> does not necessary means this thread group is stopped.
>
> - ptrace breaks the bookkeeping of ->group_stop_count.
SIGNAL_STOP_STOPPED is only set when all live threads in the group are in
either TASK_TRACED or TASK_STOPPED. PTRACE_DETACH respects this and this
it stopped. However, PTRACE_CONT et al (ptrace_resume) do not respect it
and can resume an individual thread regardless of SIGNAL_STOP_STOPPED.
That's what you mean here, right?
Doing that without a SIGCONT having been generated is an anomalous way for
a debugger to behave, since it's going to eat the effects of the job
control stop. But who knows that things they do, so this could be sticky
to fix so that SIGNAL_STOP_STOPPED really means all stopped.
> (the comment above ptrace_untrace() doesn't look exactly right too).
How so?
Thanks,
Roland
next prev parent reply other threads:[~2009-02-09 1:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-08 18:47 [PATCH 3/3] ptrace_untrace: fix the SIGNAL_STOP_STOPPED check Oleg Nesterov
2009-02-09 1:50 ` Roland McGrath [this message]
2009-02-09 3:09 ` Oleg Nesterov
2009-02-09 3:59 ` Roland McGrath
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=20090209015029.45AA7FC330@magilla.sf.frob.com \
--to=roland@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=dvlasenk@redhat.com \
--cc=jmarchan@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg@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 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.