From ba11a188895d0ed123a6be62007222c1b0f0cfc1 Mon Sep 17 00:00:00 2001 From: Yakov Olkhovskiy Date: Tue, 22 Oct 2024 01:48:17 +0000 Subject: [PATCH] run fuzzers without shell --- tests/fuzz/runner.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/fuzz/runner.py b/tests/fuzz/runner.py index 9eac0755d78..87495dff599 100644 --- a/tests/fuzz/runner.py +++ b/tests/fuzz/runner.py @@ -116,21 +116,23 @@ def run_fuzzer(fuzzer: str, timeout: int): try: with open(out_path, "wb") as out: subprocess.run( - cmd_line, + cmd_line.split(), stderr=out, stdout=subprocess.DEVNULL, text=True, check=True, - shell=True, + shell=False, errors="replace", timeout=timeout, ) except subprocess.CalledProcessError: + logging.info("Fail running %s", fuzzer) with open(status_path, "w", encoding="utf-8") as status: status.write( f"FAIL\n{stopwatch.start_time_str}\n{stopwatch.duration_seconds}\n" ) except subprocess.TimeoutExpired: + logging.info("Timeout running %s", fuzzer) kill_fuzzer(fuzzer) sleep(10) with open(status_path, "w", encoding="utf-8") as status: @@ -138,6 +140,7 @@ def run_fuzzer(fuzzer: str, timeout: int): f"Timeout\n{stopwatch.start_time_str}\n{stopwatch.duration_seconds}\n" ) else: + logging.info("Successful running %s", fuzzer) with open(status_path, "w", encoding="utf-8") as status: status.write( f"OK\n{stopwatch.start_time_str}\n{stopwatch.duration_seconds}\n"