From c0ffb71ef57ca386cd1b5259f02a2aed7931dab4 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sat, 7 Nov 2020 19:11:27 +0000 Subject: [PATCH] [ci] Make valgrind check stricter (#3536) --- .ci/test_r_package_valgrind.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.ci/test_r_package_valgrind.sh b/.ci/test_r_package_valgrind.sh index 1cc06e0660a2..50d65bc340c2 100755 --- a/.ci/test_r_package_valgrind.sh +++ b/.ci/test_r_package_valgrind.sh @@ -64,3 +64,21 @@ if [[ ${bytes_possibly_lost} -gt 352 ]]; then echo "valgrind found ${bytes_possibly_lost} bytes possibly lost" exit -1 fi + +invalid_reads=$( + cat ${VALGRIND_LOGS_FILE} \ + | grep --count -i "Invalid read" +) +if [[ ${invalid_reads} -gt 0 ]]; then + echo "valgrind found invalid reads: ${invalid_reads}" + exit -1 +fi + +invalid_writes=$( + cat ${VALGRIND_LOGS_FILE} \ + | grep --count -i "Invalid write" +) +if [[ ${invalid_writes} -gt 0 ]]; then + echo "valgrind found invalid writes: ${invalid_writes}" + exit -1 +fi