Re: [ANNOUNCE] kmemcheck v7

From: Jeremy Fitzhardinge
Date: Sat May 10 2008 - 19:05:33 EST


John Reiser wrote:
The valgrind+uml patches added a callback, "I am switching stacks >NOW<."
Hm, I never particularly liked that approach because unless you do the whole thing in assembly it was never certain that there wasn't a basic-block break between them (ie, atomic with respect to valgrind). For the kernel that may be possible, but I was thinking of the general case where you might want to use setjmp or something.

If possible then it is better to tell an interpreter what is happening,
rather than requiring that the interpreter [try to] figure it out.

Matter of taste really, but I tend to disagree. If you say something like "addresses A-B, C-D, E-F are stacks", then the stack pointer changing from the range A-B to C-D is a pretty clear indication of stack switch, regardless of the mechanism you use to do it. Of course, an explicit hint prevents an accidental push/pop of 32k onto an 8K stack from being considered a stack switch, but unless you actually know where the stacks are, you can't warn about it or prevent it from validating/invalidating a pile of innocent memory.

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