Skip to content

Commit

Permalink
Make valgrind check more useful
Browse files Browse the repository at this point in the history
* make valgrind now fails when valgrind detects a definitive memory leak
* suppress a known memory leak in OpenLDAP's NSS module

https://github.com/python-ldap/python-ldap/pull/111
Signed-off-by: Christian Heimes <cheimes@redhat.com>
  • Loading branch information
Christian Heimes authored and Petr Viktorin committed Dec 11, 2017
1 parent 5f4cc86 commit 44f7ba2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,17 @@ $(PYTHON_SUPP):
exit 1;

valgrind: build $(PYTHON_SUPP)
valgrind --leak-check=full \
valgrind \
--leak-check=full \
--track-fds=yes \
--suppressions=$(PYTHON_SUPP) \
--suppressions=Misc/python-ldap.supp \
--gen-suppressions=all \
--log-file=build/valgrind.log \
$(PYTHON) setup.py test

@grep -A7 "blocks are definitely lost" build/valgrind.log; \
if [ $$? == 0 ]; then \
echo "Found definitive leak, see build/valgrind.log"; \
exit 1; \
fi
10 changes: 10 additions & 0 deletions Misc/python-ldap.supp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@
...
}

{
NSS backend leaks one string during first initialization
Memcheck:Leak
match-leak-kinds: definite
fun:malloc
fun:PL_strdup
fun:tlsm_init
...
}

{
Ignore possible leaks in exception initialization
Memcheck:Leak
Expand Down

0 comments on commit 44f7ba2

Please sign in to comment.