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

optimize fuzzing setup #21

Closed
wants to merge 2 commits into from
Closed

Conversation

vanhauser-thc
Copy link

renamed AFL_DIR to AFL_PATH, as the former makes afl-fuzz complain and the latter helps to find it's data.
also optimized building the target and how to fuzz it.

@vanhauser-thc
Copy link
Author

ping @sagamusix :)

@sagamusix
Copy link
Member

Finally digging into this, thanks for the reminder! :)

AFL_NO_WARN_INSTABILITY=1
AFL_FAST_CAL=1
AFL_IMPORT_FIRST=1
AFL_DISABLE_TRIM=1
Copy link
Member

Choose a reason for hiding this comment

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

Can you explain why using AFL_DISABLE_TRIM=1 would be beneficial? It seems counterintuitive given the afl++ documentation, and also given that a lot of our formats have the possibility of having large chunks of PCM sample data at the end which should not affect the fuzzing state at all, so trimming this data would often result in smaller files and thus faster fuzzing cycles according to my understanding.

Copy link
Author

Choose a reason for hiding this comment

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

In >60% of the time it’s better that is why :) you could try it out yourself by running it with and without for 3h

@@ -1,4 +1,4 @@
#!/usr/bin/env bash
cd "${0%/*}"
cd ../..
AFL_USE_ASAN=1 CONFIG=afl make clean all EXAMPLES=0 TEST=0 OPENMPT123=0 NO_VORBIS=1 NO_VORBISFILE=1 NO_MPG123=1 CHECKED_ADDRESS=1
AFL_LLVM_CMPLOG=1 AFL_USE_ASAN=1 CONFIG=afl make clean all EXAMPLES=0 TEST=0 OPENMPT123=0 NO_VORBIS=1 NO_VORBISFILE=1 NO_MPG123=1 CHECKED_ADDRESS=1
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't this addition require building the binary two times (one with cmplog, one without)? Is there any benefit in building just one binary with cmplog?

Copy link
Author

Choose a reason for hiding this comment

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

Yes that would be beneficial. This is the easier way. As you use an asan binary anyway it doesn’t matter. Best practice would be 3 binaries :) normal, cmplog, asan

manxorist pushed a commit that referenced this pull request Jul 14, 2024
@sagamusix
Copy link
Member

Applied in 6710289. Thanks for looking into it!

@sagamusix sagamusix closed this Jul 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants