Commit 46233c2b authored by pcc's avatar pcc Committed by Commit Bot

Make the linux_chromium_cfi_rel_ng trybot more useful.

This change causes the trybot to:
- use ThinLTO
- produce detailed diagnostics
- produce symbolized stack traces.
The goal is to reduce cycle times on the bot, as well as provide more
details when it fails so that its results are more actionable.

Tested by patching a bad cast into one of the base_unittests and
sending a swarming job as described here:
http://dev.chromium.org/developers/testing/isolated-testing/for-swes#TOC-Run-a-test-built-locally-on-Swarming

BUG=732652
R=dpranke@chromium.org

Review-Url: https://codereview.chromium.org/2938383004
Cr-Commit-Position: refs/heads/master@{#480983}
parent 5ceed48c
...@@ -52,7 +52,7 @@ def fix_python_path(cmd): ...@@ -52,7 +52,7 @@ def fix_python_path(cmd):
return out return out
def get_sanitizer_env(cmd, asan, lsan, msan, tsan): def get_sanitizer_env(cmd, asan, lsan, msan, tsan, cfi_diag):
"""Returns the envirnoment flags needed for sanitizer tools.""" """Returns the envirnoment flags needed for sanitizer tools."""
extra_env = {} extra_env = {}
...@@ -73,7 +73,7 @@ def get_sanitizer_env(cmd, asan, lsan, msan, tsan): ...@@ -73,7 +73,7 @@ def get_sanitizer_env(cmd, asan, lsan, msan, tsan):
# fact, it needs symbolization to be able to apply suppressions. # fact, it needs symbolization to be able to apply suppressions.
symbolization_options = ['symbolize=1', symbolization_options = ['symbolize=1',
'external_symbolizer_path=%s' % symbolizer_path] 'external_symbolizer_path=%s' % symbolizer_path]
elif (asan or msan) and sys.platform not in ['win32', 'cygwin']: elif (asan or msan or cfi_diag) and sys.platform not in ['win32', 'cygwin']:
# ASan uses a script for offline symbolization, except on Windows. # ASan uses a script for offline symbolization, except on Windows.
# Important note: when running ASan with leak detection enabled, we must use # Important note: when running ASan with leak detection enabled, we must use
# the LSan symbolization options above. # the LSan symbolization options above.
...@@ -120,6 +120,11 @@ def get_sanitizer_env(cmd, asan, lsan, msan, tsan): ...@@ -120,6 +120,11 @@ def get_sanitizer_env(cmd, asan, lsan, msan, tsan):
tsan_options = symbolization_options[:] tsan_options = symbolization_options[:]
extra_env['TSAN_OPTIONS'] = ' '.join(tsan_options) extra_env['TSAN_OPTIONS'] = ' '.join(tsan_options)
# CFI uses the UBSan runtime to provide diagnostics.
if cfi_diag:
ubsan_options = symbolization_options[:] + ['print_stacktrace=1']
extra_env['UBSAN_OPTIONS'] = ' '.join(ubsan_options)
return extra_env return extra_env
...@@ -185,16 +190,17 @@ def run_executable(cmd, env): ...@@ -185,16 +190,17 @@ def run_executable(cmd, env):
lsan = '--lsan=1' in cmd lsan = '--lsan=1' in cmd
msan = '--msan=1' in cmd msan = '--msan=1' in cmd
tsan = '--tsan=1' in cmd tsan = '--tsan=1' in cmd
cfi_diag = '--cfi-diag=1' in cmd
if sys.platform in ['win32', 'cygwin']: if sys.platform in ['win32', 'cygwin']:
# Symbolization works in-process on Windows even when sandboxed. # Symbolization works in-process on Windows even when sandboxed.
use_symbolization_script = False use_symbolization_script = False
else: else:
# LSan doesn't support sandboxing yet, so we use the in-process symbolizer. # LSan doesn't support sandboxing yet, so we use the in-process symbolizer.
# Note that ASan and MSan can work together with LSan. # Note that ASan and MSan can work together with LSan.
use_symbolization_script = (asan or msan) and not lsan use_symbolization_script = (asan or msan or cfi_diag) and not lsan
if asan or lsan or msan or tsan: if asan or lsan or msan or tsan or cfi_diag:
extra_env.update(get_sanitizer_env(cmd, asan, lsan, msan, tsan)) extra_env.update(get_sanitizer_env(cmd, asan, lsan, msan, tsan, cfi_diag))
if lsan or tsan: if lsan or tsan:
# LSan and TSan are not sandbox-friendly. # LSan and TSan are not sandbox-friendly.
......
...@@ -1062,6 +1062,7 @@ class MetaBuildWrapper(object): ...@@ -1062,6 +1062,7 @@ class MetaBuildWrapper(object):
asan = 'is_asan=true' in vals['gn_args'] asan = 'is_asan=true' in vals['gn_args']
msan = 'is_msan=true' in vals['gn_args'] msan = 'is_msan=true' in vals['gn_args']
tsan = 'is_tsan=true' in vals['gn_args'] tsan = 'is_tsan=true' in vals['gn_args']
cfi_diag = 'use_cfi_diag=true' in vals['gn_args']
test_type = isolate_map[target]['type'] test_type = isolate_map[target]['type']
...@@ -1096,6 +1097,7 @@ class MetaBuildWrapper(object): ...@@ -1096,6 +1097,7 @@ class MetaBuildWrapper(object):
'--asan=%d' % asan, '--asan=%d' % asan,
'--msan=%d' % msan, '--msan=%d' % msan,
'--tsan=%d' % tsan, '--tsan=%d' % tsan,
'--cfi-diag=%d' % cfi_diag,
] ]
elif test_type in ('windowed_test_launcher', 'console_test_launcher'): elif test_type in ('windowed_test_launcher', 'console_test_launcher'):
extra_files = [ extra_files = [
...@@ -1109,6 +1111,7 @@ class MetaBuildWrapper(object): ...@@ -1109,6 +1111,7 @@ class MetaBuildWrapper(object):
'--asan=%d' % asan, '--asan=%d' % asan,
'--msan=%d' % msan, '--msan=%d' % msan,
'--tsan=%d' % tsan, '--tsan=%d' % tsan,
'--cfi-diag=%d' % cfi_diag,
] ]
elif test_type == 'script': elif test_type == 'script':
extra_files = [ extra_files = [
......
...@@ -530,7 +530,7 @@ ...@@ -530,7 +530,7 @@
'linux_chromium_archive_rel_ng': 'release_bot', 'linux_chromium_archive_rel_ng': 'release_bot',
'linux_chromium_asan_rel_ng': 'asan_lsan_release_trybot', 'linux_chromium_asan_rel_ng': 'asan_lsan_release_trybot',
'linux_chromium_browser_side_navigation_rel': 'release_trybot', 'linux_chromium_browser_side_navigation_rel': 'release_trybot',
'linux_chromium_cfi_rel_ng': 'cfi_full_release_static_dcheck_always_on', 'linux_chromium_cfi_rel_ng': 'cfi_full_cfi_diag_thin_lto_release_static_dcheck_always_on',
'linux_chromium_chromeos_asan_rel_ng': 'asan_lsan_chromeos_release_trybot', 'linux_chromium_chromeos_asan_rel_ng': 'asan_lsan_chromeos_release_trybot',
'linux_chromium_chromeos_compile_dbg_ng': 'chromeos_with_codecs_debug_trybot', 'linux_chromium_chromeos_compile_dbg_ng': 'chromeos_with_codecs_debug_trybot',
'linux_chromium_chromeos_compile_rel_ng': 'chromeos_with_codecs_release_trybot', 'linux_chromium_chromeos_compile_rel_ng': 'chromeos_with_codecs_release_trybot',
...@@ -992,8 +992,8 @@ ...@@ -992,8 +992,8 @@
'cfi_full', 'clang_tot', 'release', 'static', 'cfi_full', 'clang_tot', 'release', 'static',
], ],
'cfi_full_release_static_dcheck_always_on': [ 'cfi_full_cfi_diag_thin_lto_release_static_dcheck_always_on': [
'cfi_full', 'release', 'static', 'dcheck_always_on', 'cfi_full', 'cfi_diag', 'thin_lto', 'release', 'static', 'dcheck_always_on',
], ],
'cfi_release_static': [ 'cfi_release_static': [
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment