Konstantin Serebryany
2009-05-18 08:11:05 UTC
Hello Memcheckers,
I've got a complain from a novice memcheck user about a confusing message:
% cat stack_uninit.c
int main() {
int unrelated[100];
// ...
int uninited[10];
return uninited[3] ? 1 : 0;
}
% ~/valgrind/trunk/Inst/bin/valgrind -q --track-origins=yes ./a.out
==25539== Syscall param exit_group(status) contains uninitialised byte(s)
...
==25539== Uninitialised value was created by a stack allocation
==25539== at 0x4004B0: main (stack_uninit.c:1)
The stack 'main (stack_uninit.c:1)' points to the beginning of the
function's code .
Is it possible to get the exact line where the uninitialized stack
object was created (line 4 instead of line 1)?
If this is hard or impossible, could you change the message text to
make it less confusing?
Something like: 'Uninitialised value was created by a stack allocation
at or after this point:'.
Thanks,
--kcc
I've got a complain from a novice memcheck user about a confusing message:
% cat stack_uninit.c
int main() {
int unrelated[100];
// ...
int uninited[10];
return uninited[3] ? 1 : 0;
}
% ~/valgrind/trunk/Inst/bin/valgrind -q --track-origins=yes ./a.out
==25539== Syscall param exit_group(status) contains uninitialised byte(s)
...
==25539== Uninitialised value was created by a stack allocation
==25539== at 0x4004B0: main (stack_uninit.c:1)
The stack 'main (stack_uninit.c:1)' points to the beginning of the
function's code .
Is it possible to get the exact line where the uninitialized stack
object was created (line 4 instead of line 1)?
If this is hard or impossible, could you change the message text to
make it less confusing?
Something like: 'Uninitialised value was created by a stack allocation
at or after this point:'.
Thanks,
--kcc