diff options
author | Nick Mathewson <nickm@torproject.org> | 2015-02-24 13:23:44 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-02-24 13:23:44 -0500 |
commit | 2bcb596dcf3dd5972de3875da3f1d9485115ce38 (patch) | |
tree | d9ae3d22d815c41c044834e2037c0d6826c0c762 | |
parent | 8e61d38cf107560a55ebdb8397230f3d88548745 (diff) | |
parent | 905287415b834db1a92205e8436f66a3b2d6846c (diff) | |
download | tor-2bcb596dcf3dd5972de3875da3f1d9485115ce38.tar.gz tor-2bcb596dcf3dd5972de3875da3f1d9485115ce38.zip |
Merge remote-tracking branch 'public/bug14129_024' into maint-0.2.4
-rw-r--r-- | changes/bug14129 | 7 | ||||
-rw-r--r-- | src/or/dns.c | 6 |
2 files changed, 12 insertions, 1 deletions
diff --git a/changes/bug14129 b/changes/bug14129 new file mode 100644 index 0000000000..6153cd84fd --- /dev/null +++ b/changes/bug14129 @@ -0,0 +1,7 @@ + o Major bugfixes (exit node stability): + + - Fix an assertion failure that could occur under high DNS load. Fixes + bug 14129; bugfix on Tor 0.0.7rc1. Found by "jowr"; diagnosed and fixed + by "cypherpunks". + + diff --git a/src/or/dns.c b/src/or/dns.c index fb1b10d82c..8b6e3b0543 100644 --- a/src/or/dns.c +++ b/src/or/dns.c @@ -557,6 +557,8 @@ purge_expired_resolves(time_t now) /* Connections should only be pending if they have no socket. */ tor_assert(!SOCKET_OK(pend->conn->base_.s)); pendconn = pend->conn; + /* Prevent double-remove */ + pendconn->base_.state = EXIT_CONN_STATE_RESOLVEFAILED; if (!pendconn->base_.marked_for_close) { connection_edge_end(pendconn, END_STREAM_REASON_TIMEOUT); circuit_detach_stream(circuit_get_by_edge_conn(pendconn), pendconn); @@ -1132,7 +1134,9 @@ connection_dns_remove(edge_connection_t *conn) return; /* more are pending */ } } - tor_assert(0); /* not reachable unless onlyconn not in pending list */ + log_warn(LD_BUG, "Connection (fd "TOR_SOCKET_T_FORMAT") was not waiting " + "for a resolve of %s, but we tried to remove it.", + conn->base_.s, escaped_safe_str(conn->base_.address)); } } |