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

Add PCRE2 as a fuzzing benchmark #2034

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
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 .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
- openh264_decoder_fuzzer
- openssl_x509
- openthread_ot-ip6-send-fuzzer
- pcre2_pcre2_fuzzer
- php_php-fuzz-parser_0dbedb
- proj4_proj_crs_to_crs_fuzzer
- re2_fuzzer
Expand Down
22 changes: 22 additions & 0 deletions benchmarks/pcre2_pcre2_fuzzer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################

FROM gcr.io/oss-fuzz-base/base-builder@sha256:fb1a9a49752c9e504687448d1f1a048ec1e062e2e40f7e8a23e86b63ff3dad7c
RUN apt-get update && apt-get install -y make autoconf automake libtool subversion

RUN git clone https://github.com/PCRE2Project/pcre2 pcre2
WORKDIR pcre2
COPY build.sh $SRC/
4 changes: 4 additions & 0 deletions benchmarks/pcre2_pcre2_fuzzer/benchmark.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
commit: 6ae58beca071f13ccfed31d03b3f479ab520639b
commit_date: 2024-06-06 22:00:00+00:00
fuzz_target: pcre2_fuzzer
project: pcre2
31 changes: 31 additions & 0 deletions benchmarks/pcre2_pcre2_fuzzer/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash -eu
# Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################

# build project
./autogen.sh
./configure --enable-fuzz-support \
--enable-never-backslash-C --with-match-limit=1000 --with-match-limit-depth=1000 \
--enable-jit
make -j$(nproc) clean
make -j$(nproc) all

# build fuzzer
$CXX $CXXFLAGS -o $OUT/pcre2_fuzzer \
$LIB_FUZZING_ENGINE .libs/libpcre2-fuzzsupport.a .libs/libpcre2-8.a

# set up dictionary and options to use it
cp "pcre2_fuzzer.dict" "${OUT}/pcre2_fuzzer.dict"
Loading