Debian Codegraph @

contrib/fuzz/README.rst

raw
1 How to add fuzzers (partially cribbed from oss-fuzz[0]):
2
3 1) git clone https://github.com/google/oss-fuzz
4 2) cd oss-fuzz
5 3) python infra/helper.py build_image mercurial
6 4) docker run --cap-add=SYS_PTRACE -it -v $HG_REPO_PATH:/hg-new \
7 gcr.io/oss-fuzz/mercurial bash
8 5) cd /src
9 6) rm -r mercurial
10 7) ln -s /hg-new mercurial
11 8) cd mercurial
12 9) compile
13 10) ls $OUT
14
15 Step 9 is literally running the command "compile", which is part of
16 the docker container. Once you have that working, you can build the
17 fuzzers like this (in the oss-fuzz repo):
18
19 python infra/helper.py build_fuzzers --sanitizer address mercurial $HG_REPO_PATH
20
21 (you can also say "memory", "undefined" or "coverage" for
22 sanitizer). Then run the built fuzzers like this:
23
24 python infra/helper.py run_fuzzer mercurial -- $FUZZER
25
26 0: https://github.com/google/oss-fuzz/blob/master/docs/new_project_guide.md