Fix centipede's bad_build_check projects with many targets (#9606)

This commit is contained in:
jonathanmetzman 2023-02-06 18:48:33 -05:00 committed by GitHub
parent 533df2c728
commit 860447a712
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 6 deletions

View File

@ -122,8 +122,6 @@ function check_engine {
# binaries if they are from trial build and production build.
# TODO(Dongge): Support run test with sanitized binaries for trial and
# production build.
CENTIPEDE_WORKDIR=/tmp/centipede-workdir
mkdir -p $CENTIPEDE_WORKDIR
SKIP_SEED_CORPUS=1 timeout --preserve-status -s INT 20s run_fuzzer $FUZZER_NAME &>$FUZZER_OUTPUT
CHECK_PASSED=$(egrep "\[0] begin-fuzz: ft: 0 cov: 0" -c $FUZZER_OUTPUT)
if (( $CHECK_PASSED == 0 )); then

View File

@ -111,10 +111,15 @@ def do_bad_build_check(fuzz_target):
auxiliary = []
command = ['bad_build_check', fuzz_target] + auxiliary
return subprocess.run(command,
stderr=subprocess.PIPE,
stdout=subprocess.PIPE,
check=False)
with tempfile.TemporaryDirectory() as temp_centipede_workdir:
# Do this so that centipede doesn't fill up the disk during bad build check
env = os.environ.copy()
env['CENTIPEDE_WORKDIR'] = temp_centipede_workdir
return subprocess.run(command,
stderr=subprocess.PIPE,
stdout=subprocess.PIPE,
env=env,
check=False)
def get_broken_fuzz_targets(bad_build_results, fuzz_targets):