|
From: Mark W. <ma...@so...> - 2020-07-02 16:45:11
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=5efd866df21ab1f13402b280bcbe021b3b50a032 commit 5efd866df21ab1f13402b280bcbe021b3b50a032 Author: Mark Wielaard <ma...@kl...> Date: Tue Jun 30 17:51:49 2020 +0200 Add new auxchecks target that runs GNU Scientific Library tests. Replace the gsl16test script under auxprogs that you run by hand with a new make target auxchecks which fetches the source code, patches, reconfigures and builds all tests. Then run all tests under valgrind. Diff: --- Makefile.am | 4 ++ auxprogs/Makefile.am | 99 ++++++++++++++++++++++++++++++++++-- auxprogs/gsl-1.6.out.x86.exp | 40 +++++++++++++++ auxprogs/gsl-1.6.patch | 36 +++++++++++++ auxprogs/gsl-1.6.supp | 14 +++++ auxprogs/gsl16-badfree.patch | 32 ------------ auxprogs/gsl16-wavelet.patch | 11 ---- auxprogs/gsl16test | 118 ------------------------------------------- 8 files changed, 189 insertions(+), 165 deletions(-) diff --git a/Makefile.am b/Makefile.am index 08db834019..f10517edca 100644 --- a/Makefile.am +++ b/Makefile.am @@ -94,6 +94,10 @@ exp-regtest: check perf: check @PERL@ perf/vg_perf perf +# Auxiliary test suites run under valgrind +auxchecks: all + $(MAKE) -C auxprogs auxchecks + # Nb: no need to include any Makefile.am files here, or files included from # them, as automake includes them automatically. Also not COPYING, README # or NEWS. diff --git a/auxprogs/Makefile.am b/auxprogs/Makefile.am index 56cc5efc70..83c887217b 100644 --- a/auxprogs/Makefile.am +++ b/auxprogs/Makefile.am @@ -4,7 +4,6 @@ dist_noinst_SCRIPTS = \ change-copyright-year \ dump_insn_ppc.sh \ gen-mdg \ - gsl16test \ gsl19test \ make_or_upd_vgversion_h \ nightly-build-summary \ @@ -14,8 +13,9 @@ dist_noinst_SCRIPTS = \ EXTRA_DIST = \ docs/valgrind-listener-manpage.xml \ docs/valgrind-di-server-manpage.xml \ - gsl16-badfree.patch \ - gsl16-wavelet.patch \ + gsl-1.6.patch \ + gsl-1.6.supp \ + gsl-1.6.out.x86.exp \ posixtestsuite-1.5.1-diff.txt \ ppcfround.c \ ppc64shifts.c \ @@ -117,13 +117,104 @@ getoff_@VGCONF_ARCH_SEC@_@VGCONF_OS@_LDFLAGS += -Wl,-read_only_relocs -Wl,supp endif endif +#---------------------------------------------------------------------------- +# Auxiliary testsuits +#---------------------------------------------------------------------------- + +auxchecks: gsl-check +auxclean: gsl-clean + +# You can override AUX_CHECK_DIR to use a previous download/build. +# Must be an absolute path. +# e.g. make auxchecks AUX_CHECK_DIR=$HOME/valgrind-auxtests +AUX_CHECK_DIR=$(abs_builddir)auxchecks + +# GNU Scientific Library 1.6 +GSL_DIR_NAME=gsl-1.6 +GSL_TAR_NAME=$(GSL_DIR_NAME).tar.gz +GSL_URL=https://ftpmirror.gnu.org/gsl/$(GSL_TAR_NAME) +GSL_SHA256_SUM=52e097b5228a617fef788d54eba6855c1addc62b8f68a1dfb5895cad25594f1f +GSL_TAR=$(AUX_CHECK_DIR)/$(GSL_TAR_NAME) +GSL_SRC_DIR=$(AUX_CHECK_DIR)/$(GSL_DIR_NAME) +# By default we like -O3 to hopefully get some loop vectorization +# You can also override GSL_CFLAGS if you want e.g. -march=core-avx2 +# Different GSL_CFLAGS will result in different build dirs (under AUX_CHECK_DIR) +GSL_CFLAGS=-g -O3 +# i386 needs sse to get rounding for floating point correct. +# But we only want this if the primary isn't AMD64 +if VGCONF_ARCHS_INCLUDE_X86 +if !VGCONF_ARCHS_INCLUDE_AMD64 +GSL_CFLAGS+=-mfpmath=sse -msse2 +endif +endif + +# Trick to get a literal space to use in substitutions +sp := $(subst ,, ) + +# Filter out spaces from GSL_CFLAGS to get unique build dir +GSL_BUILD_DIR=$(AUX_CHECK_DIR)/gsl-build$(subst $(sp),,$(GSL_CFLAGS)) + +# These are all the tests, except siman and randist which can take minutes. +GSL_TESTS=block cblas cdf cheb combination complex const deriv dht diff \ + eigen err fft fit histogram ieee-utils integration interpolation \ + linalg matrix min monte multifit multimin multiroots ntuple \ + ode-initval permutation poly qrng rng roots sort specfunc \ + statistics sum sys vector wavelet + +# Get the tar file if we don't have it yet. +$(GSL_TAR): + mkdir -p $(AUX_CHECK_DIR) + wget -q -O $(GSL_TAR) $(GSL_URL) + +# We need to autoreconf to make sure to get config.guess, config.sub +# and libtool for newer architectures. +$(GSL_SRC_DIR)/gsl-patched: $(GSL_TAR) + echo "$(GSL_SHA256_SUM) $(GSL_TAR)" | sha256sum --check - + (cd $(AUX_CHECK_DIR) && \ + tar zxf $(GSL_TAR_NAME) && \ + cd $(GSL_DIR_NAME) && \ + patch -p1 < $(abs_top_srcdir)/auxprogs/gsl-1.6.patch && \ + autoreconf -f -i -Wnone) + touch $@ + +# We need make check -k because +# some tests might fail even native (only on i386 though). +# make check doesn't work reliably with -j. +$(GSL_BUILD_DIR)/gsl-build: $(GSL_SRC_DIR)/gsl-patched + mkdir -p $(GSL_BUILD_DIR) + (cd $(GSL_BUILD_DIR) && \ + $(GSL_SRC_DIR)/configure CFLAGS="$(GSL_CFLAGS)" && \ + make -j $(nproc) && \ + make check -k || true) + touch $@ + +# We hope all tests PASS (so don't produce output except for the test names). +# But on x86 we get one FAIL, so that is "fine" too. +# We currently don't check stderr, but we probably should. +gsl-check: $(GSL_BUILD_DIR)/gsl-build + (cd $(GSL_BUILD_DIR); \ + for gsl_test in $(GSL_TESTS); do \ + echo $$gsl_test; \ + ./libtool --mode=execute $(abs_top_builddir)/vg-in-place -q \ + --suppressions=$(abs_top_srcdir)/auxprogs/gsl-1.6.supp \ + $$gsl_test/test; \ + done | grep --line-buffered -v ^PASS: | tee valgrind-gsl.out) + for gsl_test in $(GSL_TESTS); do echo $$gsl_test; done \ + | cmp - $(GSL_BUILD_DIR)/valgrind-gsl.out || \ + diff -u $(abs_top_srcdir)/auxprogs/gsl-1.6.out.x86.exp \ + $(GSL_BUILD_DIR)/valgrind-gsl.out + +# We keep the tarball but remove the unpacked sources and build +gsl-clean: + rm -rf $(GSL_SRC_NAME) $(GSL_BUILD_DIR) + #---------------------------------------------------------------------------- # General stuff #---------------------------------------------------------------------------- all-local: inplace-noinst_PROGRAMS inplace-noinst_DSYMS -clean-local: clean-noinst_DSYMS +clean-local: clean-noinst_DSYMS auxclean install-exec-local: install-noinst_PROGRAMS install-noinst_DSYMS diff --git a/auxprogs/gsl-1.6.out.x86.exp b/auxprogs/gsl-1.6.out.x86.exp new file mode 100644 index 0000000000..996f285df1 --- /dev/null +++ b/auxprogs/gsl-1.6.out.x86.exp @@ -0,0 +1,40 @@ +block +cblas +cdf +cheb +combination +complex +const +deriv +dht +diff +eigen +err +fft +fit +histogram +ieee-utils +integration +FAIL: qawo(f456) elist (7.25063790881233303e-15 observed vs 7.25922435194575979e-15 expected) +interpolation +linalg +matrix +min +monte +multifit +multimin +multiroots +ntuple +ode-initval +permutation +poly +qrng +rng +roots +sort +specfunc +statistics +sum +sys +vector +wavelet diff --git a/auxprogs/gsl-1.6.patch b/auxprogs/gsl-1.6.patch new file mode 100644 index 0000000000..a9ffd13c33 --- /dev/null +++ b/auxprogs/gsl-1.6.patch @@ -0,0 +1,36 @@ +diff -r -u gsl-1.6/vector/test_complex_source.c gsl-1.6-patched/vector/test_complex_source.c +--- gsl-1.6/vector/test_complex_source.c 2004-09-13 15:23:20.000000000 +0200 ++++ gsl-1.6-patched/vector/test_complex_source.c 2005-07-24 08:37:54.000000000 +0200 +@@ -75,7 +75,7 @@ + if (stride == 1) + { + v0 = FUNCTION (gsl_vector, alloc) (N); +- view = FUNCTION (gsl_vector, subvector) (v, 0, N); ++ view = FUNCTION (gsl_vector, subvector) (v0, 0, N); + v = &view.vector; + } + else +diff -r -u gsl-1.6/vector/test_source.c gsl-1.6-patched/vector/test_source.c +--- gsl-1.6/vector/test_source.c 2004-09-13 15:23:20.000000000 +0200 ++++ gsl-1.6-patched/vector/test_source.c 2005-07-24 08:37:54.000000000 +0200 +@@ -75,7 +75,7 @@ + if (stride == 1) + { + v0 = FUNCTION (gsl_vector, alloc) (N); +- view = FUNCTION (gsl_vector, subvector) (v, 0, N); ++ view = FUNCTION (gsl_vector, subvector) (v0, 0, N); + v = &view.vector; + } + else +diff -r -u gsl-1.6/wavelet/dwt.c gsl-1.6-patched/wavelet/dwt.c +--- gsl-1.6/wavelet/dwt.c 2004-12-24 14:57:34.000000000 +0100 ++++ gsl-1.6-patched/wavelet/dwt.c 2005-07-24 08:38:05.000000000 +0200 +@@ -30,7 +30,7 @@ + + static int binary_logn (const size_t n); + static void dwt_step (const gsl_wavelet * w, double *a, size_t stride, +- size_t n, int isign, gsl_wavelet_workspace * work); ++ size_t n, gsl_wavelet_direction dir, gsl_wavelet_workspace * work); + + static int + binary_logn (const size_t n) diff --git a/auxprogs/gsl-1.6.supp b/auxprogs/gsl-1.6.supp new file mode 100644 index 0000000000..addf5d8caf --- /dev/null +++ b/auxprogs/gsl-1.6.supp @@ -0,0 +1,14 @@ +{ + gsl-writes-uninit-data + Memcheck:Param + write(buf) + fun:write +} + +{ + gsl-writes-uninit-data-nocancel + Memcheck:Param + write(buf) + fun:__write_nocancel +} + diff --git a/auxprogs/gsl16-badfree.patch b/auxprogs/gsl16-badfree.patch deleted file mode 100644 index d07d3a1ba9..0000000000 --- a/auxprogs/gsl16-badfree.patch +++ /dev/null @@ -1,32 +0,0 @@ -Index: test_complex_source.c -=================================================================== -RCS file: /home/gsl-cvs/gsl/vector/test_complex_source.c,v -retrieving revision 1.23 -diff -u -r1.23 test_complex_source.c ---- test_complex_source.c 24 Jun 2005 11:33:25 -0000 1.23 -+++ test_complex_source.c 6 Jul 2005 11:18:33 -0000 -@@ -75,7 +75,7 @@ - if (stride == 1) - { - v0 = FUNCTION (gsl_vector, alloc) (N); -- view = FUNCTION (gsl_vector, subvector) (v, 0, N); -+ view = FUNCTION (gsl_vector, subvector) (v0, 0, N); - v = &view.vector; - } - else -Index: test_source.c -=================================================================== -RCS file: /home/gsl-cvs/gsl/vector/test_source.c,v -retrieving revision 1.26 -diff -u -r1.26 test_source.c ---- test_source.c 24 Jun 2005 11:33:26 -0000 1.26 -+++ test_source.c 6 Jul 2005 11:14:18 -0000 -@@ -75,7 +75,7 @@ - if (stride == 1) - { - v0 = FUNCTION (gsl_vector, alloc) (N); -- view = FUNCTION (gsl_vector, subvector) (v, 0, N); -+ view = FUNCTION (gsl_vector, subvector) (v0, 0, N); - v = &view.vector; - } - else diff --git a/auxprogs/gsl16-wavelet.patch b/auxprogs/gsl16-wavelet.patch deleted file mode 100644 index 525e9cf5e6..0000000000 --- a/auxprogs/gsl16-wavelet.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- wavelet/dwt.c~ 2004-12-24 14:57:34.000000000 +0100 -+++ wavelet/dwt.c 2005-07-08 23:31:32.000000000 +0200 -@@ -30,7 +30,7 @@ - - static int binary_logn (const size_t n); - static void dwt_step (const gsl_wavelet * w, double *a, size_t stride, -- size_t n, int isign, gsl_wavelet_workspace * work); -+ size_t n, gsl_wavelet_direction dir, gsl_wavelet_workspace * work); - - static int - binary_logn (const size_t n) diff --git a/auxprogs/gsl16test b/auxprogs/gsl16test deleted file mode 100755 index 22f7cab2e8..0000000000 --- a/auxprogs/gsl16test +++ /dev/null @@ -1,118 +0,0 @@ -#!/bin/sh - -# Do an automated test which involves building and regtesting version -# 1.6 of the GNU Scientific Library (gsl). This has proven to be a -# very thorough test of Vex's CPU simulations and has exposed bugs -# which had not been previously discovered. Gsl contains more -# than 100,000 tests as part of its regression suite, and so this -# script's purpose is to runs those tests using valgrind and compare -# against the same tests run natively. -# -# You can download gsl and get more info about it at -# http://www.gnu.org/software/gsl - - - -# Args: -# absolute name of gsl-1.6.tar.gz file -# name of C compiler -# args for C compiler -# name of Valgrind -# args for Valgrind - -# Results: 3.7.0 --tool=none -# x86 1 failure Ubuntu 10.10 -# FAIL: qawo(f456) elist (7.25063790881233303e-15 observed vs 7.25922435194575979e-15 expected) -# same failure was also present in 3.6.1 -# s390x 0 failures on z900 running RHEL4 - -if [ $# != 5 ] -then - echo "usage: gsl16test /absolute/name/of/gsl-1.6-patched.tar.gz" - echo " C-compiler-command" - echo " flags-for-C-compiler" - echo " Valgrind-command" - echo " flags-for-Valgrind" - exit 1 -fi - - -runcmd () { - echo -n " $1 ... " - shift - - (eval "$*") >> log.verbose 2>&1 - - if [ $? = 0 ] - then - echo "done" - return 0 - else - echo "failed" - return 1 - fi -} - -GSL_FILE=$1 -GSL_CC=$2 -GSL_CFLAGS=$3 -GSL_VV=$4 -GSL_VFLAGS=$5 - -TESTS1="block/test cblas/test cdf/test cheb/test combination/test" -TESTS2="complex/test const/test deriv/test dht/test diff/test" -TESTS3="eigen/test err/test fft/test fit/test histogram/test" -TESTS4="ieee-utils/test integration/test interpolation/test linalg/test" -TESTS5="matrix/test min/test monte/test multifit/test multimin/test" -TESTS6="multiroots/test ntuple/test ode-initval/test permutation/test" -TESTS7="poly/test qrng/test randist/test rng/test roots/test siman/test" -TESTS8="sort/test specfunc/test statistics/test sum/test sys/test" -TESTS9="vector/test wavelet/test" - -ALL_TESTS="$TESTS1 $TESTS2 $TESTS3 $TESTS4 $TESTS5 $TESTS6 $TESTS7 $TESTS8 $TESTS9" - -echo "gsl16test: src: " $GSL_FILE -echo "gsl16test: cc: " $GSL_CC -echo "gsl16test: cflags: " $GSL_CFLAGS -echo "gsl16test: valgrind: " $GSL_VV -echo "gsl16test: vflags: " $GSL_VFLAGS - -rm -rf log.verbose gsl-1.6-patched summary.txt - -echo > log.verbose - -echo > summary.txt -echo $0 $1 \"$2\" \"$3\" \"$4\" \"$5\" >> summary.txt -echo >> summary.txt - -runcmd "Untarring " \ - "rm -rf gsl-1.6-patched && tar xzf $GSL_FILE" && \ -\ -runcmd "Configuring " \ - "(cd gsl-1.6-patched && CC=$GSL_CC CFLAGS=\"$GSL_CFLAGS\" ./configure)" && \ -\ -runcmd "Building " \ - "(cd gsl-1.6-patched && make -j4 && make -k check)" - -echo -n " Collecting reference results " -rm -f out-REF -(cd gsl-1.6-patched && for f in $ALL_TESTS ; do ./$f ; done) &> out-REF -echo " ... done" - -echo -n " Collecting valgrinded results " -rm -f out-VAL -(cd gsl-1.6-patched && for f in $ALL_TESTS ; do eval $GSL_VV -v --trace-children=yes "$GSL_VFLAGS" ./$f ; done) &> out-VAL -echo " ... done" - -echo -n " Native fails: " && (grep FAIL: out-REF | wc -l) -echo -n " Native passes: " && (grep PASS: out-REF | wc -l) -echo -n " Valgrind fails: " && (grep FAIL: out-VAL | wc -l) -echo -n " Valgrind passes: " && (grep PASS: out-VAL | wc -l) - -(echo -n " Native fails: " && (grep FAIL: out-REF | wc -l)) >> summary.txt -(echo -n " Native passes: " && (grep PASS: out-REF | wc -l)) >> summary.txt -(echo -n " Valgrind fails: " && (grep FAIL: out-VAL | wc -l)) >> summary.txt -(echo -n " Valgrind passes: " && (grep PASS: out-VAL | wc -l)) >> summary.txt -echo >> summary.txt - -echo |
|
From: Rhys K. <rhy...@gm...> - 2020-07-03 00:28:02
|
This is a really neat test suite to run through valgrind. Impressed with how clean it was. Do you happen to know how a more recent gsl, like 2.x, goes? I've noticed two little things (in line below), which I'll commit a patch to git master branch for. Regards, Rhys On Fri, 3 Jul 2020 at 02:46, Mark Wielaard <ma...@so...> wrote: > > https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=5efd866df21ab1f13402b280bcbe021b3b50a032 > > commit 5efd866df21ab1f13402b280bcbe021b3b50a032 > Author: Mark Wielaard <ma...@kl...> > Date: Tue Jun 30 17:51:49 2020 +0200 > > Add new auxchecks target that runs GNU Scientific Library tests. > > Replace the gsl16test script under auxprogs that you run by hand > with a new make target auxchecks which fetches the source code, > patches, reconfigures and builds all tests. Then run all tests > under valgrind. > > Diff: > --- > Makefile.am | 4 ++ > auxprogs/Makefile.am | 99 ++++++++++++++++++++++++++++++++++-- > auxprogs/gsl-1.6.out.x86.exp | 40 +++++++++++++++ > auxprogs/gsl-1.6.patch | 36 +++++++++++++ > auxprogs/gsl-1.6.supp | 14 +++++ > auxprogs/gsl16-badfree.patch | 32 ------------ > auxprogs/gsl16-wavelet.patch | 11 ---- > auxprogs/gsl16test | 118 > ------------------------------------------- > 8 files changed, 189 insertions(+), 165 deletions(-) > > diff --git a/Makefile.am b/Makefile.am > index 08db834019..f10517edca 100644 > --- a/Makefile.am > +++ b/Makefile.am > @@ -94,6 +94,10 @@ exp-regtest: check > perf: check > @PERL@ perf/vg_perf perf > > +# Auxiliary test suites run under valgrind > +auxchecks: all > + $(MAKE) -C auxprogs auxchecks > + > # Nb: no need to include any Makefile.am files here, or files included > from > # them, as automake includes them automatically. Also not COPYING, README > # or NEWS. > diff --git a/auxprogs/Makefile.am b/auxprogs/Makefile.am > index 56cc5efc70..83c887217b 100644 > --- a/auxprogs/Makefile.am > +++ b/auxprogs/Makefile.am > @@ -4,7 +4,6 @@ dist_noinst_SCRIPTS = \ > change-copyright-year \ > dump_insn_ppc.sh \ > gen-mdg \ > - gsl16test \ > gsl19test \ > make_or_upd_vgversion_h \ > nightly-build-summary \ > @@ -14,8 +13,9 @@ dist_noinst_SCRIPTS = \ > EXTRA_DIST = \ > docs/valgrind-listener-manpage.xml \ > docs/valgrind-di-server-manpage.xml \ > - gsl16-badfree.patch \ > - gsl16-wavelet.patch \ > + gsl-1.6.patch \ > + gsl-1.6.supp \ > + gsl-1.6.out.x86.exp \ > posixtestsuite-1.5.1-diff.txt \ > ppcfround.c \ > ppc64shifts.c \ > @@ -117,13 +117,104 @@ getoff_@VGCONF_ARCH_SEC@_@VGCONF_OS@_LDFLAGS += > -Wl,-read_only_relocs -Wl,supp > endif > endif > > > +#---------------------------------------------------------------------------- > +# Auxiliary testsuits > > +#---------------------------------------------------------------------------- > + > +auxchecks: gsl-check > +auxclean: gsl-clean > + > +# You can override AUX_CHECK_DIR to use a previous download/build. > +# Must be an absolute path. > +# e.g. make auxchecks AUX_CHECK_DIR=$HOME/valgrind-auxtests > +AUX_CHECK_DIR=$(abs_builddir)auxchecks > I think you meant to include a prefix slash here as $abs_builddir does not have a trailing slash: -AUX_CHECK_DIR=$(abs_builddir)auxchecks +AUX_CHECK_DIR=$(abs_builddir)/auxchecks > + > +# GNU Scientific Library 1.6 > +GSL_DIR_NAME=gsl-1.6 > +GSL_TAR_NAME=$(GSL_DIR_NAME).tar.gz > +GSL_URL=https://ftpmirror.gnu.org/gsl/$(GSL_TAR_NAME) > > +GSL_SHA256_SUM=52e097b5228a617fef788d54eba6855c1addc62b8f68a1dfb5895cad25594f1f > +GSL_TAR=$(AUX_CHECK_DIR)/$(GSL_TAR_NAME) > +GSL_SRC_DIR=$(AUX_CHECK_DIR)/$(GSL_DIR_NAME) > +# By default we like -O3 to hopefully get some loop vectorization > +# You can also override GSL_CFLAGS if you want e.g. -march=core-avx2 > +# Different GSL_CFLAGS will result in different build dirs (under > AUX_CHECK_DIR) > +GSL_CFLAGS=-g -O3 > +# i386 needs sse to get rounding for floating point correct. > +# But we only want this if the primary isn't AMD64 > +if VGCONF_ARCHS_INCLUDE_X86 > +if !VGCONF_ARCHS_INCLUDE_AMD64 > +GSL_CFLAGS+=-mfpmath=sse -msse2 > +endif > +endif > + > +# Trick to get a literal space to use in substitutions > +sp := $(subst ,, ) > + > +# Filter out spaces from GSL_CFLAGS to get unique build dir > +GSL_BUILD_DIR=$(AUX_CHECK_DIR)/gsl-build$(subst $(sp),,$(GSL_CFLAGS)) > + > +# These are all the tests, except siman and randist which can take > minutes. > +GSL_TESTS=block cblas cdf cheb combination complex const deriv dht diff \ > + eigen err fft fit histogram ieee-utils integration interpolation > \ > + linalg matrix min monte multifit multimin multiroots ntuple \ > + ode-initval permutation poly qrng rng roots sort specfunc \ > + statistics sum sys vector wavelet > + > +# Get the tar file if we don't have it yet. > +$(GSL_TAR): > + mkdir -p $(AUX_CHECK_DIR) > + wget -q -O $(GSL_TAR) $(GSL_URL) > + > For all these intermediate build artifacts, I'll add a .gitignore pattern so won't be accidentally committed to the tree by a future developer. > +# We need to autoreconf to make sure to get config.guess, config.sub > +# and libtool for newer architectures. > +$(GSL_SRC_DIR)/gsl-patched: $(GSL_TAR) > + echo "$(GSL_SHA256_SUM) $(GSL_TAR)" | sha256sum --check - > + (cd $(AUX_CHECK_DIR) && \ > + tar zxf $(GSL_TAR_NAME) && \ > + cd $(GSL_DIR_NAME) && \ > + patch -p1 < $(abs_top_srcdir)/auxprogs/gsl-1.6.patch && \ > + autoreconf -f -i -Wnone) > + touch $@ > + > +# We need make check -k because > +# some tests might fail even native (only on i386 though). > +# make check doesn't work reliably with -j. > +$(GSL_BUILD_DIR)/gsl-build: $(GSL_SRC_DIR)/gsl-patched > + mkdir -p $(GSL_BUILD_DIR) > + (cd $(GSL_BUILD_DIR) && \ > + $(GSL_SRC_DIR)/configure CFLAGS="$(GSL_CFLAGS)" && \ > + make -j $(nproc) && \ > + make check -k || true) > + touch $@ > + > +# We hope all tests PASS (so don't produce output except for the test > names). > +# But on x86 we get one FAIL, so that is "fine" too. > +# We currently don't check stderr, but we probably should. > +gsl-check: $(GSL_BUILD_DIR)/gsl-build > + (cd $(GSL_BUILD_DIR); \ > + for gsl_test in $(GSL_TESTS); do \ > + echo $$gsl_test; \ > + ./libtool --mode=execute $(abs_top_builddir)/vg-in-place -q \ > + > --suppressions=$(abs_top_srcdir)/auxprogs/gsl-1.6.supp \ > + $$gsl_test/test; \ > + done | grep --line-buffered -v ^PASS: | tee valgrind-gsl.out) > + for gsl_test in $(GSL_TESTS); do echo $$gsl_test; done \ > + | cmp - $(GSL_BUILD_DIR)/valgrind-gsl.out || \ > + diff -u $(abs_top_srcdir)/auxprogs/gsl-1.6.out.x86.exp \ > + $(GSL_BUILD_DIR)/valgrind-gsl.out > + > +# We keep the tarball but remove the unpacked sources and build > +gsl-clean: > + rm -rf $(GSL_SRC_NAME) $(GSL_BUILD_DIR) > + > > #---------------------------------------------------------------------------- > # General stuff > > #---------------------------------------------------------------------------- > > all-local: inplace-noinst_PROGRAMS inplace-noinst_DSYMS > > -clean-local: clean-noinst_DSYMS > +clean-local: clean-noinst_DSYMS auxclean > > install-exec-local: install-noinst_PROGRAMS install-noinst_DSYMS > > diff --git a/auxprogs/gsl-1.6.out.x86.exp b/auxprogs/gsl-1.6.out.x86.exp > new file mode 100644 > index 0000000000..996f285df1 > --- /dev/null > +++ b/auxprogs/gsl-1.6.out.x86.exp > @@ -0,0 +1,40 @@ > +block > +cblas > +cdf > +cheb > +combination > +complex > +const > +deriv > +dht > +diff > +eigen > +err > +fft > +fit > +histogram > +ieee-utils > +integration > +FAIL: qawo(f456) elist (7.25063790881233303e-15 observed vs > 7.25922435194575979e-15 expected) > +interpolation > +linalg > +matrix > +min > +monte > +multifit > +multimin > +multiroots > +ntuple > +ode-initval > +permutation > +poly > +qrng > +rng > +roots > +sort > +specfunc > +statistics > +sum > +sys > +vector > +wavelet > diff --git a/auxprogs/gsl-1.6.patch b/auxprogs/gsl-1.6.patch > new file mode 100644 > index 0000000000..a9ffd13c33 > --- /dev/null > +++ b/auxprogs/gsl-1.6.patch > @@ -0,0 +1,36 @@ > +diff -r -u gsl-1.6/vector/test_complex_source.c > gsl-1.6-patched/vector/test_complex_source.c > +--- gsl-1.6/vector/test_complex_source.c 2004-09-13 > 15:23:20.000000000 +0200 > ++++ gsl-1.6-patched/vector/test_complex_source.c 2005-07-24 > 08:37:54.000000000 +0200 > +@@ -75,7 +75,7 @@ > + if (stride == 1) > + { > + v0 = FUNCTION (gsl_vector, alloc) (N); > +- view = FUNCTION (gsl_vector, subvector) (v, 0, N); > ++ view = FUNCTION (gsl_vector, subvector) (v0, 0, N); > + v = &view.vector; > + } > + else > +diff -r -u gsl-1.6/vector/test_source.c > gsl-1.6-patched/vector/test_source.c > +--- gsl-1.6/vector/test_source.c 2004-09-13 15:23:20.000000000 +0200 > ++++ gsl-1.6-patched/vector/test_source.c 2005-07-24 > 08:37:54.000000000 +0200 > +@@ -75,7 +75,7 @@ > + if (stride == 1) > + { > + v0 = FUNCTION (gsl_vector, alloc) (N); > +- view = FUNCTION (gsl_vector, subvector) (v, 0, N); > ++ view = FUNCTION (gsl_vector, subvector) (v0, 0, N); > + v = &view.vector; > + } > + else > +diff -r -u gsl-1.6/wavelet/dwt.c gsl-1.6-patched/wavelet/dwt.c > +--- gsl-1.6/wavelet/dwt.c 2004-12-24 14:57:34.000000000 +0100 > ++++ gsl-1.6-patched/wavelet/dwt.c 2005-07-24 08:38:05.000000000 +0200 > +@@ -30,7 +30,7 @@ > + > + static int binary_logn (const size_t n); > + static void dwt_step (const gsl_wavelet * w, double *a, size_t stride, > +- size_t n, int isign, gsl_wavelet_workspace * work); > ++ size_t n, gsl_wavelet_direction dir, > gsl_wavelet_workspace * work); > + > + static int > + binary_logn (const size_t n) > diff --git a/auxprogs/gsl-1.6.supp b/auxprogs/gsl-1.6.supp > new file mode 100644 > index 0000000000..addf5d8caf > --- /dev/null > +++ b/auxprogs/gsl-1.6.supp > @@ -0,0 +1,14 @@ > +{ > + gsl-writes-uninit-data > + Memcheck:Param > + write(buf) > + fun:write > +} > + > +{ > + gsl-writes-uninit-data-nocancel > + Memcheck:Param > + write(buf) > + fun:__write_nocancel > +} > + > diff --git a/auxprogs/gsl16-badfree.patch b/auxprogs/gsl16-badfree.patch > deleted file mode 100644 > index d07d3a1ba9..0000000000 > --- a/auxprogs/gsl16-badfree.patch > +++ /dev/null > @@ -1,32 +0,0 @@ > -Index: test_complex_source.c > -=================================================================== > -RCS file: /home/gsl-cvs/gsl/vector/test_complex_source.c,v > -retrieving revision 1.23 > -diff -u -r1.23 test_complex_source.c > ---- test_complex_source.c 24 Jun 2005 11:33:25 -0000 1.23 > -+++ test_complex_source.c 6 Jul 2005 11:18:33 -0000 > -@@ -75,7 +75,7 @@ > - if (stride == 1) > - { > - v0 = FUNCTION (gsl_vector, alloc) (N); > -- view = FUNCTION (gsl_vector, subvector) (v, 0, N); > -+ view = FUNCTION (gsl_vector, subvector) (v0, 0, N); > - v = &view.vector; > - } > - else > -Index: test_source.c > -=================================================================== > -RCS file: /home/gsl-cvs/gsl/vector/test_source.c,v > -retrieving revision 1.26 > -diff -u -r1.26 test_source.c > ---- test_source.c 24 Jun 2005 11:33:26 -0000 1.26 > -+++ test_source.c 6 Jul 2005 11:14:18 -0000 > -@@ -75,7 +75,7 @@ > - if (stride == 1) > - { > - v0 = FUNCTION (gsl_vector, alloc) (N); > -- view = FUNCTION (gsl_vector, subvector) (v, 0, N); > -+ view = FUNCTION (gsl_vector, subvector) (v0, 0, N); > - v = &view.vector; > - } > - else > diff --git a/auxprogs/gsl16-wavelet.patch b/auxprogs/gsl16-wavelet.patch > deleted file mode 100644 > index 525e9cf5e6..0000000000 > --- a/auxprogs/gsl16-wavelet.patch > +++ /dev/null > @@ -1,11 +0,0 @@ > ---- wavelet/dwt.c~ 2004-12-24 14:57:34.000000000 +0100 > -+++ wavelet/dwt.c 2005-07-08 23:31:32.000000000 +0200 > -@@ -30,7 +30,7 @@ > - > - static int binary_logn (const size_t n); > - static void dwt_step (const gsl_wavelet * w, double *a, size_t stride, > -- size_t n, int isign, gsl_wavelet_workspace * work); > -+ size_t n, gsl_wavelet_direction dir, > gsl_wavelet_workspace * work); > - > - static int > - binary_logn (const size_t n) > diff --git a/auxprogs/gsl16test b/auxprogs/gsl16test > deleted file mode 100755 > index 22f7cab2e8..0000000000 > --- a/auxprogs/gsl16test > +++ /dev/null > @@ -1,118 +0,0 @@ > -#!/bin/sh > - > -# Do an automated test which involves building and regtesting version > -# 1.6 of the GNU Scientific Library (gsl). This has proven to be a > -# very thorough test of Vex's CPU simulations and has exposed bugs > -# which had not been previously discovered. Gsl contains more > -# than 100,000 tests as part of its regression suite, and so this > -# script's purpose is to runs those tests using valgrind and compare > -# against the same tests run natively. > -# > -# You can download gsl and get more info about it at > -# http://www.gnu.org/software/gsl > - > - > - > -# Args: > -# absolute name of gsl-1.6.tar.gz file > -# name of C compiler > -# args for C compiler > -# name of Valgrind > -# args for Valgrind > - > -# Results: 3.7.0 --tool=none > -# x86 1 failure Ubuntu 10.10 > -# FAIL: qawo(f456) elist (7.25063790881233303e-15 observed vs > 7.25922435194575979e-15 expected) > -# same failure was also present in 3.6.1 > -# s390x 0 failures on z900 running RHEL4 > - > -if [ $# != 5 ] > -then > - echo "usage: gsl16test /absolute/name/of/gsl-1.6-patched.tar.gz" > - echo " C-compiler-command" > - echo " flags-for-C-compiler" > - echo " Valgrind-command" > - echo " flags-for-Valgrind" > - exit 1 > -fi > - > - > -runcmd () { > - echo -n " $1 ... " > - shift > - > - (eval "$*") >> log.verbose 2>&1 > - > - if [ $? = 0 ] > - then > - echo "done" > - return 0 > - else > - echo "failed" > - return 1 > - fi > -} > - > -GSL_FILE=$1 > -GSL_CC=$2 > -GSL_CFLAGS=$3 > -GSL_VV=$4 > -GSL_VFLAGS=$5 > - > -TESTS1="block/test cblas/test cdf/test cheb/test combination/test" > -TESTS2="complex/test const/test deriv/test dht/test diff/test" > -TESTS3="eigen/test err/test fft/test fit/test histogram/test" > -TESTS4="ieee-utils/test integration/test interpolation/test linalg/test" > -TESTS5="matrix/test min/test monte/test multifit/test multimin/test" > -TESTS6="multiroots/test ntuple/test ode-initval/test permutation/test" > -TESTS7="poly/test qrng/test randist/test rng/test roots/test siman/test" > -TESTS8="sort/test specfunc/test statistics/test sum/test sys/test" > -TESTS9="vector/test wavelet/test" > - > -ALL_TESTS="$TESTS1 $TESTS2 $TESTS3 $TESTS4 $TESTS5 $TESTS6 $TESTS7 > $TESTS8 $TESTS9" > - > -echo "gsl16test: src: " $GSL_FILE > -echo "gsl16test: cc: " $GSL_CC > -echo "gsl16test: cflags: " $GSL_CFLAGS > -echo "gsl16test: valgrind: " $GSL_VV > -echo "gsl16test: vflags: " $GSL_VFLAGS > - > -rm -rf log.verbose gsl-1.6-patched summary.txt > - > -echo > log.verbose > - > -echo > summary.txt > -echo $0 $1 \"$2\" \"$3\" \"$4\" \"$5\" >> summary.txt > -echo >> summary.txt > - > -runcmd "Untarring " \ > - "rm -rf gsl-1.6-patched && tar xzf $GSL_FILE" && \ > -\ > -runcmd "Configuring " \ > - "(cd gsl-1.6-patched && CC=$GSL_CC CFLAGS=\"$GSL_CFLAGS\" > ./configure)" && \ > -\ > -runcmd "Building " \ > - "(cd gsl-1.6-patched && make -j4 && make -k check)" > - > -echo -n " Collecting reference results " > -rm -f out-REF > -(cd gsl-1.6-patched && for f in $ALL_TESTS ; do ./$f ; done) &> out-REF > -echo " ... done" > - > -echo -n " Collecting valgrinded results " > -rm -f out-VAL > -(cd gsl-1.6-patched && for f in $ALL_TESTS ; do eval $GSL_VV -v > --trace-children=yes "$GSL_VFLAGS" ./$f ; done) &> out-VAL > -echo " ... done" > - > -echo -n " Native fails: " && (grep FAIL: out-REF | wc -l) > -echo -n " Native passes: " && (grep PASS: out-REF | wc -l) > -echo -n " Valgrind fails: " && (grep FAIL: out-VAL | wc -l) > -echo -n " Valgrind passes: " && (grep PASS: out-VAL | wc -l) > - > -(echo -n " Native fails: " && (grep FAIL: out-REF | wc -l)) >> > summary.txt > -(echo -n " Native passes: " && (grep PASS: out-REF | wc -l)) >> > summary.txt > -(echo -n " Valgrind fails: " && (grep FAIL: out-VAL | wc -l)) >> > summary.txt > -(echo -n " Valgrind passes: " && (grep PASS: out-VAL | wc -l)) >> > summary.txt > -echo >> summary.txt > - > -echo > > > _______________________________________________ > Valgrind-developers mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-developers > |
|
From: Mark W. <ma...@kl...> - 2020-07-05 16:49:05
|
Hi Rhys, On Fri, 2020-07-03 at 10:27 +1000, Rhys Kidd wrote: > This is a really neat test suite to run through valgrind. Impressed > with how clean it was. That is because Julian used to run it by hand before releases and silently fixed any issues found :) I thought it would be a good idea to automate it, so this kind of testing doesn't rely on someone doing it all manually. Note that I setup a buildbot with workers for aarch64, armhf, i386, ppc64, ppc64le, s390x and x86_64: https://builder.wildebeest.org/buildbot/#/builders?tags=valgrind Currently they are all green, but that is slightly cheating. - i386 has one failing tests: FAIL: qawo(f456) elist (7.25063790881233303e-15 observed vs 7.25922435194575979e-15 expected) (This is in the gsl-1.6.out.x86.exp file, so it still passes) - armhf skips make check because it currently fails with: /usr/bin/ld: v6intThumb-v6intThumb.o: relocation R_ARM_THM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC v6intThumb-v6intThumb.o: error adding symbols: Bad value Note that adding -fPIC doesn't really help, the relocation is still disallowed. It looks similar to: https://bugs.kde.org/show_bug.cgi?id=339862 But the "fix" attached to that bug doesn't work either, the assembler will then complain about a bad offset/address of the label. We might have to look for alternative armhf and aarch64 builders, the current machines are really, really, slow and they are "cloud servers" at scaleway, which is going to stop supporting arm based servers end of this year. - s390x produces memcheck warnings that I haven't investigated yet, but that are false positives we really should fix: ==9580== Conditional jump or move depends on uninitialised value(s) ==9580== at 0x1005B8A: compare_complex_float_results (compare_source.c:38) ==9580== by 0x1005B8A: test_complex_float_func (test_complex_source.c:213) ==9580== by 0x1000DE1: main (test.c:108) ==9580== ==9580== Conditional jump or move depends on uninitialised value(s) ==9580== at 0x1005A80: compare_complex_float_results (compare_source.c:44) ==9580== by 0x1005A80: test_complex_float_func (test_complex_source.c:213) ==9580== by 0x1000DE1: main (test.c:108) I filed https://bugs.kde.org/show_bug.cgi?id=423908 Once we fix the s390 issue we should change the test so that any output to stderr flags the testcase as failing. - mips I haven't been able to test make auxchecks under mips. > Do you happen to know how a more recent gsl, like 2.x, > goes? The results look fairly good (at least on x86_64). But newer GSL releases are much bigger, take a much longer to build and test and the test output isn't as convenient. With GSL 1.6 we can simply grep for ^PASS: and any other output tells us something is wrong. > I've noticed two little things (in line below), which I'll commit a > patch to git master branch for. > [...] > I think you meant to include a prefix slash here as $abs_builddir > does not > have a trailing slash: > > -AUX_CHECK_DIR=$(abs_builddir)auxchecks > +AUX_CHECK_DIR=$(abs_builddir)/auxchecks Yes, sorry I missed this. Probably because on all the buildbot workers the tests are run with: make auxchecks AUX_CHECK_DIR=$HOME/valgrind-auxtests That way the gsl tarball, sourcedir patching and builddir can be reused between runs even if the main valgrind source/builddir are cleaned between runs. > For all these intermediate build artifacts, I'll add a .gitignore pattern > so won't be accidentally committed to the tree by a future developer. Thanks. The one thing that I would have liked, but my Make-foo isn't strong enough, is to automatically build gsl twice with primary and secondary architecture flags. You can currently do it by hand by overriding GSL_CFLAGS="-m32 -march=..." Cheers, Mark |