Cc: Vegard Nossum <vegard.nossum@...>, John Reiser <jreiser@...>, Pekka Enberg <penberg@...>, Linux Kernel Mailing List <linux-kernel@...>, Ingo Molnar <mingo@...>, Peter Zijlstra <a.p.zijlstra@...>, Paul E. McKenney <paulmck@...>, Christoph Lameter <clameter@...>, Daniel Walker <dwalker@...>, Randy Dunlap <randy.dunlap@...>, Josh Aune <luken@...>, Pekka Paalanen <pq@...>
On Sat, May 10, 2008 at 2:37 PM, Andi Kleen <andi@firstfloor.org> wrote:
As long as the compiler is not told to optimize the compiled code,
Valgrind's memcheck tool is able to detect uninitialized local
variables. Valgrind a.o. tracks all updates of the stack pointer. If
the stack pointer is increased, the memory range between the old and
the new stack pointer is marked as undefined. This works as long as
gcc doesn't optimize away individual stack pointer updates. (I'm one
of the Valgrind developers.)
Bart.
--