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

[or-cvs] r9582: Backport: Fix a longstanding dnsworker-related bug: when we (in tor/branches/tor-0_1_1-patches: . src/or)



Author: nickm
Date: 2007-02-13 16:19:18 -0500 (Tue, 13 Feb 2007)
New Revision: 9582

Modified:
   tor/branches/tor-0_1_1-patches/
   tor/branches/tor-0_1_1-patches/ChangeLog
   tor/branches/tor-0_1_1-patches/src/or/dns.c
Log:
 r11799@catbus:  nickm | 2007-02-13 16:18:48 -0500
 Backport: Fix a longstanding dnsworker-related bug: when we decide to kill a DNS worker for having been in use too long, and we independently decide to close one of the exit connections waiting for that DNS worker (perhaps because we got an END relay cell), it was possible for us to try to double-free the connection.  We were smart enough to detect this and assert, but not smart enough to fix this bug before now.  This should resolve bug 390.



Property changes on: tor/branches/tor-0_1_1-patches
___________________________________________________________________
 svk:merge ticket from /tor/011 [r11799] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/branches/tor-0_1_1-patches/ChangeLog
===================================================================
--- tor/branches/tor-0_1_1-patches/ChangeLog	2007-02-13 21:18:56 UTC (rev 9581)
+++ tor/branches/tor-0_1_1-patches/ChangeLog	2007-02-13 21:19:18 UTC (rev 9582)
@@ -5,6 +5,8 @@
     - Previously, we would cache up to 16 old networkstatus documents
       indefinitely, if they came from nontrusted authorities. Now we
       discard them if they are more than 10 days old.
+    - Fix a longstanding obscure crash bug that could occur when
+      low on DNS resources. (Resolves bug 390.)
 
   o Minor bugfixes:
     - Don't launch requests for descriptors unless we have networkstatuses

Modified: tor/branches/tor-0_1_1-patches/src/or/dns.c
===================================================================
--- tor/branches/tor-0_1_1-patches/src/or/dns.c	2007-02-13 21:18:56 UTC (rev 9581)
+++ tor/branches/tor-0_1_1-patches/src/or/dns.c	2007-02-13 21:19:18 UTC (rev 9582)
@@ -532,7 +532,8 @@
     circ = circuit_get_by_edge_conn(pendconn);
     if (circ)
       circuit_detach_stream(circ, pendconn);
-    connection_free(pendconn);
+    if (!pendconn->marked_for_close)
+      connection_free(pendconn);
     resolve->pending_connections = pend->next;
     tor_free(pend);
   }