[end2end] Fix fuzzer found memory leak (#33264)

(this is a bug in the core e2e fuzzer infrastructure)
pull/33277/head
Craig Tiller 2 years ago committed by GitHub
parent a351817813
commit ea58add8bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      test/core/end2end/end2end_test_corpus/clusterfuzz-testcase-minimized-core_end2end_test_fuzzer-4592933739233280
  2. 15
      test/core/end2end/end2end_tests.cc
  3. 2
      test/core/event_engine/event_engine_test_utils.cc
  4. 4
      test/core/event_engine/event_engine_test_utils.h

@ -0,0 +1,7 @@
test_id: 3405774848
event_engine_actions {
run_delay: 0
run_delay: 6399
run_delay: 4294967296
run_delay: 4294967296
}

@ -84,6 +84,13 @@ void CoreEnd2endTest::SetUp() {
void CoreEnd2endTest::TearDown() {
const bool do_shutdown = fixture_ != nullptr;
std::shared_ptr<grpc_event_engine::experimental::EventEngine> ee;
// TODO(hork): locate the windows leak so we can enable end2end experiments.
#ifndef GPR_WINDOWS
if (grpc_is_initialized()) {
ee = grpc_event_engine::experimental::GetDefaultEventEngine();
}
#endif
ShutdownAndDestroyClient();
ShutdownAndDestroyServer();
cq_verifier_.reset();
@ -98,15 +105,11 @@ void CoreEnd2endTest::TearDown() {
cq_ = nullptr;
}
fixture_.reset();
// TODO(hork): locate the windows leak so we can enable end2end experiments.
#ifndef GPR_WINDOWS
// Creating an EventEngine requires gRPC initialization, which the NoOp test
// does not do. Skip the EventEngine check if unnecessary.
if (grpc_is_initialized()) {
quiesce_event_engine_(
grpc_event_engine::experimental::GetDefaultEventEngine());
if (ee != nullptr) {
quiesce_event_engine_(std::move(ee));
}
#endif
if (do_shutdown) {
grpc_shutdown_blocking();
// This will wait until gRPC shutdown has actually happened to make sure

@ -75,7 +75,7 @@ std::string GetNextSendMessage() {
return tmp_s;
}
void WaitForSingleOwner(std::shared_ptr<EventEngine>&& engine) {
void WaitForSingleOwner(std::shared_ptr<EventEngine> engine) {
while (engine.use_count() > 1) {
GRPC_LOG_EVERY_N_SEC(2, GPR_INFO, "engine.use_count() = %ld",
engine.use_count());

@ -47,7 +47,9 @@ std::string GetNextSendMessage();
// Waits until the use_count of the EventEngine shared_ptr has reached 1
// and returns.
void WaitForSingleOwner(std::shared_ptr<EventEngine>&& engine);
// Callers must give up their ref, or this method will block forever.
// Usage: WaitForSingleOwner(std::move(engine))
void WaitForSingleOwner(std::shared_ptr<EventEngine> engine);
// A helper method to exchange data between two endpoints. It is assumed
// that both endpoints are connected. The data (specified as a string) is

Loading…
Cancel
Save