Boost logo

Boost :

From: JH (jupiter.hce_at_[hidden])
Date: 2019-07-15 12:35:13


Hi,

I use boost TCP socket for months, it works well until I call a
termination of smart pointer which is running at
boost::asio::async_read. Could anyone explain what could be the cause
for the following errors?

void Comms::HandleReadBody(const boost::system::error_code &error,
const uint32_t length) {
................
boost::asio::async_read(this->mHandler->Socket(),
boost::asio::buffer(this->mHeader, sizeof(this->mHeader)), [=](const
boost::system::error_code &status, const uint32_t length)
{this->HandleReadHeader(status, length);});
...............
}

(gdb) run
2019-07-15 11:47:32.396184: Sanity check socket connection and
terminate it when it is inactive
.............
pure virtual method called
terminate called without an active exception
Program received signal SIGABRT, Aborted.
(gdb) backtrace
#0 __GI_raise (sig=sig_at_entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1 0x00007ffff7a24801 in __GI_abort () at abort.c:79
#2 0x00007ffff5565957 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3 0x00007ffff556bab6 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4 0x00007ffff556baf1 in std::terminate() ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5 0x00007ffff556c8bf in __cxa_pure_virtual ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6 HandleReadHeader(boost::system::error_code const&, unsigned int) ()
#7 0x00007ffff679a116 in
boost::asio::detail::read_op<boost::asio::ssl::stream<boost::asio::basic_stream_socket<boost::asio::ip::tcp,
boost::asio::stream_socket_service<boost::asio::ip::tcp> > >,
boost::asio::mutable_buffers_1, boost::asio::detail::transfer_all_t,
HandleReadBody(boost::system::error_code const&, unsigned
int)::{lambda(boost::system::error_code const&, unsigned
int)#1}>::operator()(boost::system::error_code const&, unsigned long,
int) ()
#8 0x00007ffff6799c20 in
boost::asio::ssl::detail::io_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp,
boost::asio::stream_socket_service<boost::asio::ip::tcp> >,
boost::asio::ssl::detail::read_op<boost::asio::mutable_buffers_1>,
boost::asio::detail::read_op<boost::asio::ssl::stream<boost::asio::basic_stream_socket<boost::asio::ip::tcp,
boost::asio::stream_socket_service<boost::asio::ip::tcp> > >,
boost::asio::mutable_buffers_1, boost::asio::detail::transfer_all_t,
HandleReadBody(boost::system::error_code const&, unsigned
int)::{lambda(boost::system::error_code c---Type <return> to continue,
or q <return> to quit---
onst&, unsigned int)#1}> >::operator()(boost::system::error_code,
unsigned long, int) ()
#9 0x00007ffff679b547 in
boost::asio::detail::reactive_socket_recv_op<boost::asio::mutable_buffers_1,
boost::asio::ssl::detail::io_op<boost::asio::basic_stream_socket<boost::asio::ip::tcp,
boost::asio::stream_socket_service<boost::asio::ip::tcp> >,
boost::asio::ssl::detail::read_op<boost::asio::mutable_buffers_1>,
boost::asio::detail::read_op<boost::asio::ssl::stream<boost::asio::basic_stream_socket<boost::asio::ip::tcp,
boost::asio::stream_socket_service<boost::asio::ip::tcp> > >,
boost::asio::mutable_buffers_1, boost::asio::detail::transfer_all_t,
HandleReadBody(boost::system::error_code const&, unsigned
int)::{lambda(boost::system::error_code const&, unsigned int)#1}> >
>::do_complete(boost::asio::detail::task_io_service*,
boost::asio::detail::task_io_service_operation*,
boost::system::error_code const&, unsigned long) ()
#10 0x000055555559f5c0 in
boost::asio::detail::task_io_service::do_run_one(boost::asio::detail::scoped_lock<boost::asio::detail::posix_mutex>&,
boost::asio::detail::task_io_service_thread_info&,
boost::system::error_code const&) ()
#11 0x000055555559f747 in
boost::asio::detail::task_io_service::run(boost::system::error_code&)
()


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk