diff options
author | 2016-04-04 22:33:18 -0700 | |
---|---|---|
committer | 2016-04-04 22:33:18 -0700 | |
commit | 26d3fd2f1584c5360ab3828a668a70460be57fe2 (patch) | |
tree | 4b347394bc3328fda0967f68c8fa406800f6fb97 | |
parent | 76210ed42323e06970b0231ea4e197f8f1c3c9a3 (diff) | |
parent | e9aefba81e6b246c88e2197b648e3da953604be6 (diff) |
Merge branch 'e2efuzz' of github.com:ctiller/grpc into e2efuzz
-rw-r--r-- | src/core/lib/surface/server.c | 8 | ||||
-rw-r--r-- | src/core/lib/transport/metadata.c | 6 | ||||
-rw-r--r-- | test/core/end2end/fuzzers/server_fuzzer.c | 4 | ||||
-rw-r--r-- | test/core/end2end/fuzzers/server_fuzzer_corpus/2b14c6e618ec95754ea7e24fe6bc5a3a97df6897 | bin | 0 -> 60 bytes | |||
-rw-r--r-- | test/core/end2end/fuzzers/server_fuzzer_corpus/c56fada76f5c198232201a608072a1a63e3d3785 | bin | 0 -> 60 bytes | |||
-rw-r--r-- | test/core/end2end/tests/filter_causes_close.c | 3 | ||||
-rw-r--r-- | tools/run_tests/tests.json | 44 |
7 files changed, 60 insertions, 5 deletions
diff --git a/src/core/lib/surface/server.c b/src/core/lib/surface/server.c index 37cc2bd101..ad8ee8c7a9 100644 --- a/src/core/lib/surface/server.c +++ b/src/core/lib/surface/server.c @@ -685,10 +685,14 @@ static grpc_mdelem *server_filter(void *user_data, grpc_mdelem *md) { grpc_call_element *elem = user_data; call_data *calld = elem->call_data; if (md->key == GRPC_MDSTR_PATH) { - calld->path = GRPC_MDSTR_REF(md->value); + if (calld->path == NULL) { + calld->path = GRPC_MDSTR_REF(md->value); + } return NULL; } else if (md->key == GRPC_MDSTR_AUTHORITY) { - calld->host = GRPC_MDSTR_REF(md->value); + if (calld->host == NULL) { + calld->host = GRPC_MDSTR_REF(md->value); + } return NULL; } return md; diff --git a/src/core/lib/transport/metadata.c b/src/core/lib/transport/metadata.c index 2b1d32d55e..d037c61d72 100644 --- a/src/core/lib/transport/metadata.c +++ b/src/core/lib/transport/metadata.c @@ -242,6 +242,12 @@ void grpc_mdctx_global_shutdown(void) { if (shard->count != 0) { gpr_log(GPR_DEBUG, "WARNING: %d metadata strings were leaked", shard->count); + for (size_t j = 0; j < shard->capacity; j++) { + for (internal_string *s = shard->strs[j]; s; s = s->bucket_next) { + gpr_log(GPR_DEBUG, "LEAKED: %s", + grpc_mdstr_as_c_string((grpc_mdstr *)s)); + } + } if (grpc_iomgr_abort_on_leaks()) { abort(); } diff --git a/test/core/end2end/fuzzers/server_fuzzer.c b/test/core/end2end/fuzzers/server_fuzzer.c index 2d590a3e0f..393d33033b 100644 --- a/test/core/end2end/fuzzers/server_fuzzer.c +++ b/test/core/end2end/fuzzers/server_fuzzer.c @@ -37,6 +37,8 @@ #include "src/core/lib/surface/server.h" #include "test/core/util/mock_endpoint.h" +static const bool squelch = true; + static void discard_write(gpr_slice slice) {} static void *tag(int n) { return (void *)(uintptr_t)n; } @@ -46,7 +48,7 @@ static void dont_log(gpr_log_func_args *args) {} int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { grpc_test_only_set_metadata_hash_seed(0); - gpr_set_log_function(dont_log); + if (squelch) gpr_set_log_function(dont_log); grpc_init(); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/2b14c6e618ec95754ea7e24fe6bc5a3a97df6897 b/test/core/end2end/fuzzers/server_fuzzer_corpus/2b14c6e618ec95754ea7e24fe6bc5a3a97df6897 Binary files differnew file mode 100644 index 0000000000..3c79631396 --- /dev/null +++ b/test/core/end2end/fuzzers/server_fuzzer_corpus/2b14c6e618ec95754ea7e24fe6bc5a3a97df6897 diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/c56fada76f5c198232201a608072a1a63e3d3785 b/test/core/end2end/fuzzers/server_fuzzer_corpus/c56fada76f5c198232201a608072a1a63e3d3785 Binary files differnew file mode 100644 index 0000000000..f7092e5e02 --- /dev/null +++ b/test/core/end2end/fuzzers/server_fuzzer_corpus/c56fada76f5c198232201a608072a1a63e3d3785 diff --git a/test/core/end2end/tests/filter_causes_close.c b/test/core/end2end/tests/filter_causes_close.c index d4a9f6fac4..ca54167b20 100644 --- a/test/core/end2end/tests/filter_causes_close.c +++ b/test/core/end2end/tests/filter_causes_close.c @@ -200,8 +200,7 @@ static void test_request(grpc_end2end_test_config config) { typedef struct { grpc_closure *recv_im_ready; } call_data; -typedef struct { -} channel_data; +typedef struct { uint8_t unused; } channel_data; static void recv_im_ready(grpc_exec_ctx *exec_ctx, void *arg, bool success) { grpc_call_element *elem = arg; diff --git a/tools/run_tests/tests.json b/tools/run_tests/tests.json index 44041334f2..322d734509 100644 --- a/tools/run_tests/tests.json +++ b/tools/run_tests/tests.json @@ -39745,6 +39745,28 @@ }, { "args": [ + "test/core/end2end/fuzzers/server_fuzzer_corpus/2b14c6e618ec95754ea7e24fe6bc5a3a97df6897" + ], + "ci_platforms": [ + "linux", + "mac", + "windows", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "server_fuzzer_one_entry", + "platforms": [ + "linux", + "mac", + "windows", + "posix" + ] + }, + { + "args": [ "test/core/end2end/fuzzers/server_fuzzer_corpus/2b40aa21723c7e67e92e74a3083df008461d591c" ], "ci_platforms": [ @@ -43507,6 +43529,28 @@ }, { "args": [ + "test/core/end2end/fuzzers/server_fuzzer_corpus/c56fada76f5c198232201a608072a1a63e3d3785" + ], + "ci_platforms": [ + "linux", + "mac", + "windows", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "server_fuzzer_one_entry", + "platforms": [ + "linux", + "mac", + "windows", + "posix" + ] + }, + { + "args": [ "test/core/end2end/fuzzers/server_fuzzer_corpus/c66e84d1.bin" ], "ci_platforms": [ |