BIND 10 #1705: attempt to run multiple auth servers causes FATAL [b10-auth.server_common] SRVCOMM_EXCEPTION_ALLOC exception when allocating a socket: File exists

BIND 10 Development do-not-reply at isc.org
Tue Feb 28 17:37:19 UTC 2012


#1705: attempt to run multiple auth servers causes FATAL [b10-auth.server_common]
SRVCOMM_EXCEPTION_ALLOC exception when allocating a socket: File exists
-------------------------------------+-------------------------------------
                   Reporter:  jreed  |                 Owner:  jinmei
                       Type:         |                Status:  reviewing
  defect                             |             Milestone:
                   Priority:  major  |  Sprint-20120306
                  Component:         |            Resolution:
  Inter-module communication         |             Sensitive:  0
                   Keywords:         |           Sub-Project:  Core
            Defect Severity:  N/A    |  Estimated Difficulty:  0
Feature Depending on Ticket:         |           Total Hours:  0
        Add Hours to Ticket:  0      |
                  Internal?:  0      |
-------------------------------------+-------------------------------------

Comment (by jinmei):

 Replying to [comment:9 vorner]:
 > „Doh“ was a typo, it should have been „How“ ‒ I pushed the change and
 asked for review, when you pointed it out ;-)

 Oh okay.  I didn't realize the branch was updated (or that it even
 still existed).  With this change if dup() succeeds and close() fails
 new_fd will leak.  I suggest the following patch instead.

 {{{
 --- a/src/lib/util/io/fd_share.cc
 +++ b/src/lib/util/io/fd_share.cc
 @@ -110,8 +110,14 @@ recv_fd(const int sock) {
      // It is strange, but the call can return the same file descriptor as
      // one returned previously, even if that one is not closed yet. So,
      // we just re-number every one we get, so they are unique.
 -    int new_fd(dup(fd));
 -    if (close(fd) == -1 || new_fd == -1) {
 +    const int new_fd(dup(fd));
 +    const int error = close(fd);
 +    if (new_fd == -1 || error == -1) {
 +        // even if close has failed above there's anything else we can do
 +        // than returning an error at this point.
 +        if (new_fd != -1) {
 +            close(new_fd); // likewise.  Just return an error if this
 fails.
 +        }
          return (FD_SYSTEM_ERROR);
      }
      return (new_fd);
 }}}

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


More information about the bind10-tickets mailing list