From 0370751537c141246c145f4eb5251163990a346d Mon Sep 17 00:00:00 2001 From: Enno Boland Date: Sun, 2 Jun 2024 12:28:22 +0200 Subject: [PATCH] .github: upload failing inputs from fuzzer runs --- .github/workflows/ci.yaml | 8 ++++++++ fuzzer/meson.build | 13 +++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f27682fe..959d9510 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -84,6 +84,8 @@ jobs: runs-on: ubuntu-latest container: image: gottox/sqsh-build:x86_64 + volumes: + - /tmp/build:/tmp/build steps: - uses: actions/checkout@v4 - name: configure @@ -103,6 +105,12 @@ jobs: - name: fuzzer run: | ninja -C /tmp/build test + - name: Upload Failing Inputs + uses: actions/upload-artifact@v4 + if: failure() + with: + name: failing-inputs + path: /tmp/build/fuzzer/inputs build: needs: diff --git a/fuzzer/meson.build b/fuzzer/meson.build index 59333b86..4a63825d 100644 --- a/fuzzer/meson.build +++ b/fuzzer/meson.build @@ -31,17 +31,26 @@ fuzzer = executable( link_with: libsqsh.get_static_lib(), ) +rundir_tgt = custom_target( + 'fuzzer_inputs', + output: 'inputs', + command: [mkdir, '-p', '@OUTPUT@'], +) + test( 'simple_fuzzer', fuzzer, - depends: corpus_tgt, + workdir: rundir_tgt.full_path(), + is_parallel: false, + depends: [corpus_tgt, rundir_tgt], args: [ corpus_tgt.full_path(), source_corpus, '-error_exitcode=1', '-timeout_exitcode=1', - '-timeout=3', + '-timeout=10', '-rss_limit_mb=0', + '-malloc_limit_mb=10', '-max_total_time=@0@'.format(get_option('fuzzer_timeout')), ], timeout: 10 + get_option('fuzzer_timeout'),