[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-bugs] #4296 [Tor Client]: Trivial issues in tor_spawn_background()/tor_check_port_forwarding()



#4296: Trivial issues in tor_spawn_background()/tor_check_port_forwarding()
------------------------+---------------------------------------------------
 Reporter:  asn         |          Owner:                    
     Type:  defect      |         Status:  needs_revision    
 Priority:  normal      |      Milestone:  Tor: 0.2.3.x-final
Component:  Tor Client  |        Version:                    
 Keywords:              |         Parent:                    
   Points:              |   Actualpoints:                    
------------------------+---------------------------------------------------

Comment(by asn):

 Replying to [comment:9 nickm]:
 > "this" being the resource  leak that happens if nobody calls the destroy
 function?  I do in fact care about resource leaks, if I understand you
 correctly.

 `tor_check_port_forwarding()` is called periodically. The last time it is
 called before Tor termination `process_handle_destroy()` is '''not'''
 called on the `child_handle`. This leaks the `process_handle_t` and two
 file descriptors upon Tor termination. It's not a resource leak that
 stacks up.

 The logic of `tor_check_port_forwarding()` is not very welcoming to fixes
 either; it does too many things. Maybe exposing `child_handle` as a file-
 level static variable (renamed as `port_fw_child_handle`) and proving a
 `port_forwarding_free_all()` function be called upon shutdown could
 help... Still, that fix is kinda messy.

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/4296#comment:10>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs