ptrace_attach_task:

        engine = utrace_attach_task(CREATE | EXCLUSIVE);

        err = utrace_set_events();
        WARN_ON(err && !tracee->exit_state);

Looks correct but it is not. utrace_attach_task() can return EINPROGRESS.

Note that start_callback/etc sets ->reporting = engine even if we are not
going to call ->report_any(). I'll try to think, perhaps we can change this
code to check engine->flags first...

Note that EINPROGRESS can happen even if there are no other tracers.
utrace_add_engine() sets ->report and the tracee can call utrace_resume()
before we do utrace_set_events().

I think that it makes sense to check utrace_flags & QUIESCE in utrace_resume()
and return if it is not set. But even with this change EINPROGRESS is still
possible if we have other engines.


But the real problem is, _sometimes_ "make xcheck" triggers this warning,
and I can not understand:

        1. Why I didn't see it before context->options was added

        2. I changed utrace_resume() to check QUIESCE. But I still
           see the warning!

Still investigating...

---

 kernel/ptrace.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- PU/kernel/ptrace.c~23_ATTACH_KILL_WARNING   2009-09-04 19:50:35.000000000 
+0200
+++ PU/kernel/ptrace.c  2009-09-04 19:57:47.000000000 +0200
@@ -505,8 +505,7 @@ static int ptrace_attach_task(struct tas
         * It can fail only if the tracee is dead, the caller
         * must notice this before setting PT_PTRACED.
         */
-       err = __ptrace_set_options(tracee, engine, options);
-       WARN_ON(err && !tracee->exit_state);
+       __ptrace_set_options(tracee, engine, options);
        utrace_engine_put(engine);
        return 0;
 }

Reply via email to