[or-cvs] r10812: Patch from lodger: avoid roundoff-error-induced crash bugs w (in tor/trunk: . doc src/or)

nickm at seul.org nickm at seul.org
Thu Jul 12 16:34:45 UTC 2007


Author: nickm
Date: 2007-07-12 12:34:45 -0400 (Thu, 12 Jul 2007)
New Revision: 10812

Modified:
   tor/trunk/
   tor/trunk/ChangeLog
   tor/trunk/doc/TODO
   tor/trunk/src/or/routerlist.c
Log:
 r13730 at catbus:  nickm | 2007-07-12 12:32:40 -0400
 Patch from lodger: avoid roundoff-error-induced crash bugs when picking routers by bandwidth.
 Also, remove listed backports for 0.1.2.x; that list is now in TODO.012



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r13730] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2007-07-12 16:17:31 UTC (rev 10811)
+++ tor/trunk/ChangeLog	2007-07-12 16:34:45 UTC (rev 10812)
@@ -41,6 +41,11 @@
     - Fix a crash bug when router descriptors end at a 4096-byte boundary
       on disk. [Bugfix on 0.1.2.x]
 
+  o Minor bugfixes (core protocol):
+    - When sending destroy cells from a circuit's origin, don't include
+      the reason for tearing down the circuit. The spec says we didn't,
+      and now we actually don't. Reported by lodger. [Bugfix on 0.1.2.x]
+
   o Minor bugfixes (directory):
     - Fix another crash bug related to extra-info caching.  (Bug found by
       Peter Palfrader.) [Bugfix on 0.2.0.2-alpha]
@@ -75,9 +80,6 @@
   o Security fixes (BSD natd support):
     - Fix a possible buffer overrun when using BSD natd support. Bug found
       by croup.
-    - When sending destroy cells from a circuit's origin, don't include
-      the reason for tearing down the circuit. The spec says we didn't,
-      and now we actually don't. Reported by lodger. [Bugfix on 0.1.2.x]
 
 
 Changes in version 0.2.0.2-alpha - 2007-06-02
@@ -271,6 +273,8 @@
       we restart.
     - Add even more asserts to hunt down bug 417.
     - Build without verbose warnings even on (not-yet-released) gcc 4.2.
+    - Fix a possible (but very unlikely) bug in picking routers by bandwidth.
+      Add a log message to confirm that it is in fact unlikely.
 
   o Minor bugfixes (controller):
     - Make 'getinfo fingerprint' return a 551 error if we're not a

Modified: tor/trunk/doc/TODO
===================================================================
--- tor/trunk/doc/TODO	2007-07-12 16:17:31 UTC (rev 10811)
+++ tor/trunk/doc/TODO	2007-07-12 16:34:45 UTC (rev 10812)
@@ -15,10 +15,6 @@
 
 Documentation and testing on 0.1.2.x-final series
 
-  - Pending backports for 0.1.2.x:
-    - r10148: Open cached-routers with FILE_SHARE_READ on win32.
-    - r10493: Weight guard selection by bandwidth.
-
 N - Test guard unreachable logic; make sure that we actually attempt to
     connect to guards that we think are unreachable from time to time.
     Make sure that we don't freak out when the network is down.

Modified: tor/trunk/src/or/routerlist.c
===================================================================
--- tor/trunk/src/or/routerlist.c	2007-07-12 16:17:31 UTC (rev 10811)
+++ tor/trunk/src/or/routerlist.c	2007-07-12 16:34:45 UTC (rev 10812)
@@ -1294,6 +1294,12 @@
     if (tmp >= rand_bw)
       break;
   }
+  if (i == smartlist_len(sl)) {
+    /* This is possible due to round-off error. */
+    --i;
+    log_warn(LD_BUG, "Round-off error in computing bandwidth had an effect on "
+             " which router we chose.  Please tell the developers.");
+  }
   tor_free(bandwidths);
   return smartlist_get(sl, i);
 }



More information about the tor-commits mailing list