Fuzz Java with libFuzzer.
libFuzzer-gv: Get libFuzzer-gv, build, and put
libFuzzer.ain this project's root directory
- Oracle JDK. Set the environment variable
JAVA_HOMEto the JDK installation directory.
Put your code in the
run method in
true from this method to force a crash and write the offending input to disk (for example if a certain exception was thrown).
Set the environment variable
JAVA_FUZZER_CLASSPATH to a colon-separated list of paths to
JAR files to serve as dependencies.
CXX=clang++ make to build.
CXXFLAGS can be empty (you do NOT need to instrument the C++ files).
./fuzzer -custom_guided=1 -no_coverage_guided=1 -rss_limit_mb=6000 <corpus directory>
You can run it with less than 6GB, but you then also need to alter the
-Xmx4096m option in
fuzzerentry.cpp (preferably to a value +/- 2GB lower than your
to crash on very slow inputs.
This project uses portions of Kelinci by Rody Kersten.