1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
|
$ g++ -g -std=c++11 -g baz.cpp
$ valgrind ./a.out wibbler
==6299== Memcheck, a memory error detector
==6299== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==6299== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==6299== Command: ./a.out wibbler
==6299==
==6299== Invalid write of size 1
==6299== at 0x400D73: strCopy(char*, char const*) (baz.cpp:87)
==6299== by 0x400F4A: char const* strCopy<char const*>(char*, char const*, char const*) (baz.cpp:93)
==6299== by 0x400E3E: char const* strCat<char const*, char const*>(char const*, char const*) (baz.cpp:98)
==6299== by 0x40091B: main (baz.cpp:22)
==6299== Address 0x5ab6c8e is 0 bytes after a block of size 14 alloc'd
==6299== at 0x4C2E80F: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==6299== by 0x400E00: char const* strCat<char const*, char const*>(char const*, char const*) (baz.cpp:97)
==6299== by 0x40091B: main (baz.cpp:22)
==6299==
==6299== Invalid write of size 1
==6299== at 0x400D73: strCopy(char*, char const*) (baz.cpp:87)
==6299== by 0x400F4A: char const* strCopy<char const*>(char*, char const*, char const*) (baz.cpp:93)
==6299== by 0x400FDC: char const* strCopy<char const*, char const*>(char*, char const*, char const*, char const*) (baz.cpp:93)
==6299== by 0x400EC2: char const* strCat<char const*, char const*, char const*>(char const*, char const*, char const*) (baz.cpp:98)
==6299== by 0x40093C: main (baz.cpp:23)
==6299== Address 0x5ab6ce2 is 0 bytes after a block of size 18 alloc'd
==6299== at 0x4C2E80F: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==6299== by 0x400E83: char const* strCat<char const*, char const*, char const*>(char const*, char const*, char const*) (baz.cpp:97)
==6299== by 0x40093C: main (baz.cpp:23)
==6299==
dir=mkdir wibbler=
src=mkdir wibbler/src=
bin=mkdir wibbler/bin=
lib=mkdir wibbler/lib=
include=mkdir wibbler/include=
==6299== Invalid write of size 1
==6299== at 0x400D73: strCopy(char*, char const*) (baz.cpp:87)
==6299== by 0x400F4A: char const* strCopy<char const*>(char*, char const*, char const*) (baz.cpp:93)
==6299== by 0x400E3E: char const* strCat<char const*, char const*>(char const*, char const*) (baz.cpp:98)
==6299== by 0x400B41: main (baz.cpp:39)
==6299== Address 0x5ab72a1 is 0 bytes after a block of size 17 alloc'd
==6299== at 0x4C2E80F: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==6299== by 0x400E00: char const* strCat<char const*, char const*>(char const*, char const*) (baz.cpp:97)
==6299== by 0x400B41: main (baz.cpp:39)
==6299==
==6299== Invalid write of size 1
==6299== at 0x400D73: strCopy(char*, char const*) (baz.cpp:87)
==6299== by 0x400F4A: char const* strCopy<char const*>(char*, char const*, char const*) (baz.cpp:93)
==6299== by 0x400E3E: char const* strCat<char const*, char const*>(char const*, char const*) (baz.cpp:98)
==6299== by 0x400B56: main (baz.cpp:40)
==6299== Address 0x5ab7307 is 0 bytes after a block of size 23 alloc'd
==6299== at 0x4C2E80F: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==6299== by 0x400E00: char const* strCat<char const*, char const*>(char const*, char const*) (baz.cpp:97)
==6299== by 0x400B56: main (baz.cpp:40)
==6299==
creatMake=touch wibbler/Makefile=
make=wibbler/Makefile=
==6299== Invalid write of size 1
==6299== at 0x400D73: strCopy(char*, char const*) (baz.cpp:87)
==6299== by 0x400F4A: char const* strCopy<char const*>(char*, char const*, char const*) (baz.cpp:93)
==6299== by 0x400E3E: char const* strCat<char const*, char const*>(char const*, char const*) (baz.cpp:98)
==6299== by 0x400C0E: main (baz.cpp:48)
==6299== Address 0x5ab7365 is 0 bytes after a block of size 21 alloc'd
==6299== at 0x4C2E80F: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==6299== by 0x400E00: char const* strCat<char const*, char const*>(char const*, char const*) (baz.cpp:97)
==6299== by 0x400C0E: main (baz.cpp:48)
==6299==
==6299== Invalid write of size 1
==6299== at 0x400D73: strCopy(char*, char const*) (baz.cpp:87)
==6299== by 0x400F4A: char const* strCopy<char const*>(char*, char const*, char const*) (baz.cpp:93)
==6299== by 0x400E3E: char const* strCat<char const*, char const*>(char const*, char const*) (baz.cpp:98)
==6299== by 0x400C23: main (baz.cpp:49)
==6299== Address 0x5ab73cb is 0 bytes after a block of size 27 alloc'd
==6299== at 0x4C2E80F: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==6299== by 0x400E00: char const* strCat<char const*, char const*>(char const*, char const*) (baz.cpp:97)
==6299== by 0x400C23: main (baz.cpp:49)
==6299==
creatMain=touch wibbler/src/main.cpp=
mainCpp=wibbler/src/main.cpp=
==6299==
==6299== HEAP SUMMARY:
==6299== in use at exit: 72,704 bytes in 1 blocks
==6299== total heap usage: 11 allocs, 10 frees, 73,906 bytes allocated
==6299==
==6299== LEAK SUMMARY:
==6299== definitely lost: 0 bytes in 0 blocks
==6299== indirectly lost: 0 bytes in 0 blocks
==6299== possibly lost: 0 bytes in 0 blocks
==6299== still reachable: 72,704 bytes in 1 blocks
==6299== suppressed: 0 bytes in 0 blocks
==6299== Rerun with --leak-check=full to see details of leaked memory
==6299==
==6299== For counts of detected and suppressed errors, rerun with: -v
==6299== ERROR SUMMARY: 9 errors from 6 contexts (suppressed: 0 from 0)
|