From 98815fb98a319b5d3fc7f2713c9eba34663358e2 Mon Sep 17 00:00:00 2001 From: Bhargava Shastry Date: Wed, 24 Apr 2019 18:46:45 +0200 Subject: [PATCH] Updated script to treat libFuzzer errors as failures --- scripts/regressions.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/regressions.py b/scripts/regressions.py index 8e60660e7..8851f4130 100755 --- a/scripts/regressions.py +++ b/scripts/regressions.py @@ -13,6 +13,7 @@ DESCRIPTION = """Regressor is a tool to run regression tests in a CI env.""" class regressor(): _re_sanitizer_log = re.compile(r"""ERROR: (?P\w+).*""") + _error_blacklist = ["AddressSanitizer", "libFuzzer"] def __init__(self, description, args): self._description = description @@ -50,7 +51,8 @@ class regressor(): def process_log(self, logfile): list = re.findall(self._re_sanitizer_log, open(logfile, 'r').read()) numSuppressedLeaks = list.count("LeakSanitizer") - return "AddressSanitizer" not in list, numSuppressedLeaks + rv = any(word in list for word in self._error_blacklist) + return not rv, numSuppressedLeaks def run(self): for fuzzer in glob.iglob("{}/*_ossfuzz".format(self._fuzzer_path)): @@ -58,7 +60,7 @@ class regressor(): logfile = os.path.join(self._logpath, "{}.log".format(basename)) corpus_dir = "/tmp/solidity-fuzzing-corpus/{0}_seed_corpus" \ .format(basename) - cmd = "find {0} -type f | xargs {1}".format(corpus_dir, fuzzer) + cmd = "find {0} -type f | xargs -P2 {1}".format(corpus_dir, fuzzer) if not self.run_cmd(cmd, logfile=logfile): ret, numLeaks = self.process_log(logfile) if not ret: