BIND 10 #394: memory leaks in branches/trac327 (after io_service refactors)

BIND 10 Development do-not-reply at isc.org
Wed Oct 27 15:38:10 UTC 2010


#394: memory leaks in branches/trac327 (after io_service refactors)
-------------------------------+--------------------------------------------
      Reporter:  jelte         |        Owner:     
          Type:  defect        |       Status:  new
      Priority:  major         |    Milestone:     
     Component:  Unclassified  |   Resolution:     
      Keywords:                |    Sensitive:  0  
Estimatedhours:  0.0           |        Hours:  0  
      Billable:  1             |   Totalhours:  0  
      Internal:  0             |  
-------------------------------+--------------------------------------------

Comment(by jelte):

 Replying to [comment:3 each]:
 > The peer/iosock issue is because of the code being left in an
 intermediate state.  Originally, peer and iosock were both shared_ptr<>'s
 and both members of the TCPServer and UDPServer classes, so they were
 deleted when the server instance was deleted.  I moved them into the
 operator() function while I was experimenting with changing the way
 IOMessage is constructed, ran into a roadblock, and reverted most of the
 change, but apparently I left this bit wrong.
 >
 > Anyway, this ought to fix it:
 >
 >     peer.reset(new TCPEndpoint(socket_->remote_endpoint()));
 >     iosock.reset(new TCPSocket(*socket_));
 >

 ah, yes it does, r3379 (that one has one other change, i missed the
 shared_ptr vs shared_array in the tcp version, fixed that too).

 we probably need to do something similar for the newed lenbuf at line
 tcpdns.cc:165

 > My guess is you can fix the UDPQuery leak by calling "delete server_;"
 in a ~UDPQuery() destructor, oops.

 No, that won't work for the same reason it can't be a shared_ptr, UDPQuery
 falls out of scope...

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


More information about the bind10-tickets mailing list