diff options
-rw-r--r-- | test/ChangeLog | 8 | ||||
-rw-r--r-- | test/Makefile.am | 12 | ||||
-rw-r--r-- | test/Makefile.in | 12 | ||||
-rw-r--r-- | test/valgrind.awk | 43 |
4 files changed, 53 insertions, 22 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index c5357c8c..05327e70 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,11 @@ +2016-11-07 Arnold D. Robbins <arnold@skeeve.com> + + * valgrind.awk: New file. Based on original valgrind-scan code. + Having it in a separate file makes it easier to adjust. + Commented out several checks that just produced false positives. + Add check for invalid read and write. + * Makefile.am (valgrind-scan): Use valgrind.awk. + 2016-11-04 Fabio Berton <fabio.berton@ossystems.com.br> * arrayind1.awk: Remove "#!/usr/local/bin/awk -f" as none of the diff --git a/test/Makefile.am b/test/Makefile.am index b0bfc128..e6af8f52 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -2403,17 +2403,7 @@ diffout: # convenient way to scan valgrind results for errors valgrind-scan: @echo "Scanning valgrind log files for problems:" - @$(AWK) '\ - function show() {if (cmd) {printf "%s: %s\n",FILENAME,cmd; cmd = ""}; \ - printf "\t%s\n",$$0}; \ - {$$1 = ""}; \ - $$2 == "Command:" {incmd = 1; $$2 = ""; cmd = $$0; next}; \ - incmd {if (/Parent PID:/) incmd = 0; else {cmd = (cmd $$0); next}}; \ - /ERROR SUMMARY:/ && !/: 0 errors from 0 contexts/ {show()}; \ - /definitely lost:/ && !/: 0 bytes in 0 blocks/ {show()}; \ - /possibly lost:/ && !/: 0 bytes in 0 blocks/ {show()}; \ - / suppressed:/ && !/: 0 bytes in 0 blocks/ {show()}; \ - ' log.[0-9]* + @$(AWK) -f "$(srcdir)"/valgrind.awk log.[0-9]* # This target is for testing with electric fence. efence: diff --git a/test/Makefile.in b/test/Makefile.in index 1c4514bb..bc8d583a 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -4473,17 +4473,7 @@ diffout: # convenient way to scan valgrind results for errors valgrind-scan: @echo "Scanning valgrind log files for problems:" - @$(AWK) '\ - function show() {if (cmd) {printf "%s: %s\n",FILENAME,cmd; cmd = ""}; \ - printf "\t%s\n",$$0}; \ - {$$1 = ""}; \ - $$2 == "Command:" {incmd = 1; $$2 = ""; cmd = $$0; next}; \ - incmd {if (/Parent PID:/) incmd = 0; else {cmd = (cmd $$0); next}}; \ - /ERROR SUMMARY:/ && !/: 0 errors from 0 contexts/ {show()}; \ - /definitely lost:/ && !/: 0 bytes in 0 blocks/ {show()}; \ - /possibly lost:/ && !/: 0 bytes in 0 blocks/ {show()}; \ - / suppressed:/ && !/: 0 bytes in 0 blocks/ {show()}; \ - ' log.[0-9]* + @$(AWK) -f "$(srcdir)"/valgrind.awk log.[0-9]* # This target is for testing with electric fence. efence: diff --git a/test/valgrind.awk b/test/valgrind.awk new file mode 100644 index 00000000..95699da1 --- /dev/null +++ b/test/valgrind.awk @@ -0,0 +1,43 @@ +function show() +{ + error_count++ + if (cmd) { + printf "%s: %s\n", FILENAME, cmd + cmd = "" + } + printf "\t%s\n",$0 +} + +FNR == 1 { + error_count = 0 +} + +{ $1 = "" } + +$2 == "Command:" { + incmd = 1 + $2 = "" + cmd = $0 + next +} + +incmd { + if (/Parent PID:/) + incmd = 0 + else { + cmd = (cmd $0) + next + } +} + +/ERROR SUMMARY:/ && !/: 0 errors from 0 contexts/ && error_count > 0 { + show() +} + +/definitely lost:/ && !/: 0 bytes in 0 blocks/ { show() } + +# /possibly lost:/ && !/: 0 bytes in 0 blocks/ { show() } + +# / suppressed:/ && !/: 0 bytes in 0 blocks/ { show() } + +/[Ii]nvalid (read|write)/ { show() } |