On 10/22, Roland McGrath wrote: > > > Hmm. If task is not stopped then it is current (except > > utrace_control(DETACH) can play with the dying task). > > Right, asynchronous detach was the problematic case I was concerned with.
but asynchronous detach doesn't do utrace_reset(), unless the tracee is stopped or exiting (->exit_state != 0). > But the whole problem we have is that we aren't getting to > that path when we've done a detach, right? Confused. We already discussed this before, > OK, I'll do some testing and resend right now. In UTRACE_DETACH case > reset can be true but the tracee is running. But I don't think it > makes sense to check target->exit_state == 0, correct? I think it's OK if it's running with ->exit_state set (or even with just PF_EXITING set), i.e. already in kernel mode and never going back to user mode. (Then it's essentially equivalent to calling user_*_step while racing with a SIGKILL death, which has to be OK.) Any other kind of running would not be OK. Probably we misunderstood each other. In any case I agree, that patch was not good. Oleg.