premiere-libtorrent/fuzzers
AllSeeingEyeTolledEweSew cbb4f0277e Make tests and tools python3 compatible. 2020-05-13 00:17:37 +02:00
..
src provide better names for alert_category_t constants 2020-04-04 15:06:02 -07:00
tools Make tests and tools python3 compatible. 2020-05-13 00:17:37 +02:00
Jamfile restore the sanitize=on build feature for fuzzers 2020-04-13 20:53:22 +02:00
LICENSE add fuzzers to the main repository 2019-04-19 08:26:54 +02:00
README.rst add fuzzers to the main repository 2019-04-19 08:26:54 +02:00
main.cpp add fuzzers to the main repository 2019-04-19 08:26:54 +02:00
minimize.sh explicitly use integer division in python script. make minimize.sh script fail on errors, instead of silently ignoring them 2019-08-23 17:31:13 +02:00
run.sh add script to minimize corpus 2019-04-26 23:42:28 +02:00

README.rst

libtorrent fuzzing
==================

Fuzzing of various libtorrent APIs (both internal and external),
inspired by Kostya Serebryany's `cppcon 2017 presentation`_

This project requires:

.. _`cppcon 2017 presentation`: https://www.youtube.com/watch?v=k-Cv8Q3zWNQ&index=36&list=PLHTh1InhhwT6bwIpRk0ZbCA0N2p1taxd6

clang
.....

A very recent version of clang that supports libFuzzer.
clang-5.0 may not be recent enough, you may have to build head from source.

boost-build
...........

Also known as ``b2``. To configure boost build with your fresh clang build,
create a ``~/user-config.jam`` with something like this in it (example for macOS)::

	using darwin : 6.0 : ~/Documents/dev/clang/build/bin/clang++ ;

Or on Linux::

	using clang ;

corpus
......

The corpus is the set of inputs that has been built by libFuzzer. It's the seed
for testing more mutations. The corpus is not checked into the repository,
before running the fuzzer it is advised to download and unzip the corpus
associated with the latest release on github.

	https://github.com/arvidn/libtorrent/releases/download/libtorrent_1_2_0/corpus.zip

Uzip the corpus in the fuzzers directory::

	unzip corpus.zip

building
........

To build the fuzzers::

	b2 clang stage -j4

The fuzzers binaries are placed in a directory called `fuzzers`.

running
.......

To run the fuzzers, there's a convenience `run.sh` script that launches all
fuzzers in parallel. By default, each fuzzer runs for 48 hours. This can be
adjusted in the `run.sh` script.

contribute
..........

Please consider contributing back any updated corpuses (amended by more seed
inputs) or fuzzers for more APIs in libtorrent.