Skip to content

Commit

Permalink
Support tracing fuzzers
Browse files Browse the repository at this point in the history
  • Loading branch information
ctiller committed Mar 24, 2016
1 parent 0b8bf08 commit ae94594
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 5 deletions.
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,16 @@ LDXX_opt = $(DEFAULT_CXX)
CPPFLAGS_opt = -O2
DEFINES_opt = NDEBUG

VALID_CONFIG_asan-trace-cmp = 1
REQUIRE_CUSTOM_LIBRARIES_asan-trace-cmp = 1
CC_asan-trace-cmp = clang
CXX_asan-trace-cmp = clang++
LD_asan-trace-cmp = clang
LDXX_asan-trace-cmp = clang++
CPPFLAGS_asan-trace-cmp = -O0 -fsanitize-coverage=trace-cmp -fsanitize=address -fno-omit-frame-pointer -Wno-unused-command-line-argument -DGPR_NO_DIRECT_SYSCALLS
LDFLAGS_asan-trace-cmp = -fsanitize=address
DEFINES_asan-trace-cmp += GRPC_TEST_SLOWDOWN_BUILD_FACTOR=3

VALID_CONFIG_dbg = 1
CC_dbg = $(DEFAULT_CC)
CXX_dbg = $(DEFAULT_CXX)
Expand Down
13 changes: 13 additions & 0 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2846,6 +2846,19 @@ configs:
test_environ:
ASAN_OPTIONS: detect_leaks=0:color=always
timeout_multiplier: 3
asan-trace-cmp:
CC: clang
CPPFLAGS: -O0 -fsanitize-coverage=trace-cmp -fsanitize=address -fno-omit-frame-pointer
-Wno-unused-command-line-argument -DGPR_NO_DIRECT_SYSCALLS
CXX: clang++
LD: clang
LDFLAGS: -fsanitize=address
LDXX: clang++
compile_the_world: true
test_environ:
ASAN_OPTIONS: detect_leaks=1:color=always
LSAN_OPTIONS: suppressions=tools/lsan_suppressions.txt:report_objects=1
timeout_multiplier: 3
basicprof:
CPPFLAGS: -O2 -DGRPC_BASIC_PROFILER -DGRPC_TIMERS_RDTSC
DEFINES: NDEBUG
Expand Down
8 changes: 7 additions & 1 deletion templates/tools/fuzzer/runners.template
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,10 @@ template: |
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#

bins/$config/${selected.name} -max_total_time=3600 fuzzer_output ${' '.join(selected.corpus_dirs)}
flags="-max_total_time=3600"
if [ "$config" == "asan-trace-cmp" ]
then
flags="-use_traces=1 $flags"
fi

bins/$config/${selected.name} $flags fuzzer_output ${' '.join(selected.corpus_dirs)}
8 changes: 7 additions & 1 deletion tools/fuzzer/runners/hpack_parser_fuzzer_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,10 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#

bins/$config/hpack_parser_fuzzer_test -max_total_time=3600 fuzzer_output test/core/transport/chttp2/hpack_parser_corpus
flags="-max_total_time=3600"
if [ "$config" == "asan-trace-cmp" ]
then
flags="-use_traces=1 $flags"
fi

bins/$config/hpack_parser_fuzzer_test $flags fuzzer_output test/core/transport/chttp2/hpack_parser_corpus
8 changes: 7 additions & 1 deletion tools/fuzzer/runners/http_fuzzer_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,10 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#

bins/$config/http_fuzzer_test -max_total_time=3600 fuzzer_output test/core/http/corpus
flags="-max_total_time=3600"
if [ "$config" == "asan-trace-cmp" ]
then
flags="-use_traces=1 $flags"
fi

bins/$config/http_fuzzer_test $flags fuzzer_output test/core/http/corpus
8 changes: 7 additions & 1 deletion tools/fuzzer/runners/json_fuzzer_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,10 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#

bins/$config/json_fuzzer_test -max_total_time=3600 fuzzer_output test/core/json/corpus
flags="-max_total_time=3600"
if [ "$config" == "asan-trace-cmp" ]
then
flags="-use_traces=1 $flags"
fi

bins/$config/json_fuzzer_test $flags fuzzer_output test/core/json/corpus
8 changes: 7 additions & 1 deletion tools/fuzzer/runners/uri_fuzzer_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,10 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#

bins/$config/uri_fuzzer_test -max_total_time=3600 fuzzer_output test/core/client_config/uri_corpus
flags="-max_total_time=3600"
if [ "$config" == "asan-trace-cmp" ]
then
flags="-use_traces=1 $flags"
fi

bins/$config/uri_fuzzer_test $flags fuzzer_output test/core/client_config/uri_corpus
8 changes: 8 additions & 0 deletions tools/run_tests/configs.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
{
"config": "opt"
},
{
"config": "asan-trace-cmp",
"environ": {
"ASAN_OPTIONS": "detect_leaks=1:color=always",
"LSAN_OPTIONS": "suppressions=tools/lsan_suppressions.txt:report_objects=1"
},
"timeout_multiplier": 3
},
{
"config": "dbg"
},
Expand Down

0 comments on commit ae94594

Please sign in to comment.