Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

async_tcp_client: remove callbacks if connection was not closed #35410

Merged
merged 8 commits into from
Aug 1, 2024

Merge branch 'envoyproxy:main' into fix_async_tcp_client

26e2439
Select commit
Loading
Failed to load commit list.
Merged

async_tcp_client: remove callbacks if connection was not closed #35410

Merge branch 'envoyproxy:main' into fix_async_tcp_client
26e2439
Select commit
Loading
Failed to load commit list.
CI (Envoy) / Mobile/CC succeeded Jul 31, 2024 in 2m 40s

Mobile/CC (success)

Check has finished

Details

Check run finished (success ✔️)

The check run can be viewed here:

Mobile/CC (pr/35410/main@26e2439)

Check started by

Request (pr/35410/main@26e2439)

ohadvano @ohadvano 26e2439 #35410 merge main@b0cc284

async_tcp_client: remove callbacks if connection was not closed

Commit Message: when the AsyncTcpClient is being destroyed but it also has an active client connection, there's a crash since during the instance destruction, the ClientConnection object would also be destroyed, causing raiseEvent to be called back to AsyncTcpClient while it is being destroyed
Additional Description: Caught with the following stack trace:

Caught Segmentation fault, suspect faulting address 0x0
Backtrace (use tools/stack_decode.py to get line numbers):
Envoy version: ee8c765a07037033766ea556c032120b497152b3/1.27.0/Clean/RELEASE/BoringSSL
#0: __restore_rt [0x7d80ab903420]
#1: Envoy::Extensions::AccessLoggers::Fluentd::FluentdAccessLoggerImpl::onEvent() [0x58313528746b]
#2: Envoy::Tcp::AsyncTcpClientImpl::onEvent() [0x5831359da00a]
#3: Envoy::Network::ConnectionImplBase::raiseConnectionEvent() [0x583135f0521d]
#4: Envoy::Network::ConnectionImpl::raiseEvent() [0x583135e9fed9]
#5: Envoy::Network::ConnectionImpl::closeSocket() [0x583135e9f90c]
#6: Envoy::Network::ConnectionImpl::close() [0x583135e9e54c]
#7: Envoy::Network::ConnectionImpl::~ConnectionImpl() [0x583135e9de5c]
#8: Envoy::Network::ClientConnectionImpl::~ClientConnectionImpl() [0x5831355fd25e]
#9: Envoy::Tcp::AsyncTcpClientImpl::~AsyncTcpClientImpl() [0x5831359da247]
#10: Envoy::Extensions::AccessLoggers::Fluentd::FluentdAccessLoggerImpl::~FluentdAccessLoggerImpl() [0x583135289350]
#11: Envoy::Extensions::AccessLoggers::Fluentd::FluentdAccessLog::ThreadLocalLogger::~ThreadLocalLogger() [0x58313528adbf]
#12: Envoy::ThreadLocal::InstanceImpl::shutdownThread() [0x58313560373a]
#13: Envoy::Server::WorkerImpl::threadRoutine() [0x583135630c0a]
#14: Envoy::Thread::ThreadImplPosix::ThreadImplPosix()::{lambda()#1}::__invoke() [0x5831364e88d5]
#15: start_thread [0x7d80ab8f7609]

Risk Level: low
Testing: unit tests
Docs Changes: none
Release Notes: none
Platform Specific Features: none

Environment

Request variables

Key Value
ref ed09879
sha 26e2439
pr 35410
base-sha b0cc284
actor ohadvano @ohadvano
message async_tcp_client: remove callbacks if connection was not closed...
started 1722417628.832134
target-branch main
trusted false
Build image

Container image/s (as used in this CI run)

Key Value
default envoyproxy/envoy-build-ubuntu:f94a38f62220a2b017878b790b6ea98a0f6c5f9c
mobile envoyproxy/envoy-build-ubuntu:mobile-f94a38f62220a2b017878b790b6ea98a0f6c5f9c
Version

Envoy version (as used in this CI run)

Key Value
major 1
minor 32
patch 0
dev true