mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-10-31 05:35:35 +00:00
adding fuzzer for espeak_synth (#1178)
* Add: fuzzer files and modifications in config & compil * add configure.ac change * add minimize-corpus.sh * add fuzzing directory and readme * add to check if CC support libfuzzer * Make workflow dump the crash POC * Add debugging information * Run fuzzing only once a week for now Co-authored-by: kmamadoudram <kalilou.mamadou-drame@etu.u-bordeaux.fr> Co-authored-by: yocvito <nicolas.morel@etu.u-bordeaux.fr> Co-authored-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
This commit is contained in:
co-authored by
kmamadoudram
yocvito
Samuel Thibault
parent
9decedb8c2
commit
1f76c4b8bd
@@ -22,21 +22,21 @@ jobs:
|
||||
include:
|
||||
- sanitizer: "no"
|
||||
deps: ""
|
||||
configflags: ""
|
||||
configflags: "-g -Og -fno-omit-frame-pointer"
|
||||
config: ""
|
||||
build_env: ""
|
||||
check_env: ""
|
||||
|
||||
- sanitizer: "address"
|
||||
deps: ""
|
||||
configflags: "-fsanitize=address -g -Og"
|
||||
configflags: "-fsanitize=address -g -Og -fno-omit-frame-pointer"
|
||||
config: ""
|
||||
build_env: "ASAN_OPTIONS=detect_leaks=0"
|
||||
check_env: "ASAN_OPTIONS=detect_leaks=0"
|
||||
|
||||
- sanitizer: "leak"
|
||||
deps: ""
|
||||
configflags: '-fsanitize=leak -g -Og'
|
||||
configflags: '-fsanitize=leak -g -Og -fno-omit-frame-pointer'
|
||||
config: ""
|
||||
build_env: "LSAN_OPTIONS=fast_unwind_on_malloc=0"
|
||||
check_env: "LSAN_OPTIONS=fast_unwind_on_malloc=0"
|
||||
@@ -44,28 +44,28 @@ jobs:
|
||||
- sanitizer: "memory"
|
||||
deps: "clang"
|
||||
configenv: "CC=clang CXX=clang++"
|
||||
configflags: "-fsanitize=memory -fsanitize-memory-track-origins=2 -g -Og"
|
||||
configflags: "-fsanitize=memory -fsanitize-memory-track-origins=2 -g -Og -fno-omit-frame-pointer"
|
||||
config: "--without-pcaudiolib"
|
||||
build_env: "MSAN_OPTIONS=exitcode=42"
|
||||
check_env: "MSAN_OPTIONS=exitcode=42"
|
||||
|
||||
- sanitizer: "thread"
|
||||
deps: ""
|
||||
configflags: "-fsanitize=thread -g -Og"
|
||||
configflags: "-fsanitize=thread -g -Og -fno-omit-frame-pointer"
|
||||
config: ""
|
||||
build_env: ""
|
||||
check_env: ""
|
||||
|
||||
- sanitizer: "undefined"
|
||||
deps: ""
|
||||
configflags: "-fsanitize=undefined -g -Og"
|
||||
configflags: "-fsanitize=undefined -g -Og -fno-omit-frame-pointer"
|
||||
config: ""
|
||||
build_env: "UBSAN_OPTIONS=halt_on_error=1"
|
||||
check_env: "UBSAN_OPTIONS=halt_on_error=1"
|
||||
|
||||
- sanitizer: "valgrind"
|
||||
deps: "libtool-bin valgrind"
|
||||
configflags: '-g -Og'
|
||||
configflags: '-g -Og -fno-omit-frame-pointer'
|
||||
config: ""
|
||||
build_env: 'VALGRIND="libtool --mode=execute valgrind --track-origins=yes --leak-check=full --error-exitcode=1" '
|
||||
check_env: 'VALGRIND="libtool --mode=execute valgrind --track-origins=yes --leak-check=full --error-exitcode=1" '
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
name: fuzzing
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: "0 4 * * 1"
|
||||
|
||||
jobs:
|
||||
fuzzing:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
name: Fuzz synth_espeak on ${{ matrix.arch }} for ${{ matrix.lang }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
arch: [x86-32, x86-64]
|
||||
lang: [af, am, an, ar, as, az, ba, be, bg, bn, bpy, bs, ca, chr, cmn, cs, cv, cy, da, de, el, en, eo, es, et, eu, fa, fi, fr, ga, gd, gn, grc, gu, hak, haw, he, hi, hr, ht, hu, hy, ia, id, io, is, it, ja, jbo, ka, kk, kl, kn, ko, kok, ku, ky, la, lb, lfn, lt, lv, mi, mk, ml, mr, ms, mt, my, nci, ne, nl, no, nog, om, or, pa, pap, piqd, pl, pt, py, qdb, qu, quc, qya, ro, ru, sd, shn, si, sjn, sk, sl, smj, sq, sr, sv, sw, ta, te, th, tk, tn, tr, tt, ug, uk, ur, uz, vi, yue]
|
||||
include:
|
||||
- arch: x86-32
|
||||
archdeps: "gcc-multilib g++-multilib libpcaudio-dev:i386 libsonic-dev:i386 libc6-dbg:i386"
|
||||
archconfigflags: "-m32"
|
||||
|
||||
- arch: x86-64
|
||||
archdeps: ""
|
||||
archconfigflags: ''
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: enable 32bit architecture
|
||||
run: sudo dpkg --add-architecture i386
|
||||
if: matrix.arch == 'x86-32'
|
||||
- name: dependencies
|
||||
run: sudo apt-get update && sudo apt-get install libpcaudio-dev libsonic-dev ronn kramdown clang llvm ${{ matrix.archdeps }}
|
||||
- name: autoconf
|
||||
run: ./autogen.sh ; chmod -x INSTALL m4/*.m4
|
||||
- name: configure
|
||||
run: CC=clang CXX=clang++
|
||||
CFLAGS="${{ matrix.archconfigflags }} -fsanitize=address,undefined -fstack-protector-strong -g -Og -fno-omit-frame-pointer"
|
||||
CXXFLAGS="${{ matrix.archconfigflags }} -fsanitize=address,undefined -fstack-protector-strong -g -Og -fno-omit-frame-pointer"
|
||||
LDFLAGS="-fsanitize=address,undefined -lubsan"
|
||||
./configure --with-libfuzzer
|
||||
- name: Store the fuzzer config
|
||||
if: ${{ failure() }}
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: config-${{ matrix.arch }}-${{ matrix.lang }}.log
|
||||
path: config.log
|
||||
- name: make
|
||||
run: make -j
|
||||
- name: Fuzz function synth_espeak()
|
||||
run: mkdir tests/fuzzing/CORPUS_DIR ; FUZZ_VOICE=${{ matrix.lang }} tests/fuzzing/synth_fuzzer.test -seed=1 -runs=10000 -max_len=4096 tests/fuzzing/CORPUS_DIR
|
||||
- name: Store the crash POC
|
||||
if: ${{ failure() }}
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: crash-${{ matrix.arch }}-${{ matrix.lang }}.1
|
||||
path: crash-*
|
||||
- name: Fuzz function synth_espeak() with language-specific input
|
||||
run: cp dictsource/${{ matrix.lang }}_* tests/fuzzing/CORPUS_DIR/ ; FUZZ_VOICE=${{ matrix.lang }} tests/fuzzing/synth_fuzzer.test -seed=1 -runs=10000 -max_len=4096 tests/fuzzing/CORPUS_DIR
|
||||
- name: Store the crash POC
|
||||
if: ${{ failure() }}
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: crash-${{ matrix.arch }}-${{ matrix.lang }}.2
|
||||
path: crash-*
|
||||
Reference in New Issue
Block a user