[tor-bugs] #5263 [Tor Relay]: Busy/infinite Libevent loops

Tor Bug Tracker & Wiki torproject-admin at torproject.org
Fri Jun 8 22:37:27 UTC 2012


#5263: Busy/infinite Libevent loops
------------------------+---------------------------------------------------
 Reporter:  robgjansen  |          Owner:                    
     Type:  defect      |         Status:  needs_review      
 Priority:  major       |      Milestone:  Tor: 0.2.3.x-final
Component:  Tor Relay   |        Version:                    
 Keywords:              |         Parent:                    
   Points:              |   Actualpoints:                    
------------------------+---------------------------------------------------

Comment(by robgjansen):

 Replying to [comment:10 robgjansen]:


 > Replying to [comment:9 nickm]:
 >
 > > err, that should be "3 weeks ago". Can't read today.
 > >
 >
 > I have not changed the patch or anything in the bug5263 branch. And
 sorry for the delay, but I'll try to run the bug5263 branch in Shadow by
 the end of the week.

 So, I've been running this with your branch. I've found another problems.
 In the middle of connection.c, around line 2844, the following statement
 causes problems:

 {{{
 else if (conn->state == OR_CONN_STATE_TLS_SERVER_RENEGOTIATING) {
   return connection_handle_read(conn);
 }
 }}}

 The above basically causes a read call on a write callback. When the above
 call to connection_handle_read returns 0, the write callback event returns
 without deregistering itself. Infinite loop in Shadow.

 Something like the following should fix it:

 {{{
 else if (conn->state == OR_CONN_STATE_TLS_SERVER_RENEGOTIATING) {
   int read_result = connection_handle_read(conn);
   if(read_result <= 0) {
     /* we are supposed to be writing, but we swapped over to reading
       and that didn't work either. so stop writing. */
     if (connection_is_writing(conn)) {
       conn->write_blocked_on_bw = 1;
       connection_stop_writing(conn);
     }
     return read_result;
   }
 }
 }}}

 I think there may be more issues too. Any reason we didn't use
 0.2.3.12-alpha (instead of 0.2.2) to isolate my original bug??

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


More information about the tor-bugs mailing list