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@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
::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_lockboost::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&) ()