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

Re: [tor-bugs] #6472 [Tor Relay]: Assertion !connection_is_on_closeable_list



#6472: Assertion !connection_is_on_closeable_list
-----------------------+----------------------------------------------------
 Reporter:  torland    |          Owner:                    
     Type:  defect     |         Status:  new               
 Priority:  major      |      Milestone:  Tor: 0.2.3.x-final
Component:  Tor Relay  |        Version:  Tor: 0.2.3.19-rc  
 Keywords:             |         Parent:                    
   Points:             |   Actualpoints:                    
-----------------------+----------------------------------------------------

Comment(by cypherpunks):

 I'll leave it here
 {{{
 --- src/or/dns.c
 +++ src/or/dns.mod.c
 @@ -449,16 +449,17 @@
      if (resolve->pending_connections) {
        log_debug(LD_EXIT,
                  "Closing pending connections on timed-out DNS resolve!");
 -      tor_fragile_assert();
        while (resolve->pending_connections) {
          pend = resolve->pending_connections;
          resolve->pending_connections = pend->next;
          /* Connections should only be pending if they have no socket. */
          tor_assert(!SOCKET_OK(pend->conn->_base.s));
          pendconn = pend->conn;
 -        connection_edge_end(pendconn, END_STREAM_REASON_TIMEOUT);
 -        circuit_detach_stream(circuit_get_by_edge_conn(pendconn),
 pendconn);
 -        connection_free(TO_CONN(pendconn));
 +        if (!pendconn->_base.marked_for_close) {
 +          connection_edge_end(pendconn, END_STREAM_REASON_TIMEOUT);
 +          circuit_detach_stream(circuit_get_by_edge_conn(pendconn),
 pendconn);
 +          connection_free(TO_CONN(pendconn));
 +        }
          tor_free(pend);
        }
      }
 @@ -1085,6 +1086,13 @@
      pendconn = pend->conn; /* don't pass complex things to the
                                connection_mark_for_close macro */
      assert_connection_ok(TO_CONN(pendconn),time(NULL));
 +    if (pendconn->_base.marked_for_close) {
 +      /* prevent double-remove. */
 +      pendconn->_base.state = EXIT_CONN_STATE_RESOLVEFAILED;
 +      resolve->pending_connections = pend->next;
 +      tor_free(pend);
 +      continue;
 +    }
      tor_addr_from_ipv4h(&pendconn->_base.addr, addr);
      pendconn->address_ttl = ttl;
 }}}

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/6472#comment:4>
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