Skip to content

Instantly share code, notes, and snippets.

@simi
Created June 18, 2013 10:26
Show Gist options
  • Select an option

  • Save simi/5804269 to your computer and use it in GitHub Desktop.

Select an option

Save simi/5804269 to your computer and use it in GitHub Desktop.
[retro@retro sqlite3-test]❤ valgrind ./test.o
==16303== Memcheck, a memory error detector
==16303== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==16303== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==16303== Command: ./test.o
==16303==
date('now')
2013-06-18 [82/1940]
==16303==
==16303== HEAP SUMMARY:
==16303== in use at exit: 71,584 bytes in 51 blocks
==16303== total heap usage: 58 allocs, 7 frees, 77,464 bytes allocated
==16303==
==16303== LEAK SUMMARY:
==16303== definitely lost: 840 bytes in 1 blocks
==16303== indirectly lost: 70,664 bytes in 49 blocks
==16303== possibly lost: 80 bytes in 1 blocks
==16303== still reachable: 0 bytes in 0 blocks
==16303== suppressed: 0 bytes in 0 blocks
==16303== Rerun with --leak-check=full to see details of leaked memory
==16303==
==16303== For counts of detected and suppressed errors, rerun with: -v
==16303== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)
[retro@retro sqlite3-test]❤ valgrind --v --leak-check=full ./test.o
[retro@retro sqlite3-test]❤ valgrind --v --leak-check=full ./test.o
valgrind: Bad option: --v
valgrind: Use --help for more information or consult the user manual.
[retro@retro sqlite3-test]❤ valgrind -v --leak-check=full ./test.o
==16315== Memcheck, a memory error detector
==16315== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==16315== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==16315== Command: ./test.o
==16315==
--16315-- Valgrind options:
--16315-- -v
--16315-- --leak-check=full
--16315-- Contents of /proc/version:
--16315-- Linux version 3.9.2-200.fc18.x86_64 (mockbuild@bkernel02) (gcc version 4.7.2 20121109 (Red Hat 4.7.2-8) (GCC) ) #1 SMP Mon May 13 13:59:47 UTC 2013
--16315-- Arch and hwcaps: AMD64, amd64-sse3-cx16
--16315-- Page sizes: currently 4096, max supported 4096
--16315-- Valgrind library directory: /usr/lib64/valgrind
--16315-- Reading syms from /home/retro/work/fun/sqlite3-test/test.o
--16315-- Reading syms from /usr/lib64/valgrind/memcheck-amd64-linux
--16315-- object doesn't have a dynamic symbol table
--16315-- Reading syms from /usr/lib64/ld-2.16.so
--16315-- Scheduler: using generic scheduler lock implementation.
--16315-- Reading suppressions file: /usr/lib64/valgrind/default.supp
==16315== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-16315-by-retro-on-retro
==16315== embedded gdbserver: writing to /tmp/vgdb-pipe-to-vgdb-from-16315-by-retro-on-retro [41/1940]
==16315== embedded gdbserver: shared mem /tmp/vgdb-pipe-shared-mem-vgdb-16315-by-retro-on-retro
==16315==
==16315== TO CONTROL THIS PROCESS USING vgdb (which you probably
==16315== don't want to do, unless you know exactly what you're doing,
==16315== or are doing some strange experiment):
==16315== /usr/lib64/valgrind/../../bin/vgdb --pid=16315 ...command...
==16315==
==16315== TO DEBUG THIS PROCESS USING GDB: start GDB like this
==16315== /path/to/gdb ./test.o
==16315== and then give GDB the following command
==16315== target remote | /usr/lib64/valgrind/../../bin/vgdb --pid=16315
==16315== --pid is optional if only one valgrind process is running
==16315==
--16315-- REDIR: 0x3a70417f90 (strlen) redirected to 0x3806e111 (vgPlain_amd64_linux_REDIR_FOR_strlen)
--16315-- Reading syms from /usr/lib64/valgrind/vgpreload_core-amd64-linux.so
--16315-- Reading syms from /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so
--16315-- REDIR: 0x3a70417e00 (index) redirected to 0x4a08e80 (index)
--16315-- REDIR: 0x3a70417e80 (strcmp) redirected to 0x4a09e90 (strcmp)
--16315-- Reading syms from /usr/lib64/libsqlite3.so.0.8.6
--16315-- object doesn't have a symbol table
--16315-- Reading syms from /usr/lib64/libc-2.16.so
--16315-- Reading syms from /usr/lib64/libdl-2.16.so
--16315-- Reading syms from /usr/lib64/libpthread-2.16.so
--16315-- REDIR: 0x3a70889e60 (strcasecmp) redirected to 0x480170e (_vgnU_ifunc_wrapper)
--16315-- REDIR: 0x3a708861c0 (strnlen) redirected to 0x480170e (_vgnU_ifunc_wrapper)
--16315-- REDIR: 0x3a7088c130 (strncasecmp) redirected to 0x480170e (_vgnU_ifunc_wrapper)
--16315-- REDIR: 0x3a70887bb0 (__GI_strrchr) redirected to 0x4a08ca0 (__GI_strrchr)
--16315-- REDIR: 0x3a7087f3e0 (malloc) redirected to 0x4a087fa (malloc)
--16315-- REDIR: 0x3a70888c40 (memset) redirected to 0x480170e (_vgnU_ifunc_wrapper)
--16315-- REDIR: 0x3a70888c80 (__GI_memset) redirected to 0x4a0b410 (memset)
--16315-- REDIR: 0x3a7087f8d0 (free) redirected to 0x4a0775f (free)
--16315-- REDIR: 0x3a7088e810 (memcpy@@GLIBC_2.14) redirected to 0x480170e (_vgnU_ifunc_wrapper)
--16315-- REDIR: 0x3a70945a60 (__memcpy_ssse3_back) redirected to 0x4a0a1c0 (memcpy@@GLIBC_2.14)
--16315-- REDIR: 0x3a70886090 (strlen) redirected to 0x480170e (_vgnU_ifunc_wrapper)
--16315-- REDIR: 0x3a709606a0 (__strlen_sse2_pminub) redirected to 0x4a091e0 (strlen)
--16315-- REDIR: 0x3a70888600 (bcmp) redirected to 0x480170e (_vgnU_ifunc_wrapper)
--16315-- REDIR: 0x3a7095afd0 (__memcmp_sse4_1) redirected to 0x4a0aee0 (bcmp)
--16315-- REDIR: 0x3a708862a0 (strncmp) redirected to 0x480170e (_vgnU_ifunc_wrapper)
--16315-- REDIR: 0x3a70930990 (__strncmp_sse42) redirected to 0x4a09660 (strncmp)
--16315-- REDIR: 0xffffffffff600000 (???) redirected to 0x3806e0f3 (vgPlain_amd64_linux_REDIR_FOR_vgettimeofday)
--16315-- REDIR: 0x3a7088ff00 (strchrnul) redirected to 0x4a0b960 (strchrnul)
date('now')
2013-06-18
==16315==
==16315== HEAP SUMMARY:
==16315== in use at exit: 71,584 bytes in 51 blocks
==16315== total heap usage: 58 allocs, 7 frees, 77,464 bytes allocated
==16315==
==16315== Searching for pointers to 51 not-freed blocks
==16315== Checked 115,688 bytes
==16315==
==16315== 80 bytes in 1 blocks are possibly lost in loss record 22 of 51
==16315== at 0x4A0887C: malloc (vg_replace_malloc.c:270)
==16315== by 0x3A8943254E: ??? (in /usr/lib64/libsqlite3.so.0.8.6)
==16315== by 0x3A8940ECF8: ??? (in /usr/lib64/libsqlite3.so.0.8.6)
==16315== by 0x3A89416067: ??? (in /usr/lib64/libsqlite3.so.0.8.6)
==16315== by 0x3A8948A266: ??? (in /usr/lib64/libsqlite3.so.0.8.6)
==16315== by 0x3A89443D73: ??? (in /usr/lib64/libsqlite3.so.0.8.6)
==16315== by 0x3A8945BB26: ??? (in /usr/lib64/libsqlite3.so.0.8.6)
==16315== by 0x40098B: main (in /home/retro/work/fun/sqlite3-test/test.o)
==16315==
==16315== 71,504 (840 direct, 70,664 indirect) bytes in 1 blocks are definitely lost in loss record 51 of 51
==16315== at 0x4A0887C: malloc (vg_replace_malloc.c:270)
==16315== by 0x3A8943254E: ??? (in /usr/lib64/libsqlite3.so.0.8.6)
==16315== by 0x3A8940ECF8: ??? (in /usr/lib64/libsqlite3.so.0.8.6)
==16315== by 0x3A89416067: ??? (in /usr/lib64/libsqlite3.so.0.8.6)
==16315== by 0x3A89416094: ??? (in /usr/lib64/libsqlite3.so.0.8.6)
==16315== by 0x3A8945B7E1: ??? (in /usr/lib64/libsqlite3.so.0.8.6)
==16315== by 0x40098B: main (in /home/retro/work/fun/sqlite3-test/test.o)
==16315==
==16315== LEAK SUMMARY:
==16315== definitely lost: 840 bytes in 1 blocks
==16315== indirectly lost: 70,664 bytes in 49 blocks
==16315== possibly lost: 80 bytes in 1 blocks
==16315== still reachable: 0 bytes in 0 blocks
==16315== suppressed: 0 bytes in 0 blocks
==16315==
==16315== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 2 from 2)
--16315--
--16315-- used_suppression: 2 glibc-2.5.x-on-SUSE-10.2-(PPC)-2a
==16315==
==16315== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 2 from 2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment