This is an automated email from the ASF dual-hosted git repository. pnoltes pushed a commit to branch feature/fuzz-corpus-storage in repository https://gitbox.apache.org/repos/asf/celix.git
commit dfc227049a142bce7869abcf818b0a5fc2fff086 Author: Pepijn Noltes <[email protected]> AuthorDate: Fri Feb 6 17:24:18 2026 +0000 Add upload and download fuzz corpus to the fuzzing ci --- .github/workflows/fuzzing.yml | 27 +++++++++++++++++++++++++++ documents/building/fuzz_testing.md | 16 ++++++++++++---- 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/.github/workflows/fuzzing.yml b/.github/workflows/fuzzing.yml index 242b47567..8a2227fb6 100644 --- a/.github/workflows/fuzzing.yml +++ b/.github/workflows/fuzzing.yml @@ -9,6 +9,8 @@ on: jobs: fuzz-utils: runs-on: ubuntu-22.04 + permissions: + actions: read timeout-minutes: 30 steps: - name: Checkout source code @@ -37,6 +39,17 @@ jobs: run: conan install . --output-folder=build --build=missing -o "celix/*:build_utils=True" -o "celix/*:enable_fuzzing=True" -o "celix/*:enable_address_sanitizer=True" -o "celix/*:enable_undefined_sanitizer=True" - name: Conan build run: conan build . --output-folder=build -o "celix/*:build_utils=True" -o "celix/*:enable_fuzzing=True" -o "celix/*:enable_address_sanitizer=True" -o "celix/*:enable_undefined_sanitizer=True" -o "celix/*:celix_err_buffer_size=5120" + - name: Restore previous fuzzing corpora artifact + continue-on-error: true #can fail if no previous fuzzing-corpora-artifact exists + env: + GH_TOKEN: ${{ github.token }} + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + run: | + #retrieve lastest master / Celix Fuzzing run id + RUN_ID=$(gh run list --branch "${BRANCH_NAME}" --workflow "${{ github.workflow }}" --json databaseId --jq '.[0].databaseId') + gh run download "$RUN_ID" --name fuzzing-corpora-artifact + mkdir -p build/libs/utils/fuzzing + tar -xzf fuzzing-corpora-artifact.tar.gz -C fuzzing-previous - name: Set fuzzer run time id: set-runtime run: | @@ -57,3 +70,17 @@ jobs: run: | source build/conanrun.sh ./build/libs/utils/fuzzing/celix_filter_fuzzer -max_total_time=$FUZZ_TIME ./build/libs/utils/fuzzing/filter_corpus + - name: Package fuzzing corpora artifacts + if: always() #Always package & upload updated fuzzing corpora artifacts + run: | + mkdir -p fuzzing-artifact + for path in build/libs/utils/fuzzing/*_corpus; do + cp -a "$path" fuzzing-artifact/ + done + tar -czf fuzzing-corpora-artifact.tar.gz -C fuzzing-artifact . + - name: Upload fuzzing artifacts + if: always() #Always package & upload updated fuzzing corpora artifact + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 #v4.3.1 + with: + name: fuzzing-corpora-artifact + path: fuzzing-corpora-artifact.tar.gz diff --git a/documents/building/fuzz_testing.md b/documents/building/fuzz_testing.md index 50f0abb21..624ccae65 100644 --- a/documents/building/fuzz_testing.md +++ b/documents/building/fuzz_testing.md @@ -22,8 +22,9 @@ limitations under the License. # Fuzz Testing with libFuzzer The utilities library contains fuzz targets that can be built with -[LLVM libFuzzer](https://llvm.org/docs/LibFuzzer.html). Fuzzing is -enabled when using the Clang compiler and the `UTILS_LIBFUZZER` CMake +[LLVM libFuzzer](https://llvm.org/docs/LibFuzzer.html). + +Fuzzing is enabled when using the Clang compiler and the `UTILS_LIBFUZZER` CMake option. ## Building @@ -70,5 +71,12 @@ This will display all available LibFuzzer options. ## Continuous Fuzzing -A GitHub Actions workflow runs the fuzzer periodically. The workflow -configuration can be found at `.github/workflows/fuzzing.yml`. +Each Celix Fuzzing run attempts to download the latest fuzzing artifact from the same branch and unpack any +existing corpora before executing the fuzzers so new inputs build on the most recent discoveries. + +### Maintaining the seed corpus + +The Celix Fuzzing workflow uploads the generated corpora files as a build artifact +named `fuzzing-corpora-artifact`. +The master version of the `fuzzing-corpora-artifactz` artifact is used to keep +the seed corpus in `libs/utils/fuzzing/{filter,properties,version}_corpus` updated.
