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

Reland "[infra] Update Jazzer to v0.17.1" (#10537)" #10538

Merged
merged 1 commit into from
Jun 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions infra/base-images/base-builder/bazel_build_fuzz_tests
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ done
declare -r BAZEL_BUILD_FLAGS=(
"-c" "opt"
"--@rules_fuzzing//fuzzing:cc_engine=@rules_fuzzing_oss_fuzz//:oss_fuzz_engine" \
"--@rules_fuzzing//fuzzing:java_engine=@rules_fuzzing_oss_fuzz//:oss_fuzz_java_engine" \
"--@rules_fuzzing//fuzzing:cc_engine_instrumentation=oss-fuzz" \
"--@rules_fuzzing//fuzzing:cc_engine_sanitizer=none" \
"--cxxopt=-stdlib=libc++" \
Expand Down
13 changes: 11 additions & 2 deletions infra/base-images/base-builder/compile
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,22 @@ if [ "$FUZZING_LANGUAGE" = "jvm" ]; then
cp $(which jazzer_agent_deploy.jar) $(which jazzer_driver) $OUT/
jazzer_driver_with_sanitizer=$OUT/jazzer_driver_with_sanitizer
if [ "$SANITIZER" = "address" ]; then
cp $(which jazzer_driver_asan) $jazzer_driver_with_sanitizer
cat > $jazzer_driver_with_sanitizer << 'EOF'
#!/bin/bash
this_dir=$(dirname "$0")
"$this_dir/jazzer_driver" --asan "$@"
EOF
elif [ "$SANITIZER" = "undefined" ]; then
cp $(which jazzer_driver_ubsan) $jazzer_driver_with_sanitizer
cat > $jazzer_driver_with_sanitizer << 'EOF'
#!/bin/bash
this_dir=$(dirname "$0")
"$this_dir/jazzer_driver" --ubsan "$@"
EOF
elif [ "$SANITIZER" = "coverage" ]; then
# Coverage builds require no instrumentation.
cp $(which jazzer_driver) $jazzer_driver_with_sanitizer
fi
chmod +x $jazzer_driver_with_sanitizer

# Disable leak checking since the JVM triggers too many false positives.
export CFLAGS="$CFLAGS -fno-sanitize=leak"
Expand Down
15 changes: 10 additions & 5 deletions infra/base-images/base-builder/install_java.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,15 @@ rm -rf $JAVA_HOME/jmods $JAVA_HOME/lib/src.zip
cd $SRC/
git clone https://github.com/CodeIntelligenceTesting/jazzer && \
cd jazzer && \
git checkout c9f9347b7a72a4e65441d0442c7381790aa4c538
bazel build --java_runtime_version=local_jdk_15 -c opt --cxxopt="-stdlib=libc++" --linkopt=-lc++ \
//agent:jazzer_agent_deploy.jar //driver:jazzer_driver //driver:jazzer_driver_asan //driver:jazzer_driver_ubsan //agent:jazzer_api_deploy.jar
cp bazel-bin/agent/jazzer_agent_deploy.jar bazel-bin/driver/jazzer_driver bazel-bin/driver/jazzer_driver_asan bazel-bin/driver/jazzer_driver_ubsan /usr/local/bin/
cp bazel-bin/agent/jazzer_api_deploy.jar $JAZZER_API_PATH
git checkout b12d1ea863b336b120e192700ac11c9744af6cfd # v0.17.1
cat << 'EOF' >> .bazelrc
build --java_runtime_version=local_jdk_15
build --cxxopt=-stdlib=libc++
build --linkopt=-lc++
EOF
bazel build //src/main/java/com/code_intelligence/jazzer:jazzer_standalone_deploy.jar //deploy:jazzer-api //launcher:jazzer
cp $(bazel cquery --output=files //src/main/java/com/code_intelligence/jazzer:jazzer_standalone_deploy.jar) /usr/local/bin/jazzer_agent_deploy.jar
cp $(bazel cquery --output=files //launcher:jazzer) /usr/local/bin/jazzer_driver
cp $(bazel cquery --output=files //deploy:jazzer-api) $JAZZER_API_PATH
rm -rf ~/.cache/bazel ~/.cache/bazelisk
rm -rf $SRC/jazzer