KEMBAR78
`target_experiment.py` uploads reproducer and binary in target_experiment.py by DonggeLiu · Pull Request #11700 · google/oss-fuzz · GitHub
Skip to content

Conversation

@DonggeLiu
Copy link
Contributor

@DonggeLiu DonggeLiu commented Mar 17, 2024

Helps google/oss-fuzz-gen#156:

  1. target_experiment.py takes a new parameter, upload_reproducer_path.
  2. target_experiment.py saves crash reproducer to local_artifect_path.
  3. target_experiment.py uploads the fuzz target binary, the crash reproducer, and stacktrace to bucket directory upload_reproducer_path.

@DonggeLiu DonggeLiu requested a review from oliverchang March 17, 2024 22:54
@DonggeLiu
Copy link
Contributor Author

Will save fuzz target binary, crash reproducer, and other files to experiment bucket in OFG.

@DonggeLiu
Copy link
Contributor Author

/gcbrun skip

Copy link
Collaborator

Choose a reason for hiding this comment

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

This might not be the case for all builds, since some targets may exist in subdirs. Let's skip uploading the binary for now

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Given we know the binary name, can I use find as a heuristic to find this path?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, that might work, if it's not too difficult to do this within a Cloud Build step.

Copy link
Contributor Author

@DonggeLiu DonggeLiu Mar 18, 2024

Choose a reason for hiding this comment

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

Added the script for this.
The script uses this path as the default, and if the target binary is not here, it uses find to locate it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this need to be a flag at all? When would we need to customize this behaviour?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, I was worrying that hardcoding this would affect other usages of this script.
If we don't have to customize it, then I can easily hardcode it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this be optional? This way, migrating oss-fuzz-gen will be seamless. Otherwise, as soon as this is submitted, oss-fuzz-gen will break in the interim before we add this flag there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, good point.
I will make it optional.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Collaborator

Choose a reason for hiding this comment

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

See below: let's make this conditional on the flag being passed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@DonggeLiu DonggeLiu force-pushed the target_exp_save_repro branch from 1c74928 to 2631a97 Compare March 18, 2024 02:24
@DonggeLiu
Copy link
Contributor Author

/gcbrun skip

@DonggeLiu
Copy link
Contributor Author

DonggeLiu commented Mar 18, 2024

The artifact was not uploaded because the local dir missed a /.

@DonggeLiu DonggeLiu requested a review from oliverchang March 18, 2024 23:55
@DonggeLiu
Copy link
Contributor Author

/gcbrun skip

@DonggeLiu
Copy link
Contributor Author

/gcbrun skip

@DonggeLiu DonggeLiu enabled auto-merge (squash) March 19, 2024 10:49
@DonggeLiu DonggeLiu merged commit 6bc246b into master Mar 19, 2024
@DonggeLiu DonggeLiu deleted the target_exp_save_repro branch March 19, 2024 11:20
DonggeLiu added a commit that referenced this pull request Mar 20, 2024
…nt.py` (#11713)

Related: google/oss-fuzz-gen#172, #11700.
This simplifies the link generation in benchmark `JSON`.
Previously, the binary directory name matches the binary name, now it is
always called `target_binary/`.
DonggeLiu added a commit to google/oss-fuzz-gen that referenced this pull request Mar 21, 2024
Fixes #156.
Related: google/oss-fuzz#11700.

Save GS bucket links to the reproducer and other statuses into a JSON
file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants