]> git.proxmox.com Git - ceph.git/blame - ceph/src/fmt/test/fuzzing/README.md
bump version to 19.2.0-pve1
[ceph.git] / ceph / src / fmt / test / fuzzing / README.md
CommitLineData
20effc67 1# Running the fuzzers locally
f67539c2
TL
2
3There is a [helper script](build.sh) to build the fuzzers, which has only been
4tested on Debian and Ubuntu linux so far. There should be no problems fuzzing on
5Windows (using clang>=8) or on Mac, but the script will probably not work out of
6the box.
7
8Something along
9```sh
10mkdir build
11cd build
12export CXX=clang++
13export CXXFLAGS="-fsanitize=fuzzer-no-link -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION= -g"
20effc67 14cmake .. -DFMT_SAFE_DURATION_CAST=On -DFMT_FUZZ=On -DFMT_FUZZ_LINKMAIN=Off -DFMT_FUZZ_LDFLAGS="-fsanitize=fuzzer"
f67539c2
TL
15cmake --build .
16```
17should work to build the fuzzers for all platforms which clang supports.
18
19Execute a fuzzer with for instance
20```sh
21cd build
22export UBSAN_OPTIONS=halt_on_error=1
23mkdir out_chrono
20effc67 24bin/fuzzer_chrono_duration out_chrono
f67539c2 25```