summaryrefslogtreecommitdiffstats
path: root/tools/valgrind/memcheck_analyze.py
diff options
context:
space:
mode:
authortimurrrr@chromium.org <timurrrr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-26 12:54:44 +0000
committertimurrrr@chromium.org <timurrrr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-26 12:54:44 +0000
commit9ded99137e5ada1d9fbeeee8632f3a825f3c4498 (patch)
tree8a2645eabef077ec85894b281c3e96b1c81c2fb8 /tools/valgrind/memcheck_analyze.py
parenta10d16e53eac4afba30c05ff56911576be2c569e (diff)
downloadchromium_src-9ded99137e5ada1d9fbeeee8632f3a825f3c4498.zip
chromium_src-9ded99137e5ada1d9fbeeee8632f3a825f3c4498.tar.gz
chromium_src-9ded99137e5ada1d9fbeeee8632f3a825f3c4498.tar.bz2
Implement more sanity tests for Memcheck/Valgrind
Review URL: http://codereview.chromium.org/1242008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42751 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/valgrind/memcheck_analyze.py')
-rwxr-xr-xtools/valgrind/memcheck_analyze.py27
1 files changed, 24 insertions, 3 deletions
diff --git a/tools/valgrind/memcheck_analyze.py b/tools/valgrind/memcheck_analyze.py
index c70df99..41bf4da 100755
--- a/tools/valgrind/memcheck_analyze.py
+++ b/tools/valgrind/memcheck_analyze.py
@@ -311,7 +311,22 @@ class MemcheckAnalyze:
''' Given a set of Valgrind XML files, parse all the errors out of them,
unique them and output the results.'''
- SANITY_TEST_SUPPRESSION = "Memcheck sanity test"
+ SANITY_TEST_SUPPRESSIONS = [
+ "Memcheck sanity test (array deleted without []).",
+ "Memcheck sanity test (malloc/read left).",
+ "Memcheck sanity test (malloc/read right).",
+ "Memcheck sanity test (malloc/write left).",
+ "Memcheck sanity test (malloc/write right).",
+ "Memcheck sanity test (memory leak).",
+ "Memcheck sanity test (new/read left).",
+ "Memcheck sanity test (new/read right).",
+ "Memcheck sanity test (new/write left).",
+ "Memcheck sanity test (new/write right).",
+ "Memcheck sanity test (single element deleted with []).",
+ "Memcheck sanity test (write after delete).",
+ "Memcheck sanity test (write after free).",
+ ]
+
def __init__(self, source_dir, files, show_all_leaks=False, use_gdb=False):
'''Reads in a set of files.
@@ -439,10 +454,13 @@ class MemcheckAnalyze:
print "-----------------------------------------------------"
print "Suppressions used:"
print " count name"
+ remaining_sanity_supp = set(MemcheckAnalyze.SANITY_TEST_SUPPRESSIONS)
for item in sorted(self._suppcounts.items(), key=lambda (k,v): (v,k)):
print "%7s %s" % (item[1], item[0])
- if item[0].startswith(MemcheckAnalyze.SANITY_TEST_SUPPRESSION):
- is_sane = True
+ if item[0] in remaining_sanity_supp:
+ remaining_sanity_supp.remove(item[0])
+ if len(remaining_sanity_supp) == 0:
+ is_sane = True
print "-----------------------------------------------------"
sys.stdout.flush()
@@ -462,6 +480,9 @@ class MemcheckAnalyze:
# Report tool's insanity even if there were errors.
if check_sanity and not is_sane:
logging.error("FAIL! Sanity check failed!")
+ logging.info("The following test errors were not handled: ")
+ for supp in remaining_sanity_supp:
+ logging.info(" " + supp)
retcode = -3
if retcode != 0: