Re: [PATCH 11/11] ptrace: implement group stop notification for ptracer

From: Denys Vlasenko
Date: Sun May 08 2011 - 18:43:07 EST


On Sunday 08 May 2011 17:49, Tejun Heo wrote:
> Currently there's no way for ptracer to find out whether group stop
> that tracee was in finished other than polling with PTRACE_GETSIGINFO.
> Also, tracer can't detect new group stop started by an untraced thread
> if tracee is already trapped. This patch implements group stop
> notification for ptracer using INTERRUPT traps.
>
> When group stop state of a seized tracee changes, JOBCTL_TRAP_NOTIFY
> is set, which triggers INTERRUPT trap but is sticky until the next
> PTRACE_GETSIGINFO. As GETSIGINFO exports the current group stop
> state, this guarantees that tracer checks the current group stop state
> at least once after group stop state change. Stickiness is necessary
> because notification trap may race with PTRACE_CONT for other traps
> and get lost.

To clarify on "sticky":

Does this mean that if tracer userspace won't query PTRACE_GETSIGINFO,
but will simply do:

waitid(P_PID, tracee, NULL, WSTOPPED);
ptrace(PTRACE_CONT, tracee, NULL, NULL);

then kernel will generate INTERRUPT trap again and again
(without letting tracee run) if job stop state of the tracee has changed?


--
vda
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/