From e06ddea784940dfc3af01669bf920d8afb5479bc Mon Sep 17 00:00:00 2001 From: Paul Dreik Date: Thu, 1 Oct 2020 10:12:37 +0200 Subject: [PATCH] add CI fuzzing on arm 64 bit This adds fuzzing on drone.io arm64 For some reason, leak detection had to be disabled. If it is enabled, the fuzzer falsely reports a crash at the end of fuzzing. Closes: #1188 --- .drone.yml | 20 ++++++++++++++++++++ fuzz/fuzz_implementations.cpp | 3 ++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index ac7e0956b..974d716ad 100644 --- a/.drone.yml +++ b/.drone.yml @@ -382,6 +382,26 @@ steps: - ctest $CTEST_FLAGS --- kind: pipeline +name: arm64-fuzz +platform: { os: linux, arch: arm64 } +steps: +- name: Build and run fuzzers shortly + image: ubuntu:20.04 + environment: + CC: clang + CXX: clang++ + DEBIAN_FRONTEND: noninteractive + ASAN_OPTIONS: detect_leaks=0 + commands: + - apt-get update -qq + - apt-get install -q -y clang cmake git wget zip ninja-build + - wget --quiet https://dl.bintray.com/pauldreik/simdjson-fuzz-corpus/corpus/corpus.tar + - tar xf corpus.tar && rm corpus.tar + - fuzz/build_like_ossfuzz.sh + - mkdir -p common_out + - for fuzzer in build/fuzz/fuzz_* ; do echo $fuzzer;$fuzzer common_out out/* -max_total_time=40; done +--- +kind: pipeline name: stylecheck platform: { os: linux, arch: amd64 } steps: diff --git a/fuzz/fuzz_implementations.cpp b/fuzz/fuzz_implementations.cpp index 0a6b71b51..aad9760ad 100644 --- a/fuzz/fuzz_implementations.cpp +++ b/fuzz/fuzz_implementations.cpp @@ -84,7 +84,8 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { // let each implementation parse and store the result std::size_t nerrors=0; - for(auto& e: implementations) { + for(std::size_t i=0; i