diff options
| author | peter <peter@pmikkelsen.com> | 2026-10-02 20:04:59 +0000 |
|---|---|---|
| committer | peter <peter@pmikkelsen.com> | 2026-10-02 20:04:59 +0000 |
| commit | 8dcf2fab04ae0cb761b361d0cbc56faec83f285a (patch) | |
| tree | fc32f5a78f779211e502243248b8800a3f2ee25f /tools/fuzz | |
| parent | 4c6ff102c89b0d18cdcca666927243190a42bf68 (diff) | |
Start adding some support for finding crashes using fuzzing.
As of this commits, a lot of tests will fail.
FossilOrigin-Name: b69b0e75daaa2ac3959f7a474207ba786823d1a5f8147cfe280df729cb829713
Diffstat (limited to 'tools/fuzz')
| -rwxr-xr-x | tools/fuzz | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tools/fuzz b/tools/fuzz new file mode 100755 index 0000000..892e950 --- /dev/null +++ b/tools/fuzz @@ -0,0 +1,28 @@ +#!/bin/sh + +if [ $# -ne 1 ] +then + echo Usage: tools/fuzz BUILD_TYPE + exit 1 +fi + +rm -rf builds/fuzz-$1 +mkdir -p builds/fuzz-$1 +cd builds/fuzz-$1 +../../configure --enable-enable-build-mode=$1 --disable-shared CC=afl-cc +make clean && make +mkdir -p fuzz-in +mkdir -p fuzz-out +mkdir -p fuzz-in-min +cp ../../tests/scripts/good/*.aplwc fuzz-in +cp ../../tests/scripts/bad/*.aplwc fuzz-in +afl-cmin -i fuzz-in -o fuzz-in-min -- ./aplwc @@ +rm fuzz-in/* +cd fuzz-in-min +for f in * +do + afl-tmin -i "$f" -o "../fuzz-in/$f" -- ../aplwc @@ +done +cd .. +rm -rf fuzz-in-min +afl-fuzz -i fuzz-in -o fuzz-out -m 20 -t 50 -- ./aplwc @@ |