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

base-runner: check fuzz target validity for jvm targets #10473

Merged
merged 1 commit into from
Jun 13, 2023

Conversation

DavidKorczynski
Copy link
Collaborator

When running fuzz targets we check for validity by checking if LLVMFuzzerTestOneInput exists in the target file:

elif [[ $FUZZING_LANGUAGE == "jvm" ]]; then
# Continue if not a fuzz target.
if [[ $FUZZING_ENGINE != "none" ]]; then
grep "LLVMFuzzerTestOneInput" $fuzz_target > /dev/null 2>&1 || continue
fi
echo "Running $fuzz_target"
run_java_fuzz_target $fuzz_target &
However, this is not done in the post processing step of the coverage utility:
mkdir $classes_dir
for fuzz_target in $FUZZ_TARGETS; do
cp -r $DUMPS_DIR/${fuzz_target}_classes/* $classes_dir/
done

This causes coverage build issues e.g.
https://oss-fuzz-build-logs.storage.googleapis.com/log-b8d4899d-ecc3-498c-8485-2e88d162dc57.txt

Step #5: [INFO] Loading execution data file /workspace/out/libfuzzer-coverage-x86_64/dumps/OpenSSHConfigFuzzer.exec.
Step #5: [INFO] Analyzing 3 classes.
Step #5: [INFO] Loading execution data file /workspace/out/libfuzzer-coverage-x86_64/dumps/OpenSSHConfigFuzzer.exec.
Step #5: [INFO] Writing execution data to /workspace/out/libfuzzer-coverage-x86_64/dumps/jacoco.merged.exec.
Step #5: cp: cannot stat '/workspace/out/libfuzzer-coverage-x86_64/dumps/jsch-fuzzer-0.2.10-SNAPSHOT.jar_classes/*': No such file or directory
Step #5: ********************************************************************************

Signed-off-by: David Korczynski <david@adalogics.com>
Copy link
Collaborator

@oliverchang oliverchang left a comment

Choose a reason for hiding this comment

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

thanks!

@oliverchang
Copy link
Collaborator

/gcbrun trial_build.py all --sanitizer coverage --fuzzing-engine libfuzzer

@jonathanmetzman
Copy link
Contributor

/gcbrun trial_build.py asteval --sanitizer coverage --fuzzing-engine libfuzzer

@jonathanmetzman
Copy link
Contributor

Other test fails looked spurious. Please merge if this trial build succeeds.

@jonathanmetzman
Copy link
Contributor

Well last build of asteval failed, so looks like we don't care about breaking it again.

@jonathanmetzman jonathanmetzman merged commit f5e7dc4 into master Jun 13, 2023
@jonathanmetzman jonathanmetzman deleted the base-runner-java-coverage branch June 13, 2023 16:00
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.

3 participants