Skip to content

Commit

Permalink
access_log_manager_ member is being destroyed before admin_ causing M…
Browse files Browse the repository at this point in the history
…emorySanitizer: use-of-uninitialized-value issue. (#20913)

Signed-off-by: Yanjun Xiang <[email protected]>
  • Loading branch information
yanjunxiang-google authored Apr 21, 2022
1 parent c90728a commit 535ef2f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions source/server/server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ InstanceImpl::InstanceImpl(
process_context ? ProcessContextOptRef(std::ref(*process_context)) : absl::nullopt,
watermark_factory)),
dispatcher_(api_->allocateDispatcher("main_thread")),
access_log_manager_(options.fileFlushIntervalMsec(), *api_, *dispatcher_, access_log_lock,
store),
singleton_manager_(new Singleton::ManagerImpl(api_->threadFactory())),
handler_(new ConnectionHandlerImpl(*dispatcher_, absl::nullopt)),
listener_component_factory_(*this), worker_factory_(thread_local_, *api_, hooks),
access_log_manager_(options.fileFlushIntervalMsec(), *api_, *dispatcher_, access_log_lock,
store),
terminated_(false),
mutex_tracer_(options.mutexTracingEnabled() ? &Envoy::MutexTracerImpl::getOrCreateTracer()
: nullptr),
Expand Down
2 changes: 1 addition & 1 deletion source/server/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ class InstanceImpl final : Logger::Loggable<Logger::Id::main>,
envoy::config::bootstrap::v3::Bootstrap bootstrap_;
Api::ApiPtr api_;
Event::DispatcherPtr dispatcher_;
AccessLog::AccessLogManagerImpl access_log_manager_;
std::unique_ptr<AdminImpl> admin_;
Singleton::ManagerPtr singleton_manager_;
Network::ConnectionHandlerPtr handler_;
Expand All @@ -369,7 +370,6 @@ class InstanceImpl final : Logger::Loggable<Logger::Id::main>,
Network::DnsResolverSharedPtr dns_resolver_;
Event::TimerPtr stat_flush_timer_;
DrainManagerPtr drain_manager_;
AccessLog::AccessLogManagerImpl access_log_manager_;
std::unique_ptr<Upstream::ClusterManagerFactory> cluster_manager_factory_;
std::unique_ptr<Server::GuardDog> main_thread_guard_dog_;
std::unique_ptr<Server::GuardDog> worker_guard_dog_;
Expand Down

0 comments on commit 535ef2f

Please sign in to comment.