From f2d4f0706988450a24ac470bb0503625220a9e9e Mon Sep 17 00:00:00 2001 From: Bruno Raoult Date: Fri, 14 Jul 2023 08:35:47 +0200 Subject: [PATCH] valgrind: ignore libreadline errors --- Makefile | 9 +++++++-- etc/libreadline.supp | 6 ++++++ 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 etc/libreadline.supp diff --git a/Makefile b/Makefile index ba8455d..7f29c4f 100644 --- a/Makefile +++ b/Makefile @@ -201,12 +201,17 @@ bear: clean $(CCLSROOT) @touch .ccls-root @$(BEAR) -- make compile -##################################### LSP (ccls) +##################################### valgrind (mem check) .PHONY: memcheck VALGRIND = valgrind VALGRINDFLAGS = --leak-check=full --show-leak-kinds=all VALGRINDFLAGS += --track-origins=yes --sigill-diagnostics=yes VALGRINDFLAGS += --quiet --show-error-list=yes +VALGRINDFLAGS += --log-file=valgrind.out +# We need to suppress libreadline leaks here. See : +# https://stackoverflow.com/questions/72840015 +VALGRINDFLAGS += --suppressions=etc/libreadline.supp -memcheck: brchess +memcheck: bin + @$(VALGRIND) $(VALGRINDFLAGS) ./brchess diff --git a/etc/libreadline.supp b/etc/libreadline.supp new file mode 100644 index 0000000..75210e5 --- /dev/null +++ b/etc/libreadline.supp @@ -0,0 +1,6 @@ +{ + ignore_libreadline_leaks + Memcheck:Leak + ... + obj:*/libreadline.so.* +} \ No newline at end of file