Skip to content

Fuzz Test

Fuzz Test #55

Workflow file for this run

name: Fuzz Test
on:
workflow_dispatch:
workflow_call:
jobs:
Fuzz:
runs-on: ubuntu-20.04 # [self-hosted, ubuntu, asrunner]
container:
image: ubuntu:18.04
strategy:
matrix:
include:
- name: db_fuzzer
- name: db_map_fuzzer
steps:
- name: Pre-build
run: |
#echo "nameserver 8.8.8.8" > /etc/resolv.conf
apt update && apt install -y python3 git clang-tools cmake make automake ucommon-utils libtool gettext pkg-config build-essential clang-10 zlib1g-dev libbz2-dev ninja-build liblzma-dev autoconf libsnappy-dev libzstd-dev liblz4-dev binutils m4 g++-10 unzip
- uses: actions/checkout@v3
- name: ${{ matrix.name }}
run: |
echo 'git clone https://github.com/google/libprotobuf-mutator.git \n
cd libprotobuf-mutator \n
git checkout ffd86a32874e5c08a143019aad1aaf0907294c9f \n
cd .. \n
export CC=clang && export CXX=clang++ && mkdir LPM && cd LPM \n
ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /usr/lib/x86_64-linux-gnu/libstdc++.so \n
ln -s /usr/bin/clang-10 /usr/bin/clang \n
ln -s /usr/bin/clang++-10 /usr/bin/clang++ \n
cmake ../libprotobuf-mutator -GNinja -DLIB_PROTO_MUTATOR_DOWNLOAD_PROTOBUF=ON -DLIB_PROTO_MUTATOR_TESTING=OFF -DCMAKE_BUILD_TYPE=Release \n
ninja \n
ninja install \n
export PKG_CONFIG_PATH=$PWD:$PWD/external.protobuf/lib/pkgconfig/ \n
export PATH=$PWD/external.protobuf/bin:$PATH \n
cd $GITHUB_WORKSPACE \n
COMPILE_WITH_ASAN=1 PORTABLE=1 make -j$(nproc) static_lib \n
cd $GITHUB_WORKSPACE/fuzz \n
make ${{ matrix.name }} \n
ls -alFh $GITHUB_WORKSPACE/fuzz/ \n
echo ASAN_OPTIONS=detect_leaks=0 ./db_fuzzer \n' > prepfuz.sh
chmod +x prepfuz.sh
bash -xv prepfuz.sh
mkdir -p $GITHUB_WORKSPACE/out/
ASAN_OPTIONS=detect_odr_violation=0 $GITHUB_WORKSPACE/fuzz/${{ matrix.name }} 2>&1 | tee $GITHUB_WORKSPACE/out/${{ matrix.name }}.log
tail -20 $GITHUB_WORKSPACE/out/${{ matrix.name }}.log | grep "==AddressSanitizer. Thread limit (4194304 threads) exceeded\. Dying\." || { echo "${{ matrix.name }} failed!" && false; }