1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-06-16 07:07:13 +02:00
Files
.github
bin
module
vendor
CPR
ConcurrentQueue
Fmt
doc
include
src
support
test
add-subdirectory-test
compile-error-test
cuda-test
find-package-test
fuzzing
CMakeLists.txt
README.md
build.sh
chrono-duration.cc
float.cc
fuzzer-common.h
main.cc
named-arg.cc
one-arg.cc
two-args.cc
gtest
static-export-test
CMakeLists.txt
args-test.cc
assert-test.cc
chrono-test.cc
color-test.cc
compile-test.cc
core-test.cc
enforce-checks-test.cc
format
format-impl-test.cc
format-test.cc
gtest-extra-test.cc
gtest-extra.cc
gtest-extra.h
header-only-test.cc
mock-allocator.h
module-test.cc
os-test.cc
ostream-test.cc
posix-mock-test.cc
posix-mock.h
printf-test.cc
ranges-test.cc
scan-test.cc
scan.h
std-format-test.cc
test-assert.h
test-main.cc
unicode-test.cc
util.cc
util.h
xchar-test.cc
CMakeLists.txt
CONTRIBUTING.md
ChangeLog.rst
LICENSE.rst
README.rst
JSMN
MaxmindDB
POCO
PUGIXML
SimpleIni
Squirrel
TinyDir
ZMQ
CMakeLists.txt
.gitignore
.gitmodules
CMakeLists.txt
LICENSE
README.md
SqMod/vendor/Fmt/test/fuzzing/README.md
2021-07-03 14:08:25 +03:00

789 B

Running the fuzzers locally

There is a helper script to build the fuzzers, which has only been tested on Debian and Ubuntu linux so far. There should be no problems fuzzing on Windows (using clang>=8) or on Mac, but the script will probably not work out of the box.

Something along

mkdir build
cd build
export CXX=clang++
export CXXFLAGS="-fsanitize=fuzzer-no-link -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION= -g"
cmake .. -DFMT_SAFE_DURATION_CAST=On -DFMT_FUZZ=On -DFMT_FUZZ_LINKMAIN=Off -DFMT_FUZZ_LDFLAGS="-fsanitize=fuzzer"
cmake --build .

should work to build the fuzzers for all platforms which clang supports.

Execute a fuzzer with for instance

cd build
export UBSAN_OPTIONS=halt_on_error=1
mkdir out_chrono
bin/fuzzer_chrono_duration out_chrono