-
Notifications
You must be signed in to change notification settings - Fork 47
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
Avoid the "replace main" trick #46
Comments
Update: this is no longer necessary to use optional functions. |
Greetings from a year later 👋 How are you thinking this would work? We commit a |
Something like that, yeah |
We could I'll see about making a PR for this today. |
I'm interested in this because when I run a fuzz target against an existing corpus, I'd like to gather statistics from inside the fuzz target and report them when the fuzzer exits. I could do that instead by factoring out the fuzz target function so I can call it from a separate program that just feeds it the contents of every file in a directory. I could also use the But I think it'd be nicer to be able to wrap logic like this around a simple library call to the fuzzer driver. |
The way libfuzzer works is that libfuzzer itself contains a
main()
, and you link in a binary that contains a hook but notmain()
.This is kind of awkward, ideally we can get rid of this requirement and instead have a system where you define
main()
and calllibfuzzer::fuzz(|x: &[u8]| {...})
when ready.Of course, this won't work without changes to libFuzzer itself. Ideally we can add a compile time flag that disables
main()
and routes everything through FuzzerDriver.The text was updated successfully, but these errors were encountered: