Hi,
I did a simple code to test out Overlapping src and dst pointers in
memcpy using
memcheck. But it seems memcheck don't detect the src and dst addresses are
identical. Any idea?
CODE:
char* arr = malloc(10);
memcpy(arr, arr, 10);
free(arr);
COMMAND:
valgrind --tool=memcheck --leak-check=full --show-reachable=yes ./main
OUTPUT:
==2421== Memcheck, a memory error detector
==2421== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al.
==2421== Using Valgrind-3.6.0.SVN-Debian and LibVEX; rerun with -h for
copyright info
==2421== Command: ./main
==2421==
==2421==
==2421== HEAP SUMMARY:
==2421== in use at exit: 0 bytes in 0 blocks
==2421== total heap usage: 1 allocs, 1 frees, 10 bytes allocated
==2421==
==2421== All heap blocks were freed -- no leaks are possible
==2421==
==2421== For counts of detected and suppressed errors, rerun with: -v
==2421== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 4 from 4)
Regards,
--
Wan Mohd Fairuz WAN ISMAIL
15 Le Palais des Fleurs,
74 Boulevard Raymond Poincare,
06160 Juan les Pins, FRANCE.
http://www.watt.com.my
+6 017 2071591
------------------------------------------------------------------------------
Forrester Wave Report - Recovery time is now measured in hours and minutes
not days. Key insights are discussed in the 2010 Forrester Wave Report as
part of an in-depth evaluation of disaster recovery service providers.
Forrester found the best-in-class provider in terms of services and vision.
Read this report now! http://p.sf.net/sfu/ibm-webcastpromo
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users