Re: [PATCH] list_head debugging?

From: Robert Love (rml@tech9.net)
Date: Fri Sep 20 2002 - 16:34:36 EST


On Fri, 2002-09-20 at 16:53, Zach Brown wrote:

> A friend recently was bitten by passing a list_head from list_for_each
> to a code path that later moved the list_head around. Does the attached
> patch re-create some debugging wheel that's hiding off in a corner
> somewhere?
>
> Beyond catching the obvious use of uninitialized things, it also seems
> to catch double adds, double deletes, and simple deletes of 'pos' in
> list_for_each. it even seems to bark about the seemingly hard-to-detect
> movement of 'pos' from the iterating list to another, but probably only
> in the rare case where you're unconditionally moving all 'pos' in the
> loop body. (you eventually iterate into the second list's head and try
> to add it to itself)

Hey, cool!

Yes, I think a lot of people would be all for something like this as a
CONFIG_DEBUG_LISTS or such. Very nice.

        Robert Love

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Sep 23 2002 - 22:00:32 EST