提交 86f353f3 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

fuzzer: Don't forze `fuzzer/new-corpus` as first directory because it makes it…

fuzzer: Don't forze `fuzzer/new-corpus` as first directory because it makes it impossible to pass a crash report file as single argument.
上级 ddeb66bc
...@@ -61,10 +61,14 @@ Executes the `worker/out/mediasoup-worker-fuzzer` binary. ...@@ -61,10 +61,14 @@ Executes the `worker/out/mediasoup-worker-fuzzer` binary.
* Set `FUZZER_CORPUS_DIRS` environment variable to set Fuzzer corpus directories. * Set `FUZZER_CORPUS_DIRS` environment variable to set Fuzzer corpus directories.
* Set `LSAN_OPTIONS` environment variable for LSAN options. * Set `LSAN_OPTIONS` environment variable for LSAN options.
Regardless value of `FUZZER_CORPUS_DIRS`, the first corpus directory will always be `./worker/fuzzer/new-corpus` so new generated test inputs will be written there, and crash reports will be written in the `worker/fuzzer/reports` directory (hardcoded `-artifact_prefix=./fuzzer/reports/` fuzzer option). It's recommended to set `fuzzer/new-corpus` as first entry in `FUZZER_CORPUS_DIRS` so generated inputs are written there.
Crash reports will be written in the `worker/fuzzer/reports` directory (hardcoded `-artifact_prefix=./fuzzer/reports/` fuzzer option).
Example:
```bash ```bash
$ FUZZER_OPTIONS="-max_len=1800" FUZZER_CORPUS_DIRS="fuzzer/corpora/rtp-corpus" make fuzzer-run $ FUZZER_OPTIONS="-max_len=1800" FUZZER_CORPUS_DIRS="fuzzer/new-corpus fuzzer/corpora/rtp-corpus" make fuzzer-run
``` ```
...@@ -86,12 +90,12 @@ Runs a container of the Docker image created with `fuzzer-docker-build` and exec ...@@ -86,12 +90,12 @@ Runs a container of the Docker image created with `fuzzer-docker-build` and exec
Some environment variables than `fuzzer-run` are supported (with same constraints). However: Some environment variables than `fuzzer-run` are supported (with same constraints). However:
* `FUZZER_CORPUS_DIRS` must be relative to the `worker` directory. * `FUZZER_CORPUS_DIRS` must be relative to the `worker`. If we want to write generated test inputs in `worker/fuzzer/new-corpus` folder, `fuzzer/new-corpus` must be the first entry in `FUZZER_CORPUS_DIRS`.
Example: Example:
```bash ```bash
$ FUZZER_OPTIONS="-max_len=1800" FUZZER_CORPUS_DIRS="fuzzer/corpora/stun-corpus fuzzer/corpora/rtp-corpus fuzzer/corpora/rtcp-corpus" make fuzzer-docker-run $ FUZZER_OPTIONS="-max_len=1800" FUZZER_CORPUS_DIRS="fuzzer/new-corpus fuzzer/corpora/stun-corpus fuzzer/corpora/rtp-corpus fuzzer/corpora/rtcp-corpus" make fuzzer-docker-run
``` ```
......
...@@ -44,5 +44,4 @@ CMD \ ...@@ -44,5 +44,4 @@ CMD \
&& cd /mediasoup/worker \ && cd /mediasoup/worker \
&& ./out/Release/mediasoup-worker-fuzzer \ && ./out/Release/mediasoup-worker-fuzzer \
${FUZZER_OPTIONS} -artifact_prefix=/reports/ \ ${FUZZER_OPTIONS} -artifact_prefix=/reports/ \
/new-corpus \
${FUZZER_CORPUS_DIRS} ${FUZZER_CORPUS_DIRS}
...@@ -47,7 +47,6 @@ fuzzer: ...@@ -47,7 +47,6 @@ fuzzer:
fuzzer-run: fuzzer-run:
./out/Release/mediasoup-worker-fuzzer \ ./out/Release/mediasoup-worker-fuzzer \
${FUZZER_OPTIONS} -artifact_prefix=./fuzzer/reports/ \ ${FUZZER_OPTIONS} -artifact_prefix=./fuzzer/reports/ \
./fuzzer/new-corpus \
${FUZZER_CORPUS_DIRS} ${FUZZER_CORPUS_DIRS}
# Temporal: Just for making sure that fuzzer/fuzzer.cpp compiles in OSX # Temporal: Just for making sure that fuzzer/fuzzer.cpp compiles in OSX
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论