Merge pull request #8289 from ethereum/fix-8219

Switch nightly fuzzer build from ASan (slow) to UBSan (fast)
This commit is contained in:
chriseth 2020-02-12 16:18:32 +01:00 committed by GitHub
commit 946f74748c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 10 deletions

View File

@ -414,7 +414,6 @@ jobs:
name: Regression tests name: Regression tests
command: | command: |
mkdir -p test_results mkdir -p test_results
export ASAN_OPTIONS="check_initialization_order=true:detect_stack_use_after_return=true:strict_init_order=true:strict_string_checks=true:detect_invalid_pointer_pairs=2"
scripts/regressions.py -o test_results scripts/regressions.py -o test_results
- run: *gitter_notify_failure - run: *gitter_notify_failure
- run: *gitter_notify_success - run: *gitter_notify_success
@ -793,7 +792,7 @@ workflows:
jobs: jobs:
# OSSFUZZ builds and (regression) tests # OSSFUZZ builds and (regression) tests
- b_ubu_ossfuzz: *workflow_trigger_on_tags - b_ubu_ossfuzz: *workflow_trigger_on_tags
# - t_ubu_ossfuzz: *workflow_ubuntu1904_ossfuzz - t_ubu_ossfuzz: *workflow_ubuntu1904_ossfuzz
# Code Coverage enabled build and tests # Code Coverage enabled build and tests
- b_ubu_codecov: *workflow_trigger_on_tags - b_ubu_codecov: *workflow_trigger_on_tags

View File

@ -7,5 +7,5 @@ set(USE_CVC4 OFF CACHE BOOL "Disable CVC4" FORCE)
set(OSSFUZZ ON CACHE BOOL "Enable fuzzer build" FORCE) set(OSSFUZZ ON CACHE BOOL "Enable fuzzer build" FORCE)
# Use libfuzzer as the fuzzing back-end # Use libfuzzer as the fuzzing back-end
set(LIB_FUZZING_ENGINE "-fsanitize=fuzzer" CACHE STRING "Use libfuzzer back-end" FORCE) set(LIB_FUZZING_ENGINE "-fsanitize=fuzzer" CACHE STRING "Use libfuzzer back-end" FORCE)
# clang/libfuzzer specific flags for ASan instrumentation # clang/libfuzzer specific flags for UBSan instrumentation
set(CMAKE_CXX_FLAGS "-O1 -gline-tables-only -fsanitize=address -fsanitize-address-use-after-scope -fsanitize=fuzzer-no-link -stdlib=libstdc++" CACHE STRING "Custom compilation flags" FORCE) set(CMAKE_CXX_FLAGS "-O1 -gline-tables-only -fsanitize=undefined -fsanitize=fuzzer-no-link -stdlib=libstdc++" CACHE STRING "Custom compilation flags" FORCE)

View File

@ -31,8 +31,7 @@ class PrintDotsThread(object):
time.sleep(self.interval) time.sleep(self.interval)
class regressor(): class regressor():
_re_sanitizer_log = re.compile(r"""ERROR: (?P<sanitizer>\w+).*""") _re_sanitizer_log = re.compile(r"""(.*runtime error: (?P<sanitizer>\w+).*|std::exception::what: (?P<description>\w+).*)""")
_error_blacklist = ["AddressSanitizer", "libFuzzer"]
def __init__(self, description, args): def __init__(self, description, args):
self._description = description self._description = description
@ -85,16 +84,13 @@ class regressor():
bool: Test status. bool: Test status.
True -> Success True -> Success
False -> Failure False -> Failure
int: Number of suppressed memory leaks
""" """
## Log may contain non ASCII characters, so we simply stringify them ## Log may contain non ASCII characters, so we simply stringify them
## since they don't matter for regular expression matching ## since they don't matter for regular expression matching
rawtext = str(open(logfile, 'rb').read()) rawtext = str(open(logfile, 'rb').read())
list = re.findall(self._re_sanitizer_log, rawtext) list = re.findall(self._re_sanitizer_log, rawtext)
numSuppressedLeaks = list.count("LeakSanitizer") return len(list) == 0
rv = any(word in list for word in self._error_blacklist)
return not rv, numSuppressedLeaks
def run(self): def run(self):
""" """