Re: [PATCH 02/10] job control: introduce JOBCTL_TRAP_STOP and useit for group stop trap

From: Oleg Nesterov
Date: Thu May 19 2011 - 12:20:48 EST


On 05/19, Tejun Heo wrote:
>
> On Wed, May 18, 2011 at 06:48:14PM +0200, Oleg Nesterov wrote:
> > > Although this adds an unlock-relocking between checking of
> > > JOBCTL_STOP_PENDING and actually trapping for STOP, this doesn't
> > > affect correctness.
> >
> > Well, I think it does affect. Although the problem is minor.
> >
> > > ptrace_stop() already had conditional unlock-relocking
> >
> > Yes, but ptrace_stop() can't send the CLD_STOPPED notfication before
> > the tracee is ready for do_wait(WNOHANG). Contrary, get_signal_to_deliver()
> > can if we race with SIGCONT.
>
> That CLD_STOPPED notification is actually for continuation (although
> it's indistinguishible from actual stopped notification) and as such
> the ptracer has to query the tracee state after the notification
> signal and can't expect it to be in TRACED. Please consider the
> following scenario.

OK, agreed.

> > Hmm. And afaics there is a bug in do_signal_stop(), after
> > "[PATCH 6/9] job control: make task_clear_jobctl_pending() clear TRAPPING automatically"
> > ->jobctl &= ~JOBCTL_STOP_SIGMASK is no longer safe. We can clear _TRAPPING
> > without wakeup.
>
> Hmmm? ->jobctl &= ~JOBCTL_STOP_SIGMASK clears lower sixteen bits.
> All the flags including TRAPPING live in the upper sixteen bits.

Indeed, I was confused. Thanks for correcting me.

Oleg.

--
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/