> Agreed, "bool sig_locked" is awful. But we can avoid it. The real problem
> is how to figure out the correct "notify" argument. I'll try to think more,
> but I am not sure I will find the clean solution :(
It does not seem hard if we move tracehook_notify_jctl inside siglock.
> Just in case. We
On 03/15, Roland McGrath wrote:
>
> > Then we re-do this (well, almost) check under ->siglock,
> >
> > } else if (task_is_stopped(target)) {
> > if (!(target->utrace_flags & UTRACE_EVENT(JCTL)))
> > utrace->stopped = stopped = true;
> > }
> >
> > But this is
> I was wrong, I forgot that tracehook_get_signal() doesn't need JCTL.
Right, that is key.
> OK, let's look at utrace_do_stop:
>
> if (task_is_stopped(target) &&
> !(target->utrace_flags & UTRACE_EVENT(JCTL))) {
> utrace->stopped = 1;
> return true;
>
On 03/14, Oleg Nesterov wrote:
>
> On 03/12, Roland McGrath wrote:
> >
> > But, yes, this is a problem. I think this ought to cover it:
> >
> > @@ -1659,6 +1659,16 @@ void utrace_report_jctl(int notify, int what)
> > * longer considered stopped while we run callbacks.
> > */
> > spin
On 03/12, Roland McGrath wrote:
>
> > Yep. And utrace_reset() can be called because ->stopped == 1.
>
> Right.
>
> > Let me explain. Again, let's suppose D attaches engine E to the target T.
> >
> > T enters utrace_report_jctl() with ->stopped == 1.
> >
> > D calls utrace_set_events(events => 0), t
> Yep. And utrace_reset() can be called because ->stopped == 1.
Right.
> Let me explain. Again, let's suppose D attaches engine E to the target T.
>
> T enters utrace_report_jctl() with ->stopped == 1.
>
> D calls utrace_set_events(events => 0), this removes JCTL from E->flags.
>
> D calls, sa
Roland, I left some parts of your message unanswered because I need to think
more about them...
On 03/12, Roland McGrath wrote:
>
> > But, if we enter utrace_report_jctl() with ->stopped == 1, JCTL can be
> > already removed from ->utrace_flags, exactly because ->stopped was true.
>
> I don't foll
> I'd like to ask you to clarify what utrace->stopped means...
I'm very glad you are looking into this area!
> My understanding is: if we see ->stopped == true under utrace->lock, then
> the target can do nothing "interesting" from the utrace's pov. The target
> should take utrace->lock at least
I'd like to ask you to clarify what utrace->stopped means...
My understanding is: if we see ->stopped == true under utrace->lock, then
the target can do nothing "interesting" from the utrace's pov. The target
should take utrace->lock at least once. Either in finish_utrace_stop(), or,
if ->stopped