[Boost-bugs] [Boost C++ Libraries] #6006: Potential epoll fd leak in boost::asio::detail::epoll_reactor

Subject: [Boost-bugs] [Boost C++ Libraries] #6006: Potential epoll fd leak in boost::asio::detail::epoll_reactor
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-10-11 03:16:30


#6006: Potential epoll fd leak in boost::asio::detail::epoll_reactor
----------------------------------------+-----------------------------------
 Reporter: yafei.zhang@… | Owner: chris_kohlhoff
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: asio
  Version: Boost 1.40.0 | Severity: Problem
 Keywords: |
----------------------------------------+-----------------------------------
 in boost/asio/detail/epoll_reactor.hpp:


   // Constructor.
   epoll_reactor(boost::asio::io_service& io_service)
     : boost::asio::detail::service_base<epoll_reactor<Own_Thread>
>(io_service),
       mutex_(),
       epoll_fd_(do_epoll_create()), ------> epoll_fd_ may leak if the
 following member's initialization throws an exception
       wait_in_progress_(false),
       interrupter_(), ------> may throw because of EMFILE
       read_op_queue_(),
       write_op_queue_(),
       except_op_queue_(),
       pending_cancellations_(),
       stop_thread_(false),
       thread_(0),
       shutdown_(false),
       need_epoll_wait_(true)
   {
     // Start the reactor's internal thread only if needed.
     if (Own_Thread)
     {
       boost::asio::detail::signal_blocker sb;
       thread_ = new boost::asio::detail::thread(
           bind_handler(&epoll_reactor::call_run_thread, this));
     }

     // Add the interrupter's descriptor to epoll.
     epoll_event ev = { 0, { 0 } };
     ev.events = EPOLLIN | EPOLLERR;
     ev.data.fd = interrupter_.read_descriptor();
     epoll_ctl(epoll_fd_, EPOLL_CTL_ADD, interrupter_.read_descriptor(),
 &ev);
   }




 and in 1.47.0, there is a similar situation: epoll_fd_ and timer_fd_ may
 leak.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/6006>
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:07 UTC