From 03a3c09b1fc4fc80caec28b88b0fe09d612835b8 Mon Sep 17 00:00:00 2001 From: pooryorick Date: Tue, 19 Jun 2018 11:47:08 +0000 Subject: new file: tools/valgrind_suppress. num-callers bumped from 8 to 24. Valgrind now issues no "still reachable" reports for cmdAH.test. --- tests/all.tcl | 23 ++++++++++++++--------- tests/pkgIndex.tcl | 2 +- tools/valgrind_suppress | 33 +++++++++++++++++++++++++++++++++ unix/Makefile.in | 4 +++- 4 files changed, 51 insertions(+), 11 deletions(-) create mode 100644 tools/valgrind_suppress diff --git a/tests/all.tcl b/tests/all.tcl index ad372db..d6434fb 100644 --- a/tests/all.tcl +++ b/tests/all.tcl @@ -14,18 +14,23 @@ package prefer latest package require Tcl 8.5- package require tcltest 2.2 namespace import tcltest::* -configure {*}$argv -testdir [file dir [info script]] -if {[singleProcess]} { - interp debug {} -frame 1 -} -set testsdir [file dirname [file dirname [file normalize [info script]/...]]] -lappend auto_path $testsdir {*}[apply {{testsdir args} { - lmap x $args { +apply {args { + global auto_path + set testsdir [file dirname [file dirname [file normalize [ + info script]/...]]] + + configure {*}$args -testdir $testsdir + + if {[singleProcess]} { + interp debug {} -frame 1 + } + + set auto_path [lmap x $auto_path[set auto_path {}] { if {$x eq $testsdir} continue lindex $x - } -}} $testsdir {*}$auto_path] + }] +}} {*}$argv runAllTests proc exit args {} diff --git a/tests/pkgIndex.tcl b/tests/pkgIndex.tcl index 0feb0eb..854b943 100644 --- a/tests/pkgIndex.tcl +++ b/tests/pkgIndex.tcl @@ -1,6 +1,6 @@ #! /usr/bin/env tclsh package ifneeded tcltests 0.1 " - source [list $dir]/tcltests.tcl + source [list $dir/tcltests.tcl] package provide tcltests 0.1 " diff --git a/tools/valgrind_suppress b/tools/valgrind_suppress new file mode 100644 index 0000000..e8f0204 --- /dev/null +++ b/tools/valgrind_suppress @@ -0,0 +1,33 @@ +{ + TclpGetPwNam/getpwname_r/__nss_next2/calloc + Memcheck:Leak + match-leak-kinds: reachable + fun:calloc + ... + fun:__nss_next2 + ... + fun:TclpGetPwNam +} + +{ + TclpGetPwNam/getpwname_r/__nss_next2/malloc + Memcheck:Leak + match-leak-kinds: reachable + fun:malloc + ... + fun:__nss_next2 + ... + fun:TclpGetPwNam +} + +{ + TclpGetPwNam/getpwname_r/_nss_systemd_getpwnam_r/malloc + Memcheck:Leak + match-leak-kinds: reachable + fun:malloc + ... + fun:_nss_systemd_getpwnam_r + ... + fun:TclpGetPwNam +} + diff --git a/unix/Makefile.in b/unix/Makefile.in index 4277fad..060148f 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -262,7 +262,9 @@ GDB = gdb TRACE = strace TRACE_OPTS = VALGRIND = valgrind -VALGRINDARGS = --tool=memcheck --num-callers=8 --leak-resolution=high --leak-check=yes --show-reachable=yes -v +VALGRINDARGS = --tool=memcheck --num-callers=24 \ + --leak-resolution=high --leak-check=yes --show-reachable=yes -v \ + --suppressions=$(TOOL_DIR)/valgrind_suppress #-------------------------------------------------------------------------- # The information below should be usable as is. The configure script won't -- cgit v0.12