Index: build/win/syzygy/instrument.py |
diff --git a/build/win/syzygy/instrument.py b/build/win/syzygy/instrument.py |
index e103facf0dd6c5fe8106b1ddb43bf7c338cd1920..78e38843cd9e73bbb3cfe02d0cf76935776278c8 100755 |
--- a/build/win/syzygy/instrument.py |
+++ b/build/win/syzygy/instrument.py |
@@ -58,7 +58,8 @@ def _CompileFilter(syzygy_dir, executable, symbol, filter_file, |
def _InstrumentBinary(syzygy_dir, mode, executable, symbol, dst_dir, |
- filter_file, allocation_filter_file): |
+ filter_file, allocation_filter_file, |
+ defer_crash_reporter_initialization): |
"""Instruments the executable found in input_dir, and writes the resultant |
instrumented executable and symbol files to dst_dir. |
""" |
@@ -75,11 +76,16 @@ def _InstrumentBinary(syzygy_dir, mode, executable, symbol, dst_dir, |
if mode == "asan": |
cmd.append('--no-augment-pdb') |
+ asan_rtl_options = [ |
+ "--enable_feature_randomization", |
+ "--prevent_duplicate_corruption_crashes", |
+ ] |
+ if defer_crash_reporter_initialization: |
+ asan_rtl_options.append('--defer_crash_reporter_initialization') |
# Disable some of the new SysyASAN features. We're seeing an increase in |
# crash rates and are wondering if they are to blame. |
cmd.append( |
- '--asan-rtl-options="--enable_feature_randomization ' |
- '--prevent_duplicate_corruption_crashes"') |
+ '--asan-rtl-options="%s"' % ' '.join(asan_rtl_options)) |
# If any filters were specified then pass them on to the instrumenter. |
if filter_file: |
@@ -113,7 +119,8 @@ def main(options): |
options.input_symbol, |
options.destination_dir, |
options.output_filter_file, |
- options.allocation_filter_file) |
+ options.allocation_filter_file, |
+ options.defer_crash_reporter_initialization) |
def _ParseOptions(): |
@@ -136,6 +143,10 @@ def _ParseOptions(): |
'required if --filter is specified.') |
option_parser.add_option('--allocation-filter-file', |
help='The path to the SyzyASAN allocation filter to use.') |
+ option_parser.add_option('--defer-crash-reporter-initialization', |
+ help='Defer the crash reporter initialization, the client has to call ' |
+ 'asan_InitializeCrashReporter to initialize it.', |
+ action="store_true") |
options, args = option_parser.parse_args() |
if not options.mode: |