On 10/25, Oleg Nesterov wrote: > > But even before that comment, I do not think that !engine->ops check > can prevent the race with ->report_reap(), we need at least mb() > in utrace_maybe_reap() before "engine->ops = NULL".
This reminds me that in theory finish_callback() probably needs mb() too before it clears ->reporting. In particular, see https://www.redhat.com/archives/utrace-devel/2009-October/msg00132.html and further messages. In https://www.redhat.com/archives/utrace-devel/2009-October/msg00163.html you replied that debugger can add the barriers itself, this is true. But then I don't understand the semantics of utrace_barrier() when debugger uses it after utrace_control(UTRACE_DETACH). We need utrace_barrier() to ensure that it is safe to destroy engine->data, etc. But this is very close to the artificial example with "ereference(ptr)". I am a bit lost... Oleg.