thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Isuru Haththotuwa <>
Subject Thrift C++ Client Crashing Through TSSLSocket::close() in a SIGPIPE Signal
Date Mon, 04 Feb 2013 08:16:33 GMT
Hi all,

I have a C++ client which uses thrift to publish data to a remote server.
When the remote server shut down, I catch an exception to see if I can
re-connect to it periodically. However, in deallocating memory before
re-initializing a client again, the client code always crashes. I debugged
the issue and got the following stack trace:

(gdb) backtrace
#0  0x00007ffff713891d in write () at ../sysdeps/unix/syscall-template.S:82
#1  0x00007ffff68e4c95 in ?? () from
#2  0x00007ffff68e2ae7 in BIO_write () from
#3  0x00007ffff6bf9a50 in ?? () from /lib/x86_64-linux-gnu/
#4  0x00007ffff6bfb483 in ?? () from /lib/x86_64-linux-gnu/
#5  0x00007ffff6bf7b62 in ?? () from /lib/x86_64-linux-gnu/
*#6  0x00007ffff7ba632a in apache::thrift::transport::TSSLSocket::close
(this=0x67cc30) at src/transport/TSSLSocket.cpp:145
#7  0x00007ffff7ba647c in
apache::thrift::transport::TSSLSocket::~TSSLSocket (this=0x67cc30,
__in_chrg=<optimized out>) at src/transport/TSSLSocket.cpp:100
#8  0x00007ffff7ba6559 in
apache::thrift::transport::TSSLSocket::~TSSLSocket (this=0x67cc30,
__in_chrg=<optimized out>) at src/transport/TSSLSocket.cpp:101*
#9  0x00007ffff7bace0a in release (this=0x6825c0) at
#10 ~shared_count (this=0x682190, __in_chrg=<optimized out>) at
#11 ~shared_ptr (this=0x682188, __in_chrg=<optimized out>) at
#12 ~TBufferedTransport (this=0x682160, __in_chrg=<optimized out>) at
#13 apache::thrift::transport::TBufferedTransport::~TBufferedTransport
(this=0x682160, __in_chrg=<optimized out>) at
#14 0x000000000042d487 in
(x=0x682160) at /usr/include/boost/checked_delete.hpp:34
#15 0x000000000042e1e4 in
    at /usr/include/boost/smart_ptr/detail/sp_counted_impl.hpp:78

Please note that I have only added the relevant part of the stack trace. I
have attached the complete one.

In analyzing what is happening here, what I could grasp is that after the
connection to the server is terminated, if socket::close method gets called
the application crashes. Is this the expected behavior? Since this is
happening implicitly because of the memory cleanup, how to handle this

Thanks and Regards,

  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message