All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denys Vlasenko <vda.linux@googlemail.com>
To: "Indan Zupancic" <indan@nul.nu>
Cc: "Denys Vlasenko" <dvlasenk@redhat.com>,
	"Oleg Nesterov" <oleg@redhat.com>, "Tejun Heo" <tj@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: RFC: PTRACE_SEIZE needs API cleanup?
Date: Tue, 6 Sep 2011 03:05:19 +0200	[thread overview]
Message-ID: <201109060305.19607.vda.linux@googlemail.com> (raw)
In-Reply-To: <a9c6784bdb67df6d1eb8ccbdefec4e7f.squirrel@webmail.greenhost.nl>

On Monday 05 September 2011 19:44, Indan Zupancic wrote:
> On Mon, September 5, 2011 16:06, Denys Vlasenko wrote:
> > In case you meant that "if we request group-stop notifications by using
> > __WALL | WSTOPPED, and we get group-stop notification, and we do
> > PTRACE_CONT, then task does not run (it sits in group-stop until SIGCONT
> > or death)", then we have a problem: gdb can't use this interface, it
> > needs to be able to restart the thread (only one thread, not all of
> > them, so sending SIGCONT is not ok!) from the group-stop. Yes, it's
> > weird, but it's the real requirement from gdb users.
> [...]
> > SIGCONT's side effect of waking up from group-stop can't be blocked.
> > SIGCONT always wakes up all threads in thread group.
> > Using SIGCONT to control tracee will race with SIGCONTs from other
> > sources.
> >
> > This makes SIGCONT a too coarse instrument for the job.
> [...]
> > Yes... until gdb will want to give user a choice after SIGSTOP: continue
> > to sit in group-stop until SIGCONT (wasn't possible until
> > PTRACE_LISTEN), or continue executing (gdb's current behavior if user
> > uses "continue" command). Therefore, gdb needs a way to do both.
> 
> Having thought a bit more about this, I think this is less of a problem
> than it seems, because for a group stop we get a ptrace event for each
> task, and this should be true for SIGCONT as well. So gdb could also
> always let the group stop happen, and only when prompted to do so by
> a user, continue one thread by sending SIGCONT and letting all the other
> threads hang in trapped state.

Won't work. SIGCONT unpauses all threads in the thread group,
and _then_ it is delivered to one of the threads. You can block
or ignore it, yes, but it is too late: the unpausing already happened,
and blocking/ignoring will only affect SIGCONT handler execution,
if the program has one.

-- 
vda

  reply	other threads:[~2011-09-06  1:05 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-04 21:11 RFC: PTRACE_SEIZE needs API cleanup? Denys Vlasenko
2011-09-05  1:15 ` Indan Zupancic
2011-09-05  9:24   ` Denys Vlasenko
2011-09-05 13:08     ` Indan Zupancic
2011-09-05 14:06       ` Denys Vlasenko
2011-09-05 17:21         ` Indan Zupancic
2011-09-06  0:59           ` Denys Vlasenko
2011-09-06 17:08             ` Indan Zupancic
2011-09-07  2:34               ` Denys Vlasenko
2011-09-07 17:15                 ` Indan Zupancic
2011-09-05 17:44         ` Indan Zupancic
2011-09-06  1:05           ` Denys Vlasenko [this message]
2011-09-06 17:19             ` Indan Zupancic
2011-09-07  2:47               ` Denys Vlasenko
2011-09-07 14:24                 ` Indan Zupancic
2011-09-05 14:54 ` Denys Vlasenko
2011-09-05 16:51 ` [PATCH 1/2] Fix pollution of task->ptrace if PTRACE_SETOPTIONS fails Denys Vlasenko
2011-09-05 17:01 ` [PATCH 2/2] Denys Vlasenko
2011-09-05 17:06 ` [PATCH 2/2] Add new PTRACE_O_TRACESTOP option, make it control new ptrace behavior Denys Vlasenko
2011-09-06 20:08   ` Oleg Nesterov
2011-09-06 23:06     ` Tejun Heo
2011-09-07  4:55     ` Denys Vlasenko
2011-09-07 16:37       ` Oleg Nesterov
2011-09-06 16:52 ` [PATCH v2] Fix clearing of task->ptrace if PTRACE_SETOPTIONS fails Denys Vlasenko
2011-09-06 18:43   ` Oleg Nesterov
2011-09-07  4:44     ` Denys Vlasenko
2011-09-07  4:45     ` [PATCH v3] " Denys Vlasenko
2011-09-07 20:35       ` Oleg Nesterov

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=201109060305.19607.vda.linux@googlemail.com \
    --to=vda.linux@googlemail.com \
    --cc=dvlasenk@redhat.com \
    --cc=indan@nul.nu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@redhat.com \
    --cc=tj@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 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.