Skip to content
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
3 changes: 2 additions & 1 deletion infra/base-images/base-builder/indexer/manifest_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import urllib.request

import manifest_constants

import pathlib

SRC_DIR = manifest_constants.SRC_DIR
Expand Down Expand Up @@ -433,7 +434,7 @@ def save_build(

with tempfile.NamedTemporaryFile() as tmp:
mode = "w:gz" if archive_path.suffix.endswith("gz") else "w"
with tarfile.open(tmp.name, mode) as tar:
with tarfile.open(tmp.name, mode, dereference=True) as tar:

def _save_dir(
path: pathlib.PurePath,
Expand Down
36 changes: 0 additions & 36 deletions projects/calcite-avatica/Base64Fuzzer.java

This file was deleted.

33 changes: 0 additions & 33 deletions projects/calcite-avatica/ConnectStringParserFuzzer.java

This file was deleted.

2 changes: 1 addition & 1 deletion projects/calcite-avatica/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
##########################################################################
FROM gcr.io/oss-fuzz-base/base-builder-jvm
RUN git clone --depth 1 https://github.com/apache/calcite-avatica calcite-avatica
COPY *.sh *.java $SRC/
COPY *.sh $SRC/
WORKDIR $SRC/calcite-avatica
47 changes: 28 additions & 19 deletions projects/calcite-avatica/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,40 @@
#
##########################################################################

# Gradle build with gradle wrapper
# Clean up caches
rm -rf $HOME/.gradle/caches/
./gradlew clean build shadowJar -x test

# Build project and copy dependencies
./gradlew clean :core:jar :core:testClasses :core:copyFuzzDependencies -x test
./gradlew --stop

# Find version
CURRENT_VERSION=$(./gradlew properties | grep ^version: | cut -d" " -f2)
cp "./shaded/core/build/libs/avatica-$CURRENT_VERSION-shadow.jar" $OUT/avatica.jar
ALL_JARS="avatica.jar"

# The classpath at build-time includes the project jars in $OUT as well as the
# Jazzer API.
BUILD_CLASSPATH=$(echo $ALL_JARS | xargs printf -- "$OUT/%s:"):$JAZZER_API_PATH
# Copy jars to $OUT
cp core/build/fuzz-dependencies/*.jar $OUT/
cp core/build/libs/avatica-core-$CURRENT_VERSION.jar $OUT/avatica-core.jar
cp metrics/build/libs/avatica-metrics-$CURRENT_VERSION.jar $OUT/avatica-metrics.jar

# Copy fuzzer classes to $OUT (preserving package structure)
cp -r core/build/classes/java/test/* $OUT/

# Create a consolidated list of all jars for the classpath
ALL_JARS=$(find $OUT -maxdepth 1 -name "*.jar" | xargs -n1 basename)

# All .jar and .class files lie in the same directory as the fuzzer at runtime.
# The runtime classpath will include all jars in $OUT and the this_dir itself for classes
RUNTIME_CLASSPATH=$(echo $ALL_JARS | xargs printf -- "\$this_dir/%s:"):\$this_dir

for fuzzer in $(find $SRC -maxdepth 1 -name '*Fuzzer.java')
do
fuzzer_basename=$(basename -s .java $fuzzer)
javac -cp $BUILD_CLASSPATH $fuzzer
cp $SRC/$fuzzer_basename.class $OUT/
# Dynamically find all fuzzer classes in the specified package
FUZZER_CLASSES_DIR="$OUT/org/apache/calcite/avatica/fuzz"
FUZZERS=$(find "$FUZZER_CLASSES_DIR" -maxdepth 1 -name "*Fuzzer.class" -exec basename {} .class \;)

# Create an execution wrapper that executes Jazzer with the correct arguments.
# For each fuzzer, create a wrapper script
for fuzzer_basename in $FUZZERS
do
target_class="org.apache.calcite.avatica.fuzz.$fuzzer_basename"

echo "#!/bin/bash

# LLVMFuzzerTestOneInput for fuzzer detection.
this_dir=\$(dirname "\$0")
if [[ "\$@" =~ (^| )-runs=[0-9]+($| ) ]]
Expand All @@ -49,13 +58,13 @@ do
mem_settings='-Xmx2048m:-Xss1024k'
fi

LD_LIBRARY_PATH="$JVM_LD_LIBRARY_PATH":\$this_dir \
LD_LIBRARY_PATH=\"$JVM_LD_LIBRARY_PATH\":\$this_dir \
\$this_dir/jazzer_driver \
--agent_path=\$this_dir/jazzer_agent_deploy.jar \
--cp=$RUNTIME_CLASSPATH \
--target_class=$fuzzer_basename \
--jvm_args="\$mem_settings" \
--target_class=$target_class \
--jvm_args=\"\$mem_settings\" \
\$@" > $OUT/$fuzzer_basename

chmod u+x $OUT/$fuzzer_basename
chmod u+x $OUT/$fuzzer_basename
done
2 changes: 1 addition & 1 deletion projects/geos/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
FROM gcr.io/oss-fuzz-base/base-builder
RUN apt-get update && apt-get install -y cmake
# fallback to github if main git server is not responding
RUN git clone --depth 1 https://git.osgeo.org/gitea/geos/geos.git || git clone --depth 1 https://github.com/libgeos/geos.git
RUN git clone --depth 1 https://gitea.osgeo.org/geos/geos || git clone --depth 1 https://github.com/libgeos/geos.git
COPY run_tests.sh build.sh $SRC/
WORKDIR $SRC/geos
2 changes: 1 addition & 1 deletion projects/geos/project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ auto_ccs :
sanitizers:
- address
- undefined
main_repo: 'https://git.osgeo.org/gitea/geos/geos.git'
main_repo: "https://gitea.osgeo.org/geos/geos"

fuzzing_engines:
- afl
Expand Down
2 changes: 1 addition & 1 deletion projects/poppler/project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fuzzing_engines:
auto_ccs:
- jonathan@titanous.com
- adam.reichold@t-online.de
main_repo: 'https://anongit.freedesktop.org/git/poppler/poppler.git'
main_repo: "https://gitlab.freedesktop.org/poppler/poppler"
fuzzing_engines:
- afl
- honggfuzz
Expand Down
2 changes: 1 addition & 1 deletion projects/postgis/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

FROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04

RUN git clone --depth 1 https://git.osgeo.org/gitea/postgis/postgis.git postgis
RUN git clone --depth 1 https://gitea.osgeo.org/postgis/postgis postgis
WORKDIR postgis
RUN bash ./fuzzers/install_oss_fuzz_build_deps.sh
RUN apt-get update && \
Expand Down
2 changes: 1 addition & 1 deletion projects/postgis/project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ auto_ccs:
- "even.rouault@gmail.com"
- "pramsey@cleverelephant.ca"
- "komzpa@gmail.com"
main_repo: 'https://git.osgeo.org/gitea/postgis/postgis.git'
main_repo: "https://gitea.osgeo.org/postgis/postgis"

fuzzing_engines:
- afl
Expand Down
2 changes: 1 addition & 1 deletion projects/python-markdownify/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
##########################################################################
FROM gcr.io/oss-fuzz-base/base-builder-python
RUN pip3 install --upgrade pip
RUN git clone http://github.com/matthewwithanm/python-markdownify python-markdownify
RUN git clone https://github.com/matthewwithanm/python-markdownify python-markdownify
COPY *.sh *py $SRC/
WORKDIR $SRC/python-markdownify
4 changes: 2 additions & 2 deletions projects/python-markdownify/project.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
homepage: http://github.com/matthewwithanm/python-markdownify
main_repo: http://github.com/matthewwithanm/python-markdownify
homepage: https://github.com/matthewwithanm/python-markdownify
main_repo: https://github.com/matthewwithanm/python-markdownify
language: python
fuzzing_engines:
- libfuzzer
Expand Down
Loading