BIND 10 #2903: need more asio error handling in asiodns

BIND 10 Development do-not-reply at isc.org
Thu Apr 4 22:09:29 UTC 2013


#2903: need more asio error handling in asiodns
-------------------------------------+-------------------------------------
                   Reporter:         |                 Owner:
  jinmei                             |                Status:  new
                       Type:         |             Milestone:  Next-Sprint-
  defect                             |  Proposed
                   Priority:         |              Keywords:
  medium                             |             Sensitive:  0
                  Component:         |           Sub-Project:  DNS
  b10-auth                           |  Estimated Difficulty:  0
               CVSS Scoring:         |           Total Hours:  0
            Defect Severity:  N/A    |
Feature Depending on Ticket:         |
        Add Hours to Ticket:  0      |
                  Internal?:  0      |
-------------------------------------+-------------------------------------
 `asiodns::TCPServer::operator()` propagates one possible exception
 from the asio level:
 {{{#!cpp
         peer_.reset(new TCPEndpoint(socket_->remote_endpoint()));
 }}}

 this internally calls getpeername(2), which could fail if the
 connection is unexpectedly reset (e.g., by receiving RST) immediately
 after accepting a new connection.  If that happens this version of
 remote_endpoint() throws an exception, which would be propagated to
 the top level of the application and terminate it.  that is seemingly
 happening on our AS112 server.

 One easy way to fix this is to use non-throw version of
 remote_endpoint() and handle the error code (see the attached patch).

 I also suggest checking other calls to ASIO methods/functions that can
 throw and handle the errors appropriately.

-- 
Ticket URL: <http://bind10.isc.org/ticket/2903>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list