diff --git a/experiment/measurer/coverage_utils.py b/experiment/measurer/coverage_utils.py index 42ca57385..dd2f3bb76 100644 --- a/experiment/measurer/coverage_utils.py +++ b/experiment/measurer/coverage_utils.py @@ -142,7 +142,7 @@ def generate_coverage_summary_json(self): self.merged_profdata_file, self.merged_summary_json_file, summary_only=False) - if result.retcode != 0: + if result is None or result.retcode != 0: logger.error( 'Merged coverage summary json file generation failed for ' f'fuzzer: {self.fuzzer},benchmark: {self.benchmark}.') @@ -276,6 +276,10 @@ def generate_json_summary(coverage_binary, if summary_only: command.append('-summary-only') + if not os.path.exists(output_file): + logger.error( + f'Coverage summary json file defective or missing: {output_file}') + return None with open(output_file, 'w', encoding='utf-8') as dst_file: result = new_process.execute(command,