diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2024-04-18 10:27:46 +0100 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2024-04-18 10:27:46 +0100 |
commit | 52933d7283736fe3ae15e7ac44c02ca3bd95fe6d (patch) | |
tree | ee93597da4086d5f5aa63e9cb929f9ac2fa37044 | |
parent | 23cb8207cdd6c674480840b76626039cdfe7cb13 (diff) |
fuzz: Pass `SystemRoot` environment variable to subprocess
See https://docs.python.org/3/library/subprocess.html
-rwxr-xr-x | test/fuzz/test_runner.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/fuzz/test_runner.py b/test/fuzz/test_runner.py index 558d63e85c..a635175e7c 100755 --- a/test/fuzz/test_runner.py +++ b/test/fuzz/test_runner.py @@ -11,6 +11,7 @@ import argparse import configparser import logging import os +import platform import random import subprocess import sys @@ -18,7 +19,7 @@ import sys def get_fuzz_env(*, target, source_dir): symbolizer = os.environ.get('LLVM_SYMBOLIZER_PATH', "/usr/bin/llvm-symbolizer") - return { + fuzz_env = { 'FUZZ': target, 'UBSAN_OPTIONS': f'suppressions={source_dir}/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=1:report_error_type=1', @@ -27,6 +28,10 @@ def get_fuzz_env(*, target, source_dir): 'ASAN_SYMBOLIZER_PATH':symbolizer, 'MSAN_SYMBOLIZER_PATH':symbolizer, } + if platform.system() == "Windows": + # On Windows, `env` option must include valid `SystemRoot`. + fuzz_env = {**fuzz_env, 'SystemRoot': os.environ.get('SystemRoot')} + return fuzz_env def main(): |