Channel stack builder name needs to be static (#28711)

* Channel stack builder name needs to be static for stream refcount tracing

* Add test
pull/28716/head
Craig Tiller 3 years ago committed by GitHub
parent a5be505327
commit d02a68016e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/core/lib/channel/channel_stack_builder.cc
  2. 4
      src/core/lib/channel/channel_stack_builder.h
  3. 106
      test/core/end2end/fuzzers/api_fuzzer_corpus/clusterfuzz-testcase-minimized-api_fuzzer-5180720131997696

@ -83,8 +83,7 @@ grpc_error_handle ChannelStackBuilder::Build(size_t prefix_bytes,
// and initialize it
grpc_error_handle error = grpc_channel_stack_init(
initial_refs, destroy, destroy_arg == nullptr ? *result : destroy_arg,
filters.data(), filters.size(), args_, transport_, name_.c_str(),
channel_stack);
filters.data(), filters.size(), args_, transport_, name_, channel_stack);
if (error != GRPC_ERROR_NONE) {
grpc_channel_stack_destroy(channel_stack);

@ -43,7 +43,7 @@ class ChannelStackBuilder {
};
// Initialize with a name.
explicit ChannelStackBuilder(std::string name) : name_(std::move(name)) {}
explicit ChannelStackBuilder(const char* name) : name_(name) {}
~ChannelStackBuilder();
@ -91,7 +91,7 @@ class ChannelStackBuilder {
static std::string unknown_target() { return "unknown"; }
// The name of the stack
const std::string name_;
const char* const name_;
// The target
std::string target_{unknown_target()};
// The transport

@ -0,0 +1,106 @@
actions {
create_channel {
target: "unix:"
channel_actions {
add_n_bytes_writable: 150
wait_ms: 150
}
}
}
actions {
check_connectivity: true
}
actions {
create_server {
channel_args {
key: "grpc.http2.max_ping_strikes"
}
}
}
actions {
request_call {
}
}
actions {
advance_time: 1886680168
}
actions {
watch_connectivity: 1886680167
}
actions {
advance_time: 1886680168
}
actions {
ping {
}
}
actions {
advance_time: 4194238464
}
actions {
shutdown_server {
}
}
actions {
advance_time: 1543528704
}
actions {
advance_time: 4194238464
}
actions {
get_target {
}
}
actions {
advance_time: 1886680168
}
actions {
advance_time: 745829480
}
actions {
enable_tracer: "all"
}
actions {
request_call {
}
}
actions {
shutdown_server {
}
}
actions {
advance_time: 1886680168
}
actions {
advance_time: 1886680167
}
actions {
advance_time: 1886680168
}
actions {
advance_time: 1543528704
}
actions {
ping {
}
}
actions {
advance_time: 4194238464
}
actions {
advance_time: 4194238464
}
actions {
advance_time: 4194238464
}
actions {
advance_time: 4194238464
}
actions {
}
actions {
destroy_call {
}
}
actions {
}
Loading…
Cancel
Save