[Boost-bugs] [Boost C++ Libraries] #12297: epoll_wait hang

Subject: [Boost-bugs] [Boost C++ Libraries] #12297: epoll_wait hang
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-06-23 10:15:07


#12297: epoll_wait hang
----------------------------------+----------------------------
 Reporter: baibin <406455861@…> | Owner: chris_kohlhoff
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: asio
  Version: Boost 1.53.0 | Severity: Problem
 Keywords: |
----------------------------------+----------------------------
 We use sofarpc(https://github.com/baidu/sofa-pbrpc ) which use boost asio
 as network lib.

 boost::asio::io_service io_ser;
 auto work = new boost::asio::io_service::work(io_ser);
 after I delete work, io_ser still in run function and never stop.
 so i print io_ser class member as below
 (gdb) p *(boost::asio::detail::task_io_service * const) 0x22738e0
 $26 =
 {<boost::asio::detail::service_base<boost::asio::detail::task_io_service>>
 = {<boost::asio::io_service::service> =
 {<boost::noncopyable_::noncopyable> = {<No data fields>},
       _vptr.service = 0xa24a90 <vtable for
 boost::asio::detail::task_io_service+16>, key_ = {type_info_ = 0xa245a0
 <typeinfo for
 boost::asio::detail::typeid_wrapper<boost::asio::detail::task_io_service>>,
         id_ = 0x0}, owner_ = @0x228f6d0, next_ = 0x0}, static id =
 {<boost::asio::io_service::id> = {<boost::noncopyable_::noncopyable> =
 {<No data fields>}, <No data fields>}, <No data fields>}},
   one_thread_ = false, mutex_ = {<boost::noncopyable_::noncopyable> = {<No
 data fields>}, mutex_ = {__data = {__lock = 0, __count = 0, __owner = 0,
 __nusers = 7, __kind = 0, __spins = 0, __list = {
           __prev = 0x0, __next = 0x0}}, __size = '\000' <repeats 12
 times>, "\a", '\000' <repeats 26 times>, __align = 0}}, task_ = 0x2266e10,
   task_operation_ = {<boost::asio::detail::task_io_service_operation> =
 {next_ = 0x0, func_ = 0x0, task_result_ = 0}, <No data fields>},
 task_interrupted_ = false, outstanding_work_ = {value_ = 3},
   op_queue_ = {<boost::noncopyable_::noncopyable> = {<No data fields>},
 front_ = 0x0, back_ = 0x0}, stopped_ = false, shutdown_ = false,
 first_idle_thread_ = 0x7f182991fce0}

 and I found one of the stack as belows
 Thread 6 (Thread 0x7f182a321700 (LWP 30142)):
 #0 0x00007f1833fb2163 in epoll_wait () from /lib64/libc.so.6
 #1 0x000000000061f888 in boost::asio::detail::epoll_reactor::run
 (this=0x2266e10, block=<optimized out>, ops=...) at
 /usr/local/include/boost/asio/detail/impl/epoll_reactor.ipp:392
 #2 0x0000000000624671 in boost::asio::detail::task_io_service::do_run_one
 (ec=..., this_thread=..., lock=..., this=0x22738e0) at
 /usr/local/include/boost/asio/detail/impl/task_io_service.ipp:396
 #3 boost::asio::detail::task_io_service::run (this=0x22738e0, ec=...) at
 /usr/local/include/boost/asio/detail/impl/task_io_service.ipp:153
 #4 0x000000000062521e in boost::asio::io_service::run (this=0x228f6d0) at
 /usr/local/include/boost/asio/impl/io_service.ipp:59
 #5 sofa::pbrpc::ThreadGroupImpl::thread_run (param=0x22bf100) at
 src/sofa/pbrpc/thread_group_impl.h:263
 #6 0x00007f1834e7a9d1 in start_thread () from /lib64/libpthread.so.0
 #7 0x00007f1833fb1b6d in clone () from /lib64/libc.so.6

 so i want see if i see time_out parameter of epoll_wait function is -1.
 so i print epoll_reactor::timer_fd_
 (gdb) p timer_fd_
 $6 = 515

 so why epoll_wait never has a return ??

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12297>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:20 UTC