Skip to content

Instantly share code, notes, and snippets.

@amuraru
Last active December 15, 2015 21:39
Show Gist options
  • Save amuraru/5327711 to your computer and use it in GitHub Desktop.
Save amuraru/5327711 to your computer and use it in GitHub Desktop.
valgrid check-memory leaks infinite loop
#include <valgrind/memcheck.h>
...
while(1) {
VALGRIND_DO_LEAK_CHECK;
...
}
% valgrind --tool=memcheck --leak-check=full --show-reachable=yes --suppressions=test/valgrind.supp --dsymutil=yes ./prog 2>&1 | grep -A6 LEAK
% valgrind -v --tool=memcheck --leak-check=full --show-reachable=yes --suppressions=test/valgrind.supp --dsymutil=yes ./prog 2>&1 | grep -A10 'definitely lost'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment