Bug: report_reap is never called

2009-09-05 Thread Renzo Davoli
Hi Ronald & utrace developers

I am back...

I am upgrading my kmview support and I have stepped into a clear bug.

in utrace_reap:

--
list_for_each_entry_safe(engine, next, &utrace->attached, entry) {
ops = engine->ops;
engine->ops = NULL;
engine->flags = 0;
list_move(&engine->entry, &detached);

/*
 * If it didn't need a callback, we don't need to drop
 * the lock.  Now nothing else refers to this engine.
 */
if (!(engine->flags & UTRACE_EVENT(REAP)))
  continue;


The code following this 'if' is never executed (i.e. the reap callback never
called).
In fact it is impossible for (engine->flags & UTRACE_EVENT(REAP)) to be
true given that a few statement above engine->flags has been set to 0!

To fix the bug:
clean all the events but reap:
engine->flags &= UTRACE_EVENT(REAP);
or save the flag in a temporary var before cleaning it, as you do for 
engine->ops.

ciao
renzo



Re: Bug: report_reap is never called

2009-09-07 Thread Roland McGrath
Oops!  I broke that in d4bcb571, a change I no longer remember the reason
for.  I'm sure it was for a subtler bug Oleg noticed, should be a thread in
this archive about it.

Should be fixed now in commit 2e12892.


Thanks,
Roland