Boost logo

Boost :

Subject: [boost] async_read SEGFAULT
From: hh h (jupiter.hce_at_[hidden])
Date: 2019-01-05 10:34:32


I use one io_service in one process to run two servers A and B each
has its own port, own context and SSL configuration to accept inbound
connections. Although both A and B have
boost::asio::deadline_timer, but I think there is only one thread is running:

(gdb) info threads
  Id Target Id Frame
* 1 Thread 0x7ffff7fe0bc0 (LWP 31204) "ssl_connection"
0x00007ffff4a690a3 in __epoll_wait_nocancel () at
../sysdeps/unix/syscall-template.S:84

The problem I got:

- If I started only one server A, it worked just fine for both
async_read and async_write.

- If I started both servers A and B, even B was in idle, server A
could sometime be crashed after receiving and responding just one
message, then crashed at next async_read in the first second, it was
more stable if it did not call async_write.

SEGFAULT: Fault address=0x55b3700d00cf,

#4 0x000055555557f98a in
boost::asio::detail::task_io_service_operation::complete
(this=0x55555584adc0, owner=..., ec=..., bytes_transferred=0)
    at /usr/include/boost/asio/detail/task_io_service_operation.hpp:38
#5 0x0000555555581f82 in boost::asio::detail::task_io_service::do_run_one (
    this=0x555555814710, lock=..., this_thread=..., ec=...)
    at /usr/include/boost/asio/detail/impl/task_io_service.ipp:372
#6 0x0000555555581ab4 in boost::asio::detail::task_io_service::run (
    this=0x555555814710, ec=...)
    at /usr/include/boost/asio/detail/impl/task_io_service.ipp:149
#7 0x000055555558221f in boost::asio::io_service::run (this=0x7fffffffe150)
    at /usr/include/boost/asio/impl/io_service.ipp:59

It seems that async_write and async_read messed up, but that problem
was intermittent, especially when the server A passed first second, it
could be running for hours for doing consequent many async_read and
async_write simultaneously. It was only one thread, what could cause
that problem?

Thank you.


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