diff --git a/src/core/lib/surface/server.cc b/src/core/lib/surface/server.cc index 1279a0080bc..c14b7ba62b3 100644 --- a/src/core/lib/surface/server.cc +++ b/src/core/lib/surface/server.cc @@ -633,7 +633,7 @@ static void start_new_rpc(grpc_call_element* elem) { for (i = 0; i <= chand->registered_method_max_probes; i++) { rm = &chand->registered_methods[(hash + i) % chand->registered_method_slots]; - if (!rm) break; + if (rm->server_registered_method == nullptr) break; if (!rm->has_host) continue; if (!grpc_slice_eq(rm->host, calld->host)) continue; if (!grpc_slice_eq(rm->method, calld->path)) continue; @@ -651,7 +651,7 @@ static void start_new_rpc(grpc_call_element* elem) { for (i = 0; i <= chand->registered_method_max_probes; i++) { rm = &chand->registered_methods[(hash + i) % chand->registered_method_slots]; - if (!rm) break; + if (rm->server_registered_method == nullptr) break; if (rm->has_host) continue; if (!grpc_slice_eq(rm->method, calld->path)) continue; if ((rm->flags & GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST) && diff --git a/test/core/end2end/fuzzers/server_fuzzer.cc b/test/core/end2end/fuzzers/server_fuzzer.cc index 130b58f6292..031db87dc2e 100644 --- a/test/core/end2end/fuzzers/server_fuzzer.cc +++ b/test/core/end2end/fuzzers/server_fuzzer.cc @@ -57,9 +57,8 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { grpc_server* server = grpc_server_create(nullptr, nullptr); grpc_completion_queue* cq = grpc_completion_queue_create_for_next(nullptr); grpc_server_register_completion_queue(server, cq, nullptr); - // TODO(ctiller): add registered methods (one for POST, one for PUT) - // void *registered_method = - // grpc_server_register_method(server, "/reg", NULL, 0); + // TODO(ctiller): add more registered methods (one for POST, one for PUT) + grpc_server_register_method(server, "/reg", nullptr, {}, 0); grpc_server_start(server); grpc_transport* transport = grpc_create_chttp2_transport(nullptr, mock_endpoint, false); diff --git a/test/core/end2end/fuzzers/server_fuzzer_corpus/hope.bin b/test/core/end2end/fuzzers/server_fuzzer_corpus/hope.bin new file mode 100644 index 00000000000..46dd6219518 Binary files /dev/null and b/test/core/end2end/fuzzers/server_fuzzer_corpus/hope.bin differ diff --git a/tools/run_tests/generated/tests.json b/tools/run_tests/generated/tests.json index 28140a8e71a..1f9634e34e3 100644 --- a/tools/run_tests/generated/tests.json +++ b/tools/run_tests/generated/tests.json @@ -182346,6 +182346,29 @@ ], "uses_polling": false }, + { + "args": [ + "test/core/end2end/fuzzers/server_fuzzer_corpus/hope.bin" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 0.1, + "exclude_configs": [ + "tsan" + ], + "exclude_iomgrs": [ + "uv" + ], + "flaky": false, + "language": "c", + "name": "server_fuzzer_one_entry", + "platforms": [ + "mac", + "linux" + ], + "uses_polling": false + }, { "args": [ "test/core/end2end/fuzzers/server_fuzzer_corpus/slow-unit-0292270056246b7a4ccd2e7d0356665cef307ef2"