Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix recent FuzzBench cloud experiment failures #2023

Merged
merged 6 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions experiment/measurer/coverage_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,8 @@ def generate_json_summary(coverage_binary,

if summary_only:
command.append('-summary-only')
# Ensure the directory exists, creating it if necessary
os.makedirs(os.path.dirname(output_file), exist_ok=True)

with open(output_file, 'w', encoding='utf-8') as dst_file:
result = new_process.execute(command,
Expand Down
2 changes: 2 additions & 0 deletions experiment/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ def _clean_seed_corpus(seed_corpus_dir):
def get_clusterfuzz_seed_corpus_path(fuzz_target_path):
"""Returns the path of the clusterfuzz seed corpus archive if one exists.
Otherwise returns None."""
if not fuzz_target_path:
return None
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add an error log here because this is unexpected.

Copy link
Contributor

@tokatoka tokatoka Aug 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question, why is this function even called?

https://github.com/google/fuzzbench/blob/master/experiment/runner.py#L277
I think this is the line that eventually calls this line. But for example, when we observed the error for addison's experiment, the ossfuzz corpus was NOT used right? (unless they specified oss-fuzz-corpus: true)
then why we would unpack the clusterfuzz seed corpus at all?

aren't the seed corpus already prepared in build.sh or Dockerfile in each of the benchmarks?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know if this env var CUSTOM_SEED_CORPUS_DIR set in normal(?) run or not?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me these two lines seem wrong

        elif not environment.get('CUSTOM_SEED_CORPUS_DIR'):
            _unpack_clusterfuzz_seed_corpus(target_binary, input_corpus)

even if we don't use custom_seed_corpus_dir we don't necessarily need clusterfuzz seed corpus, do we??

although why this target_binary is None is another problem that needs investigation

fuzz_target_without_extension = os.path.splitext(fuzz_target_path)[0]
seed_corpus_path = (fuzz_target_without_extension +
SEED_CORPUS_ARCHIVE_SUFFIX)
Expand Down
Loading