Skip to content

Get code-coverage of fuzzing process #279

Answered by centic9
centic9 asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for the hints, the new JAVA_OPTS is actually not even required as the --java_args option already allows to do this.

Only tricky thing is to escape the colon in the -javaagent argument to not have the java_args split by Jazzer.

The following steps did work for me with the current release 0.10.0:

# Fetch JaCoCo Agent
wget --continue https://repo1.maven.org/maven2/org/jacoco/jacoco/0.8.7/jacoco-0.8.7.zip
unzip -o jacoco-0.8.7.zip lib/jacocoagent.jar
mv lib/jacocoagent.jar build/
rmdir lib
mkdir -p build/jacoco

# Run Jazzer with JaCoCo-Agent to produce coverage information
./jazzer \
  --cp=build/libs/fuzz-all.jar \
  --instrumentation_includes=org.example.** \
  --target_class=org.ex…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by centic9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants