Merge pull request #1192 from rouault/poc_fixes
[openjpeg.git] / tests / fuzzers / README.TXT
1 This directory contain fuzzer main functions and scripts for the
2 Google OSS Fuzz project: https://github.com/google/oss-fuzz/
3
4 The main build scripts are in:
5 https://github.com/google/oss-fuzz/tree/master/projects/openjpeg
6 and call scripts in this directory.
7
8 The list of issues is in:
9 https://bugs.chromium.org/p/oss-fuzz/issues/list?q=openjpeg
10
11
12 - Simulate the build of (dummy) fuzzers like OSS Fuzz does:
13
14    Preliminary steps:
15     $ cd ${ROOT_OF_OPENJPEG}
16     $ git clone --depth 1 https://github.com/uclouvain/openjpeg-data data
17     $ mkdir build
18     $ cd build
19     $ cmake ..
20     $ make
21     $ cd ..
22
23    Actual building of fuzzer and seed corpus:
24     $ cd tests/fuzzers
25     $ make
26
27   They are created in /tmp/*_fuzzer as well as with the
28   /tmp/*_fuzzer_seed_corpus.zip files
29
30   Run one:
31     $ /tmp/opj_decompress_fuzzer a_file_name
32
33 - Run locally OSS Fuzz:
34     $ git clone https://github.com/google/oss-fuzz.git
35     $ cd oss-fuzz
36     $ python infra/helper.py build_image openjpeg
37
38   Build fuzzers with the address sanitizer (could use undefined, etc...)
39     $ python infra/helper.py build_fuzzers --sanitizer address openjpeg
40
41   Test a particular fuzzer (replace opj_decompress_fuzzer by other fuzzers
42   like the ones generated in /tmp by "make dummyfuzzers")
43     $ python infra/helper.py run_fuzzer openjpeg opj_decompress_fuzzer
44
45
46 How to deal with issues reported in https://bugs.chromium.org/p/oss-fuzz/issues/list?q=openjpeg ?
47
48     1. Leave a comment in (chromium database) bug entry to indicate that you work on it
49     2. Work
50     3. Commit a bug fix with log including "Credit to OSS-Fuzz" and a link to the bugs.chromium.org ticket
51     4. Add in the bugs.chromium.org ticket a link to the github commit implementing the fix.
52     5. Check chromium closed the bug (after one or two days typically)