From 3142077c7603fbac6adc12f881eb8c23280c9e4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Fri, 11 Sep 2020 20:15:33 +0200 Subject: [PATCH] Add script to run htop under valgrind Includes suppressions for ncurses leaks. --- scripts/htop_suppressions.valgrind | 63 ++++++++++++++++++++++++++++++ scripts/run_valgrind.sh | 6 +++ 2 files changed, 69 insertions(+) create mode 100644 scripts/htop_suppressions.valgrind create mode 100755 scripts/run_valgrind.sh diff --git a/scripts/htop_suppressions.valgrind b/scripts/htop_suppressions.valgrind new file mode 100644 index 00000000..a7afb0fd --- /dev/null +++ b/scripts/htop_suppressions.valgrind @@ -0,0 +1,63 @@ +{ + + Memcheck:Leak + match-leak-kinds: reachable + ... + fun:CRT_init + fun:main +} + +{ + + Memcheck:Leak + match-leak-kinds: reachable + ... + fun:CRT_init +} + +{ + + Memcheck:Leak + match-leak-kinds: reachable + ... + fun:wgetch + fun:ScreenManager_run + fun:Action_runSetup + fun:actionSetup + fun:MainPanel_eventHandler + fun:ScreenManager_run + fun:main +} + +{ + + Memcheck:Leak + match-leak-kinds: reachable + ... + fun:wgetch + fun:ScreenManager_run + fun:main +} + +{ + + Memcheck:Leak + match-leak-kinds: reachable + ... + fun:wrefresh + fun:main +} + +{ + + Memcheck:Leak + match-leak-kinds: reachable + fun:realloc + fun:_nc_doalloc + fun:_nc_tparm_analyze + fun:tparm + ... + fun:doupdate_sp + fun:wrefresh + obj:* +} diff --git a/scripts/run_valgrind.sh b/scripts/run_valgrind.sh new file mode 100755 index 00000000..f635b93b --- /dev/null +++ b/scripts/run_valgrind.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +SCRIPT=$(readlink -f "$0") +SCRIPTDIR=$(dirname "$SCRIPT") + +valgrind --leak-check=full --show-reachable=yes --show-leak-kinds=all --errors-for-leak-kinds=all --suppressions="${SCRIPTDIR}/htop_suppressions.valgrind" "${SCRIPTDIR}/../htop"