Skip to content

Commit

Permalink
Another attemp to fix CI (#1744)
Browse files Browse the repository at this point in the history
* fixing?

* more

* delete macos build_and_run fuzzers as its runtime exceeds 360minutes and can't fix it
  • Loading branch information
tokatoka committed Dec 20, 2023
1 parent 68e7b20 commit a98805b
Show file tree
Hide file tree
Showing 18 changed files with 39 additions and 61 deletions.
24 changes: 1 addition & 23 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,18 +191,14 @@ jobs:
fuzzers:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: Remove Dotnet (macOS)
if: runner.os == 'macOS'
run: rm -rf /usr/local/bin/dotnet
- name: Free Disk Space (Ubuntu)
if: runner.os == 'Linux'
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
Expand All @@ -223,31 +219,16 @@ jobs:
run: rustup toolchain install nightly-x86_64-unknown-linux-gnu ; rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
- name: Add wasm target
run: rustup target add wasm32-unknown-unknown
- name: Install cxxbridge
if: runner.os == 'macOS'
run: cargo install cxxbridge-cmd
- name: Install ucd-generate
run: cargo install -f ucd-generate
- name: Install python (macOS)
# Removing macOS things already installed in CI against failed linking
if: runner.os == 'macOS'
run: rm /usr/local/bin/2to3* /usr/local/bin/idle3* /usr/local/bin/pydoc3* /usr/local/bin/python3*; brew install --force-bottle --overwrite python
- name: Remove obsolete llvm (macOS)
if: runner.os == 'macOS'
run: brew remove --force llvm clang
- name: Remove obsolete llvm (Linux)
if: runner.os == 'Linux'
run: sudo apt purge llvm* clang*
- uses: lyricwulf/abc@v1
with:
linux: llvm-15 llvm-15-dev clang-15 nasm ninja-build gcc-arm-linux-gnueabi g++-arm-linux-gnueabi gcc-aarch64-linux-gnu g++-aarch64-linux-gnu gcc-mipsel-linux-gnu g++-mipsel-linux-gnu gcc-powerpc-linux-gnu g++-powerpc-linux-gnu libc6-dev-i386-cross libc6-dev libc6-dev-i386 lib32gcc-11-dev lib32stdc++-11-dev libgtk-3-dev pax-utils libz3-dev
# update bash for macos to support `declare -A` command`
macos: llvm@15 libpng nasm coreutils z3 bash wget
- name: Set clang version
if: runner.os == 'Linux'
run: sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-15 100
- name: Set clang++ version
if: runner.os == 'Linux'
run: sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-15 100
- name: pip install
run: python3 -m pip install msgpack jinja2 find_libpython
Expand Down Expand Up @@ -278,9 +259,6 @@ jobs:
- name: Build and run example fuzzers (Linux)
if: runner.os == 'Linux'
run: RUN_ON_CI=1 LLVM_CONFIG=llvm-config-15 ./scripts/test_all_fuzzers.sh
- name: Build and run example fuzzers (macOS)
if: runner.os == 'macOS' # use bash v4
run: /usr/local/bin/bash -c 'RUN_ON_CI=1 ./scripts/test_all_fuzzers.sh'

qemu_fuzzers:
strategy:
Expand Down
2 changes: 1 addition & 1 deletion fuzzers/baby_fuzzer_swap_differential/Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ windows_alias = "unsupported"
[tasks.test_unix]
script_runner = "@shell"
script='''
timeout 10s ${CARGO_TARGET_DIR}/${PROFILE_DIR}/${FUZZER_NAME} >fuzz_stdout.log || true
timeout 30s ${CARGO_TARGET_DIR}/${PROFILE_DIR}/${FUZZER_NAME} >fuzz_stdout.log || true
if [ -z "$(grep "objectives: 1" fuzz_stdout.log)" ]; then
echo "Fuzzer does not generate any testcases or any crashes"
exit 1
Expand Down
4 changes: 2 additions & 2 deletions fuzzers/frida_libpng/Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ windows_alias = "test_windows"
script_runner = "@shell"
script='''
rm -rf libafl_unix_shmem_server || true
timeout 10s ./${FUZZER_NAME} -F LLVMFuzzerTestOneInput -H ./libpng-harness.so -l ./libpng-harness.so >fuzz_stdout.log || true
timeout 30s ./${FUZZER_NAME} -F LLVMFuzzerTestOneInput -H ./libpng-harness.so -l ./libpng-harness.so >fuzz_stdout.log 2>/dev/null || true
if [ -z "$(grep "corpus: 30" fuzz_stdout.log)" ]; then
echo "Fuzzer does not generate any testcases or any crashes"
exit 1
Expand All @@ -125,7 +125,7 @@ dependencies = [ "fuzzer", "harness" ]
script_runner = "@shell"
script='''
rm -rf libafl_unix_shmem_server || true
timeout 10s ./${FUZZER_NAME} -F LLVMFuzzerTestOneInput -H ./libpng-harness.so -l ./libpng-harness.so >fuzz_stdout.log || true
timeout 30s ./${FUZZER_NAME} -F LLVMFuzzerTestOneInput -H ./libpng-harness.so -l ./libpng-harness.so >fuzz_stdout.log 2>/dev/null || true
'''
dependencies = [ "fuzzer", "harness" ]

Expand Down
4 changes: 2 additions & 2 deletions fuzzers/fuzzbench/Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ rm -rf libafl_unix_shmem_server || true
mkdir in || true
echo a > in/a
# Allow sigterm as exit code
timeout 11s ./${FUZZER_NAME} -o out -i in >fuzz_stdout.log || true
if [ -z "$(grep "objectives: 10" fuzz_stdout.log)" ]; then
timeout 31s ./${FUZZER_NAME} -o out -i in >fuzz_stdout.log || true
if [ -z "$(grep "objectives: 1" fuzz_stdout.log)" ]; then
echo "Fuzzer does not generate any testcases or any crashes"
exit 1
else
Expand Down
4 changes: 2 additions & 2 deletions fuzzers/fuzzbench_text/Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ rm -rf libafl_unix_shmem_server || true
mkdir in || true
echo a > in/a
# Allow sigterm as exit code
timeout 11s ./${FUZZER_NAME} -o out -i in >fuzz_stdout.log || true
timeout 31s ./${FUZZER_NAME} -o out -i in >fuzz_stdout.log || true
cat fuzz_stdout.log
if [ -z "$(grep "objectives: 10" fuzz_stdout.log)" ]; then
if [ -z "$(grep "objectives: 1" fuzz_stdout.log)" ]; then
echo "Fuzzer does not generate any testcases or any crashes"
exit 1
else
Expand Down
2 changes: 1 addition & 1 deletion fuzzers/libafl_atheris/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ short_test: all
(\
rm -rf libafl_unix_shmem_server || true; \
. env/bin/activate; \
LD_PRELOAD=$(DEEXIT_PATH) DYLD_FORCE_FLAT_NAMESPACE=1 DYLD_INSERT_LIBRARIES=$(DEEXIT_PATH) RUST_BACKTRACE=1 timeout 10s python3 ./atheris/example_fuzzers/fuzzing_example.py --cores 0 -i in -o out || true; \
LD_PRELOAD=$(DEEXIT_PATH) DYLD_FORCE_FLAT_NAMESPACE=1 DYLD_INSERT_LIBRARIES=$(DEEXIT_PATH) RUST_BACKTRACE=1 timeout 30s python3 ./atheris/example_fuzzers/fuzzing_example.py --cores 0 -i in -o out || true; \
rm -rf out; \
)

Expand Down
4 changes: 2 additions & 2 deletions fuzzers/libfuzzer_libmozjpeg/Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ windows_alias = "unsupported"
script_runner = "@shell"
script='''
rm -rf libafl_unix_shmem_server || true
(timeout 11s ./${FUZZER_NAME} >fuzz_stdout.log 2>/dev/null || true) &
(timeout 31s ./${FUZZER_NAME} >fuzz_stdout.log 2>/dev/null || true) &
sleep 0.2
timeout 10s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true
timeout 30s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true
if [ -z "$(grep "corpus: 30" fuzz_stdout.log)" ]; then
echo "Fuzzer does not generate any testcases or any crashes"
exit 1
Expand Down
8 changes: 4 additions & 4 deletions fuzzers/libfuzzer_libpng/Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ windows_alias = "unsupported"
script_runner = "@shell"
script='''
rm -rf libafl_unix_shmem_server || true
(timeout 11s ./${FUZZER_NAME} >fuzz_stdout.log 2>/dev/null || true) &
(timeout 31s ./${FUZZER_NAME} >fuzz_stdout.log 2>/dev/null || true) &
sleep 0.2
timeout 10s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true
timeout 30s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true
if [ -z "$(grep "corpus: 30" fuzz_stdout.log)" ]; then
echo "Fuzzer does not generate any testcases or any crashes"
exit 1
Expand All @@ -177,9 +177,9 @@ dependencies = [ "fuzzer" ]
script_runner = "@shell"
script='''
rm -rf libafl_unix_shmem_server || true
(timeout 11s ./${FUZZER_NAME} >fuzz_stdout.log 2>/dev/null || true) &
(timeout 31s ./${FUZZER_NAME} >fuzz_stdout.log 2>/dev/null || true) &
sleep 0.2
timeout 10s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true
timeout 30s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true
'''
dependencies = [ "fuzzer" ]

Expand Down
4 changes: 2 additions & 2 deletions fuzzers/libfuzzer_libpng_accounting/Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ windows_alias = "unsupported"
script_runner = "@shell"
script='''
rm -rf libafl_unix_shmem_server || true
timeout 11s ./${FUZZER_NAME} --cores 0 --input ./corpus >fuzz_stdout.log 2>/dev/null || true
timeout 31s ./${FUZZER_NAME} --cores 0 --input ./corpus >fuzz_stdout.log 2>/dev/null || true
if [ -z "$(grep "corpus: 30" fuzz_stdout.log)" ]; then
echo "Fuzzer does not generate any testcases or any crashes"
exit 1
Expand All @@ -112,7 +112,7 @@ dependencies = [ "fuzzer" ]
script_runner = "@shell"
script='''
rm -rf libafl_unix_shmem_server || true
timeout 11s ./${FUZZER_NAME} --cores 0 --input ./corpus >fuzz_stdout.log 2>/dev/null || true
timeout 31s ./${FUZZER_NAME} --cores 0 --input ./corpus >fuzz_stdout.log 2>/dev/null || true
'''
dependencies = [ "fuzzer" ]

Expand Down
4 changes: 2 additions & 2 deletions fuzzers/libfuzzer_libpng_centralized/Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ windows_alias = "unsupported"
script_runner = "@shell"
script='''
rm -rf libafl_unix_shmem_server || true
timeout 11s ./${FUZZER_NAME} --cores 0 --input ./corpus 2>/dev/null >fuzz_stdout.log || true
timeout 31s ./${FUZZER_NAME} --cores 0 --input ./corpus 2>/dev/null >fuzz_stdout.log || true
if [ -z "$(grep "corpus: 30" fuzz_stdout.log)" ]; then
echo "Fuzzer does not generate any testcases or any crashes"
exit 1
Expand All @@ -112,7 +112,7 @@ dependencies = [ "fuzzer" ]
script_runner = "@shell"
script='''
rm -rf libafl_unix_shmem_server || true
timeout 11s ./${FUZZER_NAME} --cores 0 --input ./corpus 2>/dev/null >fuzz_stdout.log || true
timeout 31s ./${FUZZER_NAME} --cores 0 --input ./corpus 2>/dev/null >fuzz_stdout.log || true
'''
dependencies = [ "fuzzer" ]

Expand Down
8 changes: 4 additions & 4 deletions fuzzers/libfuzzer_libpng_cmin/Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ windows_alias = "unsupported"
script_runner = "@shell"
script='''
rm -rf libafl_unix_shmem_server || true
timeout 11s ./${FUZZER_NAME} >fuzz_stdout.log &
timeout 31s ./${FUZZER_NAME} >fuzz_stdout.log &
sleep 0.2
timeout 10s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true
timeout 30s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true
if [ -z "$(grep "corpus: 30" fuzz_stdout.log)" ]; then
echo "Fuzzer does not generate any testcases or any crashes"
exit 1
Expand All @@ -177,9 +177,9 @@ dependencies = [ "fuzzer" ]
script_runner = "@shell"
script='''
rm -rf libafl_unix_shmem_server || true
timeout 11s ./${FUZZER_NAME} >fuzz_stdout.log &
timeout 31s ./${FUZZER_NAME} >fuzz_stdout.log &
sleep 0.2
timeout 10s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true
timeout 30s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true
'''
dependencies = [ "fuzzer" ]

Expand Down
4 changes: 2 additions & 2 deletions fuzzers/libfuzzer_libpng_ctx/Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ windows_alias = "unsupported"
script_runner = "@shell"
script='''
rm -rf libafl_unix_shmem_server || true
timeout 11s ./${FUZZER_NAME} --cores 0 --input ./corpus >fuzz_stdout.log 2>/dev/null || true
timeout 31s ./${FUZZER_NAME} --cores 0 --input ./corpus >fuzz_stdout.log 2>/dev/null || true
if [ -z "$(grep "corpus: 30" fuzz_stdout.log)" ]; then
echo "Fuzzer does not generate any testcases or any crashes"
exit 1
Expand All @@ -112,7 +112,7 @@ dependencies = [ "fuzzer" ]
script_runner = "@shell"
script='''
rm -rf libafl_unix_shmem_server || true
timeout 11s ./${FUZZER_NAME} --cores 0 --input ./corpus >fuzz_stdout.log 2>/dev/null || true
timeout 31s ./${FUZZER_NAME} --cores 0 --input ./corpus >fuzz_stdout.log 2>/dev/null || true
'''

# Clean up
Expand Down
4 changes: 2 additions & 2 deletions fuzzers/libfuzzer_libpng_launcher/Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ windows_alias = "unsupported"
script_runner = "@shell"
script='''
rm -rf libafl_unix_shmem_server || true
timeout 11s ./${FUZZER_NAME}.coverage --broker-port 21337 --cores 0 --input ./corpus 2>/dev/null >fuzz_stdout.log || true
timeout 31s ./${FUZZER_NAME}.coverage --broker-port 21337 --cores 0 --input ./corpus 2>/dev/null >fuzz_stdout.log || true
if [ -z "$(grep "corpus: 30" fuzz_stdout.log)" ]; then
echo "Fuzzer does not generate any testcases or any crashes"
exit 1
Expand All @@ -113,7 +113,7 @@ dependencies = [ "fuzzer" ]
script_runner = "@shell"
script='''
rm -rf libafl_unix_shmem_server || true
timeout 11s ./${FUZZER_NAME} --cores 0 --input ./corpus 2>/dev/null >fuzz_stdout.log || true
timeout 31s ./${FUZZER_NAME} --cores 0 --input ./corpus 2>/dev/null >fuzz_stdout.log || true
'''
dependencies = [ "fuzzer" ]

Expand Down
2 changes: 1 addition & 1 deletion fuzzers/libfuzzer_libpng_norestart/Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ rm -rf libafl_unix_shmem_server || true
rm -rf corpus/ || true
mkdir corpus/ || true
cp seeds/* corpus/ || true
timeout 11s ./${FUZZER_NAME} --cores 0 --input ./corpus 2>/dev/null >fuzz_stdout.log || true
timeout 31s ./${FUZZER_NAME} --cores 0 --input ./corpus 2>/dev/null >fuzz_stdout.log || true
if [ -z "$(grep "corpus: 30" fuzz_stdout.log)" ]; then
echo "Fuzzer does not generate any testcases or any crashes"
exit 1
Expand Down
8 changes: 4 additions & 4 deletions fuzzers/libfuzzer_libpng_tcp_manager/Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ windows_alias = "unsupported"
script_runner = "@shell"
script='''
rm -rf libafl_unix_shmem_server || true
(timeout 11s ./${FUZZER_NAME} >fuzz_stdout.log 2>/dev/null || true) &
(timeout 31s ./${FUZZER_NAME} >fuzz_stdout.log 2>/dev/null || true) &
sleep 0.2
timeout 10s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true
timeout 30s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true
if [ -z "$(grep "corpus: 30" fuzz_stdout.log)" ]; then
echo "Fuzzer does not generate any testcases or any crashes"
exit 1
Expand All @@ -177,9 +177,9 @@ dependencies = [ "fuzzer" ]
script_runner = "@shell"
script='''
rm -rf libafl_unix_shmem_server || true
(timeout 11s ./${FUZZER_NAME} >fuzz_stdout.log 2>/dev/null || true) &
(timeout 31s ./${FUZZER_NAME} >fuzz_stdout.log 2>/dev/null || true) &
sleep 0.2
timeout 10s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true
timeout 30s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true
'''
dependencies = [ "fuzzer" ]

Expand Down
8 changes: 4 additions & 4 deletions fuzzers/libfuzzer_stb_image/Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ windows_alias = "test_windows"
script_runner = "@shell"
script='''
rm -rf libafl_unix_shmem_server || true
(timeout 11s ./${FUZZER_NAME} >fuzz_stdout.log 2>/dev/null || true) &
(timeout 31s ./${FUZZER_NAME} >fuzz_stdout.log 2>/dev/null || true) &
sleep 0.2
timeout 10s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true
timeout 30s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true
if [ -z "$(grep "corpus: 30" fuzz_stdout.log)" ]; then
echo "Fuzzer does not generate any testcases or any crashes"
exit 1
Expand All @@ -78,9 +78,9 @@ dependencies = [ "fuzzer" ]
script_runner = "@shell"
script='''
rm -rf libafl_unix_shmem_server || true
(timeout 11s ./${FUZZER_NAME} >fuzz_stdout.log 2>/dev/null || true) &
(timeout 31s ./${FUZZER_NAME} >fuzz_stdout.log 2>/dev/null || true) &
sleep 0.2
timeout 10s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true
timeout 30s ./${FUZZER_NAME} >/dev/null 2>/dev/null || true
'''
dependencies = [ "fuzzer"]

Expand Down
2 changes: 1 addition & 1 deletion fuzzers/libfuzzer_stb_image_sugar/Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ windows_alias = "test_windows"
script_runner = "@shell"
script='''
rm -rf libafl_unix_shmem_server || true
timeout 11s ./${FUZZER_NAME} 2>/dev/null >fuzz_stdout.log || true
timeout 31s ./${FUZZER_NAME} 2>/dev/null >fuzz_stdout.log || true
echo "The test is skipped. See https://github.com/AFLplusplus/LibAFL/issues/1176"
'''
dependencies = [ "fuzzer" ]
Expand Down
4 changes: 2 additions & 2 deletions fuzzers/nautilus_sync/Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ windows_alias = "unsupported"
script_runner = "@shell"
script='''
rm -rf libafl_unix_shmem_server || true
timeout 11s ./${FUZZER_NAME} --cores 0 >fuzz_stdout.log 2>/dev/null || true
timeout 31s ./${FUZZER_NAME} --cores 0 >fuzz_stdout.log 2>/dev/null || true
if [ -z "$(grep "corpus: 8" fuzz_stdout.log)" ]; then
echo "Fuzzer does not generate any testcases or any crashes"
exit 1
Expand All @@ -120,7 +120,7 @@ dependencies = [ "fuzzer" ]
script_runner = "@shell"
script='''
rm -rf libafl_unix_shmem_server || true
timeout 11s ./${FUZZER_NAME} --cores 0 >fuzz_stdout.log 2>/dev/null || true
timeout 31s ./${FUZZER_NAME} --cores 0 >fuzz_stdout.log 2>/dev/null || true
'''
dependencies = [ "fuzzer" ]

Expand Down

0 comments on commit a98805b

Please sign in to comment.