From ef0e5413c962f1c91771effd160f9c583ef0bea6 Mon Sep 17 00:00:00 2001 From: Oliver Chang Date: Tue, 2 Nov 2021 16:50:59 +1100 Subject: [PATCH] CFLite: Logging fixes. (#6715) Don't output stacktrace again in detected bug log message. Disable Python buffering to avoid log interleaving issues. --- infra/cifuzz/cifuzz-base/Dockerfile | 2 ++ infra/cifuzz/fuzz_target.py | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/infra/cifuzz/cifuzz-base/Dockerfile b/infra/cifuzz/cifuzz-base/Dockerfile index 66fd6b517..096d2b64a 100644 --- a/infra/cifuzz/cifuzz-base/Dockerfile +++ b/infra/cifuzz/cifuzz-base/Dockerfile @@ -40,6 +40,8 @@ RUN python3 -m pip install -r /tmp/requirements.txt && rm /tmp/requirements.txt ADD . ${OSS_FUZZ_ROOT} RUN npm install ${OSS_FUZZ_ROOT}/infra/cifuzz +ENV PYTHONUNBUFFERED=1 + # Python file to execute when the docker container starts up. # We can't use the env var $OSS_FUZZ_ROOT here. Since it's a constant env var, # just expand to '/opt/oss-fuzz'. diff --git a/infra/cifuzz/fuzz_target.py b/infra/cifuzz/fuzz_target.py index 8c62a64ab..27b969d38 100644 --- a/infra/cifuzz/fuzz_target.py +++ b/infra/cifuzz/fuzz_target.py @@ -177,8 +177,7 @@ class FuzzTarget: # pylint: disable=too-many-instance-attributes # Only report first crash. crash = result.crashes[0] - logging.info('Fuzzer: %s. Detected bug:\n%s', self.target_name, - crash.stacktrace) + logging.info('Fuzzer: %s. Detected bug.', self.target_name) if self.is_crash_reportable(crash.input_path): # We found a bug in the fuzz target and we will report it.