From 62b702d568ae0e764219ea47e165556f7b39392b Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Sun, 11 Jan 2015 11:03:17 +0100 Subject: do not memcpy if src and dst are the same This is harmless really but triggers a valgrind error. Signed-off-by: Loic Dachary --- src/gf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gf.c b/src/gf.c index 835fb12..8477a65 100644 --- a/src/gf.c +++ b/src/gf.c @@ -910,7 +910,8 @@ void gf_multby_one(void *src, void *dest, int bytes, int xor) gf_region_data rd; if (!xor) { - memcpy(dest, src, bytes); + if (dest != src) + memcpy(dest, src, bytes); return; } uls = (unsigned long) src; -- cgit v1.2.1 From 22cd7b15e8d65f855f2739bf0e20d9f1319c4c4b Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Sun, 11 Jan 2015 11:00:37 +0100 Subject: add --enable-valgrind for make check If --enable-valgrind is given to ./configure, all tests are run with valgrind set to fail if an error is reported ( --error-exitcode=1 ) Signed-off-by: Loic Dachary --- configure.ac | 6 ++++++ tools/Makefile.am | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index ad7bb83..3e8cf18 100644 --- a/configure.ac +++ b/configure.ac @@ -60,5 +60,11 @@ AC_ARG_ENABLE([sse], fi] ) +AC_ARG_ENABLE([valgrind], + [AS_HELP_STRING([--enable-valgrind], [run tests with valgrind])], + [], + [enable_valgrind=no]) +AM_CONDITIONAL(ENABLE_VALGRIND, test "x$enable_valgrind" != xno) + AC_CONFIG_FILES([Makefile src/Makefile tools/Makefile test/Makefile examples/Makefile]) AC_OUTPUT diff --git a/tools/Makefile.am b/tools/Makefile.am index eb27d4a..8c4b1ce 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -33,9 +33,13 @@ gf_inline_time_SOURCES = gf_inline_time.c #gf_inline_time_LDFLAGS = -lgf_complete gf_inline_time_LDADD = ../src/libgf_complete.la +if ENABLE_VALGRIND +VALGRIND = | sed -e 's|^|../libtool --mode=execute valgrind --quiet --error-exitcode=1 --tool=memcheck |' +endif + # gf_unit tests as generated by gf_methods gf_unit_w%.sh: gf_methods - ./$^ $(@:gf_unit_w%.sh=%) -A -U > $@ || rm $@ + ./$^ $(@:gf_unit_w%.sh=%) -A -U ${VALGRIND} > $@ || rm $@ TESTS = gf_unit_w128.sh \ gf_unit_w64.sh \ -- cgit v1.2.1 From e2dd917ea1490c85f0edc0e3af70fd6dbdc6ee4f Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Tue, 13 Sep 2016 10:25:13 +0200 Subject: increase the verbosity of make check failures Signed-off-by: Loic Dachary --- Makefile.am | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile.am b/Makefile.am index fecda6d..cfb293a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,3 +6,5 @@ ACLOCAL_AMFLAGS = -I m4 include_HEADERS = include/gf_complete.h include/gf_method.h include/gf_rand.h include/gf_general.h +# display the output of failed TESTS after a failed make check +export VERBOSE = true -- cgit v1.2.1 From f940bf3b5be7eec6fe3e38a11ab65592b1dc10db Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Tue, 13 Sep 2016 11:41:40 +0200 Subject: log-zero-ext: workaround for uninitialized memory Workaround until issue #13 is dealt with. Signed-off-by: Loic Dachary --- tools/Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/Makefile.am b/tools/Makefile.am index 8c4b1ce..a9dd8b9 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -33,8 +33,9 @@ gf_inline_time_SOURCES = gf_inline_time.c #gf_inline_time_LDFLAGS = -lgf_complete gf_inline_time_LDADD = ../src/libgf_complete.la +# gf_unit 8 A -1 -m LOG_ZERO_EXT is excluded until http://lab.jerasure.org/jerasure/gf-complete/issues/13 is resolved if ENABLE_VALGRIND -VALGRIND = | sed -e 's|^|../libtool --mode=execute valgrind --quiet --error-exitcode=1 --tool=memcheck |' +VALGRIND = | perl -p -e 's|^|../libtool --mode=execute valgrind --quiet --error-exitcode=1 --tool=memcheck | if(!/gf_unit 8 A -1 -m LOG_ZERO_EXT/)' endif # gf_unit tests as generated by gf_methods -- cgit v1.2.1