Skip to content

Instantly share code, notes, and snippets.

@AndreiPashkin
Created August 25, 2015 19:29
Show Gist options
  • Save AndreiPashkin/b1b1b484153642b1ae14 to your computer and use it in GitHub Desktop.
Save AndreiPashkin/b1b1b484153642b1ae14 to your computer and use it in GitHub Desktop.
$ PATH=$(pwd)/build:$PATH valgrind --read-var-info=yes --vgdb=yes --leak-check=full tests
==20285== Memcheck, a memory error detector
==20285== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==20285== Using Valgrind-3.10.0.SVN and LibVEX; rerun with -h for copyright info
==20285== Command: tests
==20285==
Running "test_pool_alloc"...
Running "test_pool_realloc"...
Running "test_arraylist_append"...
Running "test_arraylist_append_many"...
Running "test_arraylist_remove"...
==20285== Invalid read of size 8
==20285== at 0x401E8C: arraylist_get (arraylist.c:68)
==20285== by 0x401254: test_arraylist_remove (test_arraylist.c:68)
==20285== by 0x401366: main (tests.c:31)
==20285== Address 0x59d65f0 is 0 bytes inside a block of size 2 alloc'd
==20285== at 0x4C2CE8E: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==20285== by 0x402302: pool_realloc (pool.c:57)
==20285== by 0x401D97: arraylist_remove (arraylist.c:53)
==20285== by 0x401243: test_arraylist_remove (test_arraylist.c:67)
==20285== by 0x401366: main (tests.c:31)
==20285==
==20285== Invalid read of size 4
==20285== at 0x401255: test_arraylist_remove (test_arraylist.c:68)
==20285== by 0x401366: main (tests.c:31)
==20285== Address 0x6340 is not stack'd, malloc'd or (recently) free'd
==20285==
==20285==
==20285== Process terminating with default action of signal 11 (SIGSEGV)
==20285== Access not within mapped region at address 0x6340
==20285== at 0x401255: test_arraylist_remove (test_arraylist.c:68)
==20285== by 0x401366: main (tests.c:31)
==20285== If you believe this happened as a result of a stack
==20285== overflow in your program's main thread (unlikely but
==20285== possible), you can try to increase the size of the
==20285== main thread stack using the --main-stacksize= flag.
==20285== The main thread stack size used in this run was 8388608.
==20285==
==20285== HEAP SUMMARY:
==20285== in use at exit: 46 bytes in 5 blocks
==20285== total heap usage: 3,030 allocs, 3,025 frees, 8,020,334 bytes allocated
==20285==
==20285== LEAK SUMMARY:
==20285== definitely lost: 0 bytes in 0 blocks
==20285== indirectly lost: 0 bytes in 0 blocks
==20285== possibly lost: 0 bytes in 0 blocks
==20285== still reachable: 46 bytes in 5 blocks
==20285== suppressed: 0 bytes in 0 blocks
==20285== Reachable blocks (those to which a pointer was found) are not shown.
==20285== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==20285==
==20285== For counts of detected and suppressed errors, rerun with: -v
==20285== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
Segmentation fault (core dumped)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment