[Fuzzing] Bound RunAfter duration in fuzzing event engine (#33128)

Bounds duration to 1 year. Fixes b/258949216
pull/33137/head
Vignesh Babu 2 years ago committed by GitHub
parent c2e1ea928d
commit 915d7c4a70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      test/core/end2end/fuzzers/api_fuzzer_corpus/testcase-5703224922079232
  2. 7
      test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.cc

@ -0,0 +1,15 @@
actions {
create_channel {
target: "unix:,:,2147483653,p,,,::, H?:::c23http8:::::;::::::"
channel_args {
key: "grpc.min_reconnect_backoff_ms"
i: 720575938231795711
}
channel_actions {
wait_ms: 106
}
}
}
actions {
check_connectivity: true
}

@ -40,11 +40,15 @@
extern gpr_timespec (*gpr_now_impl)(gpr_clock_type clock_type);
using namespace std::chrono_literals;
namespace grpc_event_engine {
namespace experimental {
namespace {
constexpr EventEngine::Duration kOneYear = 8760h;
// Inside the fuzzing event engine we consider everything is bound to a single
// loopback device. It cannot reach any other devices, and shares all ports
// between ipv4 and ipv6.
@ -466,7 +470,8 @@ EventEngine::TaskHandle FuzzingEventEngine::RunAfter(Duration when,
EventEngine::TaskHandle FuzzingEventEngine::RunAfter(
Duration when, absl::AnyInvocable<void()> closure) {
grpc_core::MutexLock lock(&*mu_);
return RunAfterLocked(when, std::move(closure));
// (b/258949216): Cap it to one year to avoid integer overflow errors.
return RunAfterLocked(std::min(when, kOneYear), std::move(closure));
}
EventEngine::TaskHandle FuzzingEventEngine::RunAfterLocked(

Loading…
Cancel
Save