|
From: <arn...@re...> - 2003-11-03 15:22:05
|
Hello !
I am on Linux 7.2 and using valgrind-20030725.
I used the following test program :
#include <stdio.h>
int main()
{
char *str;
char str2[3];
char str3[3];
printf("Hello World !\n");
/* str = (char *)malloc(5);
strcpy(str, "123456");
str = (char *)malloc(6);
printf("str = %s\n", str);
*/
printf("str2[5] = %c\n", str2[5]);
strcpy(str2, "1234567890");
printf("str2[5] = %c\n", str2[5]);
printf("str2[15] = %c\n", str2[15]);
strcpy(str3, "1234567890");
printf("str3[5] = %c\n", str3[5]);
}
I complied it with gcc and ran valgrind --skin=memcheck --leak-check=yes
--leak-resolution=high --show-reachable=yes test_leak.
Valgrind did detect all problems but did not detect the strcpy errors
(stack overwrite) on variables str2 and str3.
Looks like a valgrind bug to me.
Otherwise, valgrind is great ! Many thanks to all its developers.
Regards,
Arnaud Bouis |