V
virtual
Here is the contents of "blah.c":
#include <string.h>
int main(void)
{
char buf1[5];
char buf2[5];
strcpy(buf2, "12345678");
return 0;
}
I've tried using Valgrind as follows:
virchanza ~ $ gcc -g -o blah blah.c
virchanza ~ $ valgrind ./blah
==6502== Memcheck, a memory error detector.
==6502== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et
al.
==6502== Using LibVEX rev 1854, a library for dynamic binary
translation.
==6502== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
==6502== Using valgrind-3.3.1-Debian, a dynamic binary instrumentation
framework.
==6502== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et
al.
==6502== For more details, rerun with: -v
==6502==
==6502==
==6502== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 11 from
1)
==6502== malloc/free: in use at exit: 0 bytes in 0 blocks.
==6502== malloc/free: 0 allocs, 0 frees, 0 bytes allocated.
==6502== For counts of detected errors, rerun with: -v
==6502== All heap blocks were freed -- no leaks are possible.
As you can see, Valgrind doesn't mention the error. Does anyone know
of any debugging tool on any platform that can catch this error?
My platform is Linux on x86.
#include <string.h>
int main(void)
{
char buf1[5];
char buf2[5];
strcpy(buf2, "12345678");
return 0;
}
I've tried using Valgrind as follows:
virchanza ~ $ gcc -g -o blah blah.c
virchanza ~ $ valgrind ./blah
==6502== Memcheck, a memory error detector.
==6502== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et
al.
==6502== Using LibVEX rev 1854, a library for dynamic binary
translation.
==6502== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
==6502== Using valgrind-3.3.1-Debian, a dynamic binary instrumentation
framework.
==6502== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et
al.
==6502== For more details, rerun with: -v
==6502==
==6502==
==6502== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 11 from
1)
==6502== malloc/free: in use at exit: 0 bytes in 0 blocks.
==6502== malloc/free: 0 allocs, 0 frees, 0 bytes allocated.
==6502== For counts of detected errors, rerun with: -v
==6502== All heap blocks were freed -- no leaks are possible.
As you can see, Valgrind doesn't mention the error. Does anyone know
of any debugging tool on any platform that can catch this error?
My platform is Linux on x86.