From dbfe008b43d30fae97a3d1a848476bc8fdf8c13a Mon Sep 17 00:00:00 2001 From: Michael Achenbach Date: Wed, 19 Jul 2017 16:59:48 +0200 Subject: [PATCH] [test] Add test isolation and parameters for ubsan This adds a missing swarming config to the ubsan builders to fix test isolation. This also adds ubsan_vptr to the inferred options from build metadata. For ubsan_vptr builds, the test runner makes sure to set up the required options. TBR=ishell@chromium.org Bug: chromium:726584 Change-Id: I9667ba2b6d9d0f363f7cc94d23308e09da002d99 Reviewed-on: https://chromium-review.googlesource.com/577689 Reviewed-by: Igor Sheludko Reviewed-by: Michael Achenbach Commit-Queue: Michael Achenbach Cr-Commit-Position: refs/heads/master@{#46866} --- BUILD.gn | 1 + infra/mb/mb_config.pyl | 4 ++-- tools/run-deopt-fuzzer.py | 1 + tools/run-tests.py | 17 ++++++++++++++--- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index c912a856cd..34c6c09929 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -813,6 +813,7 @@ action("v8_dump_build_config") { "is_gcov_coverage=$is_gcov_coverage", "is_msan=$is_msan", "is_tsan=$is_tsan", + "is_ubsan_vptr=$is_ubsan_vptr", "target_cpu=\"$target_cpu\"", "v8_current_cpu=\"$v8_current_cpu\"", "v8_enable_i18n_support=$v8_enable_i18n_support", diff --git a/infra/mb/mb_config.pyl b/infra/mb/mb_config.pyl index 269e992475..d0c328a353 100644 --- a/infra/mb/mb_config.pyl +++ b/infra/mb/mb_config.pyl @@ -407,9 +407,9 @@ 'gn_release_x64_tsan_minimal_symbols': [ 'gn', 'release_bot', 'x64', 'tsan', 'minimal_symbols', 'swarming'], 'gn_release_x64_ubsan_vptr': [ - 'gn', 'release_bot', 'x64', 'ubsan_vptr'], + 'gn', 'release_bot', 'x64', 'ubsan_vptr', 'swarming'], 'gn_release_x64_ubsan_vptr_minimal_symbols': [ - 'gn', 'release_bot', 'x64', 'ubsan_vptr', 'minimal_symbols'], + 'gn', 'release_bot', 'x64', 'ubsan_vptr', 'minimal_symbols', 'swarming'], 'gn_release_x64_valgrind': [ 'gn', 'release_bot', 'x64', 'swarming', 'valgrind', 'no_custom_libcxx'], diff --git a/tools/run-deopt-fuzzer.py b/tools/run-deopt-fuzzer.py index b2399ccf06..1f50e02602 100755 --- a/tools/run-deopt-fuzzer.py +++ b/tools/run-deopt-fuzzer.py @@ -404,6 +404,7 @@ def Execute(arch, mode, args, options, suites, workspace): "predictable": False, "byteorder": sys.byteorder, "no_harness": False, + "ubsan_vptr": False, } all_tests = [] num_tests = 0 diff --git a/tools/run-tests.py b/tools/run-tests.py index 8be8d42cad..9b74e3d786 100755 --- a/tools/run-tests.py +++ b/tools/run-tests.py @@ -364,8 +364,11 @@ def BuildOptions(): result.add_option("--random-seed-stress-count", default=1, type="int", dest="random_seed_stress_count", help="Number of runs with different random seeds") + result.add_option("--ubsan-vptr", + help="Regard test expectations for UBSanVptr", + default=False, action="store_true") result.add_option("--msan", - help="Regard test expectations for MSAN", + help="Regard test expectations for UBSanVptr", default=False, action="store_true") return result @@ -423,6 +426,12 @@ def SetupEnvironment(options): symbolizer, ]) + if options.ubsan_vptr: + os.environ['UBSAN_OPTIONS'] = ":".join([ + 'print_stacktrace=1', + symbolizer, + ]) + if options.msan: os.environ['MSAN_OPTIONS'] = symbolizer @@ -502,7 +511,8 @@ def ProcessOptions(options): ('msan', build_config["is_msan"]), ('no_i18n', not build_config["v8_enable_i18n_support"]), ('no_snap', not build_config["v8_use_snapshot"]), - ('tsan', build_config["is_tsan"])): + ('tsan', build_config["is_tsan"]), + ('ubsan_vptr', build_config["is_ubsan_vptr"])): cmd_line_value = getattr(options, param) if cmd_line_value not in [None, True, False] and cmd_line_value != value: # TODO(machenbach): This is for string options only. Requires options @@ -831,7 +841,8 @@ def Execute(arch, mode, args, options, suites): "novfp3": options.novfp3, "predictable": options.predictable, "byteorder": sys.byteorder, - "no_harness": options.no_harness + "no_harness": options.no_harness, + "ubsan_vptr": options.ubsan_vptr, } all_tests = [] num_tests = 0