Skip to content

Commit

Permalink
Port the clang-fuzzer code to the Makefile.
Browse files Browse the repository at this point in the history
Still doesn't work because Prometheus client_golang broke everything for
non-modules in
github.com/prometheus/client_golang/commit/ee1078a03c073762e2660d305738bfdafbf69ba6

You can't resolve xxhash/v2 in the fuzzer bcause it doesn't support modules
yet, dvyukov/go-fuzz#195
  • Loading branch information
jaqx0r committed Dec 6, 2019
1 parent 2b87bbd commit e927274
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
14 changes: 4 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,10 @@ jobs:
wget -q -O fuzzit https://github.com/fuzzitdev/fuzzit/releases/latest/download/fuzzit_Linux_x86_64
chmod a+x fuzzit
- run: |
make install_deps
cd internal/vm
go-fuzz-build -libfuzzer -o fuzzer.a .
clang-9 -fsanitize=fuzzer fuzzer.a -o fuzzer
make clang-fuzzer
- run: |
./fuzzit auth $FUZZIT_API_KEY
./fuzzit create job --type fuzzing --branch ${CIRCLE_BRANCH} --revision ${CIRCLE_SHA1} mtail/internal-vm internal/vm/fuzzer
./fuzzit create job --type fuzzing --branch ${CIRCLE_BRANCH} --revision ${CIRCLE_SHA1} mtail/internal-vm clang-fuzzer
fuzz-regression:
working_directory: /go/src/github.com/google/mtail
Expand All @@ -170,12 +167,9 @@ jobs:
wget -q -O fuzzit https://github.com/fuzzitdev/fuzzit/releases/latest/download/fuzzit_Linux_x86_64
chmod a+x fuzzit
- run: |
make install_deps
cd internal/vm
go-fuzz-build -libfuzzer -o fuzzer.a .
clang-9 -fsanitize=fuzzer fuzzer.a -o fuzzer
make clang-fuzzer
- run: |
./fuzzit create job --type local-regression --branch ${CIRCLE_BRANCH} --revision ${CIRCLE_SHA1} mtail/internal-vm internal/vm/fuzzer
./fuzzit create job --type local-regression --branch ${CIRCLE_BRANCH} --revision ${CIRCLE_SHA1} mtail/internal-vm clang-fuzzer
# tag-filter ensures that jobs run for version-tagged changes as well as
# regular commits. Use for all normal build and test and stats (coverage)
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ fuzz: vm-fuzz.zip | $(GOFUZZ)
cp examples/*.mtail workdir/corpus
$(GOFUZZ) -bin=vm-fuzz.zip -workdir=workdir

clang-fuzzer: | $(GOFUZZBUILD)
GO111MODULE=off $(GOFUZZBUILD) -libfuzzer -o fuzzer.a github.com/google/mtail/internal/vm
clang-9 -fsanitize=fuzzer fuzzer.a -o clang-fuzzer

###
## dependency section
#
Expand Down

0 comments on commit e927274

Please sign in to comment.