From cf816c3244f022fc0eac0a32e3e344991cd802a8 Mon Sep 17 00:00:00 2001 From: DavidKorczynski Date: Thu, 30 Jun 2022 06:06:42 -0200 Subject: [PATCH] infra: fix per-target coverage html generation (#7927) * infra: fix per-target coverage html generation When generating coverage reports for single targets we should not include all fuzz targets (in the $objects var), but only the object (binary file) for the given target. Ref: https://github.com/ossf/fuzz-introspector/issues/340 * coverage: remove potential race condition --- infra/base-images/base-runner/coverage | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/infra/base-images/base-runner/coverage b/infra/base-images/base-runner/coverage index 400247bf1..6b662dbf5 100755 --- a/infra/base-images/base-runner/coverage +++ b/infra/base-images/base-runner/coverage @@ -107,8 +107,7 @@ function run_fuzz_target { fi # If necessary translate to latest profraw version. - profraw_update.py $OUT/$target $profraw_file_mask tmp.profraw - mv tmp.profraw $profraw_file_mask + profraw_update.py $OUT/$target $profraw_file_mask $profraw_file_mask llvm-profdata merge -j=1 -sparse $profraw_file_mask -o $profdata_file # Delete unnecessary and (potentially) large .profraw files. @@ -387,7 +386,7 @@ else fi report_dir=$REPORT_BY_TARGET_ROOT_DIR/$fuzz_target - generate_html $profdata_path "$shared_libraries" "$objects" "$report_dir" + generate_html $profdata_path "$shared_libraries" "$fuzz_target" "$report_dir" done fi