Messages in this thread | | | Subject | Re: [PATCH] list_head debugging? | From | Robert Love <> | Date | 20 Sep 2002 17:34:36 -0400 |
| |
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/
| |