[tor-bugs] #2190 [Tor Client]: Possible reentrant calls to libevent from libevent logging callback

Tor Bug Tracker & Wiki torproject-admin at torproject.org
Mon Nov 15 16:01:09 UTC 2010


#2190: Possible reentrant calls to libevent from libevent logging callback
------------------------+---------------------------------------------------
 Reporter:  nickm       |       Owner:  nickm             
     Type:  defect      |      Status:  new               
 Priority:  normal      |   Milestone:  Tor: 0.2.2.x-final
Component:  Tor Client  |     Version:                    
 Keywords:              |      Parent:                    
------------------------+---------------------------------------------------
 Right now, we give Libevent a logging callback that can call into our
 logging system, which can in turn call into our networking code (to send
 messages to the controller), which can re-invoke libevent.  That's bad,
 since Libevent's functions are pretty much all non-reentrant.

 This bug has existed since 0.1.0.2-rc (since we've had log messages sent
 to controllers since 0.0.9pre5... and we've logged messages from libevent
 since 0.1.0.2-rc).

 So why aren't we seeing this bug all the time?  First, Libevent logs
 relatively little by default, and many of the places it logs from are
 harmless in practice since we don't call them reentrantly when sending log
 messages to the controller.

 So this will probably cause big trouble only for cases where Libevent
 debug-level logging is enabled AND the user has a controller watching for
 low-severity log messages.  Of course, if  there are bugs that provoke
 libevent warnings, all bets are off.

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/2190>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list