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: make the --jobs option actually work for libfuzzer #161

Closed
wants to merge 3 commits into from

Conversation

Ekleog-NEAR
Copy link
Contributor

Fixes #100.

Required for clusterfuzz support (PR incoming), as clusterfuzz actually uses forks.

@Ekleog-NEAR
Copy link
Contributor Author

(The CI failure with AFL is I think one I already saw, and most likely unrelated to this PR)

@@ -0,0 +1,400 @@
diff -ruN libfuzzer/FuzzerCommand.h libfuzzer-new/FuzzerCommand.h
Copy link
Owner

Choose a reason for hiding this comment

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

This patch seems bigger than it needs to be. Can we isolate the change to this single function?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could, but it would mean that literally every run would need to go through the libtest harness. I thought every runs did, but then saw in the bolero source code that there’s a BOLERO_LIBTEST_HARNESS environment variable, so I considered it’s not actually the case?

(Also, I thought maybe libfuzzer also needs to be able to run executables without going through the libtest harness, eg. in the dataflow things, but I have literally no idea how those works so I wrote the patch only so it doesn’t newly break stuff, at the expense of maybe not fixing them if they were already broken)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That said if bolero fuzzers always run through the libtest harness I could at least slightly simplify the patch :)

Copy link
Owner

Choose a reason for hiding this comment

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

I've opened #176 as a more minimal change. The BOLERO_LIBTEST_HARNESS environment variable is just to detect if we're using libtest or not. If we're not, it would look something like:

fn main() {
    bolero::check!().for_each(|_| { });
}

Which means we still go through bolero's harness. But it'll only execute a single harness in this mode.

@Ekleog-NEAR
Copy link
Contributor Author

Superseded by #176

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.

Running with -j 8 leads to "error: Unrecognized option: 'a'"
3 participants