[tbb-commits] [tor-browser-bundle/master] Apply a new patch to address a hang caused by bug11200's fix.

mikeperry at torproject.org mikeperry at torproject.org
Tue Aug 5 22:04:54 UTC 2014


commit 46ea6f3cfb196856d07b99697381d38fc75b1cbd
Author: Mike Perry <mikeperry-git at torproject.org>
Date:   Tue Aug 5 15:03:33 2014 -0700

    Apply a new patch to address a hang caused by bug11200's fix.
---
 Bundle-Data/Docs/ChangeLog.txt            |    3 +
 gitian/descriptors/linux/gitian-tor.yml   |    2 +
 gitian/descriptors/mac/gitian-tor.yml     |    2 +
 gitian/descriptors/windows/gitian-tor.yml |    2 +
 gitian/patches/bug11200-hang-0.2.5.patch  |  158 +++++++++++++++++++++++++++++
 5 files changed, 167 insertions(+)

diff --git a/Bundle-Data/Docs/ChangeLog.txt b/Bundle-Data/Docs/ChangeLog.txt
index 854b00d..f1f647d 100644
--- a/Bundle-Data/Docs/ChangeLog.txt
+++ b/Bundle-Data/Docs/ChangeLog.txt
@@ -22,6 +22,9 @@ Tor Browser Bundle 4.0-alpha-1 -- Aug 7 2014
      * Bug 9516: Send Tor Launcher log messages to Browser Console
    * Bug 11641: Reorganize bundle directory structure to mimic Firefox
    * Bug 10819: Create a preference to enable/disable third party isolation
+   * Backported Tor Patches:
+     * Bug 11200: Fix a hang during bootstrap introduced in the initial
+                  bug11200 patch.
  * Linux:
    * Bug 10178: Make it easier to set an alternate Tor control port and password
    * Bug 11102: Set Window Class to "Tor Browser" to aid in Desktop navigation
diff --git a/gitian/descriptors/linux/gitian-tor.yml b/gitian/descriptors/linux/gitian-tor.yml
index 27e242b..c741cf2 100644
--- a/gitian/descriptors/linux/gitian-tor.yml
+++ b/gitian/descriptors/linux/gitian-tor.yml
@@ -30,6 +30,7 @@ files:
 - "bug9665.patch"
 - "bug8402.patch"
 - "bug8402-master.patch"
+- "bug11200-hang-0.2.5.patch"
 - "dzip.sh"
 - "openssl-linux32-utils.zip"
 - "openssl-linux64-utils.zip"
@@ -82,6 +83,7 @@ script: |
       git am ~/build/bug8402.patch
     else
       git am ~/build/bug8402-master.patch
+      git am ~/build/bug11200-hang-0.2.5.patch
     fi
   fi
   mkdir -p $OUTDIR/src
diff --git a/gitian/descriptors/mac/gitian-tor.yml b/gitian/descriptors/mac/gitian-tor.yml
index 778149b..e708ef8 100644
--- a/gitian/descriptors/mac/gitian-tor.yml
+++ b/gitian/descriptors/mac/gitian-tor.yml
@@ -27,6 +27,7 @@ files:
 - "bug9665.patch"
 - "bug8402.patch"
 - "bug8402-master.patch"
+- "bug11200-hang-0.2.5.patch"
 - "apple-uni-sdk-10.6_20110407-0.flosoft1_i386.deb"
 - "multiarch-darwin11-cctools127.2-gcc42-5666.3-llvmgcc42-2336.1-Linux-120724.tar.xz"
 - "dzip.sh"
@@ -79,6 +80,7 @@ script: |
       git am ~/build/bug8402.patch
     else
       git am ~/build/bug8402-master.patch
+      git am ~/build/bug11200-hang-0.2.5.patch
     fi
   fi
   mkdir -p $OUTDIR/src
diff --git a/gitian/descriptors/windows/gitian-tor.yml b/gitian/descriptors/windows/gitian-tor.yml
index aea69b9..f1b9d7d 100644
--- a/gitian/descriptors/windows/gitian-tor.yml
+++ b/gitian/descriptors/windows/gitian-tor.yml
@@ -28,6 +28,7 @@ files:
 - "bug9665.patch"
 - "bug8402.patch"
 - "bug8402-master.patch"
+- "bug11200-hang-0.2.5.patch"
 - "binutils.tar.bz2"
 - "dzip.sh"
 - "binutils-win32-utils.zip"
@@ -79,6 +80,7 @@ script: |
       git am ~/build/bug8402.patch
     else
       git am ~/build/bug8402-master.patch
+      git am ~/build/bug11200-hang-0.2.5.patch
     fi
   fi
   mkdir -p $OUTDIR/src
diff --git a/gitian/patches/bug11200-hang-0.2.5.patch b/gitian/patches/bug11200-hang-0.2.5.patch
new file mode 100644
index 0000000..00664a4
--- /dev/null
+++ b/gitian/patches/bug11200-hang-0.2.5.patch
@@ -0,0 +1,158 @@
+From 2897735249dfe2de11b2f2e777aa35e1b1926329 Mon Sep 17 00:00:00 2001
+From: Roger Dingledine <arma at torproject.org>
+Date: Tue, 5 Aug 2014 16:54:46 -0400
+Subject: [PATCH 1/3] move the consensus check below the disablednetwork check
+
+should have no impact in practice
+---
+ src/or/nodelist.c | 20 +++++++++++---------
+ 1 file changed, 11 insertions(+), 9 deletions(-)
+
+diff --git a/src/or/nodelist.c b/src/or/nodelist.c
+index 8f87081..a33a8b2 100644
+--- a/src/or/nodelist.c
++++ b/src/or/nodelist.c
+@@ -1495,11 +1495,20 @@ update_router_have_minimum_dir_info(void)
+   time_t now = time(NULL);
+   int res;
+   const or_options_t *options = get_options();
+-  const networkstatus_t *consensus =
+-    networkstatus_get_reasonably_live_consensus(now,usable_consensus_flavor());
++  const networkstatus_t *consensus;
+   int using_md;
+   const char *delay_fetches_msg = NULL;
+ 
++  if (should_delay_dir_fetches(get_options(), &delay_fetches_msg)) {
++    log_notice(LD_DIR, "Delaying directory fetches: %s", delay_fetches_msg);
++    strlcpy(dir_info_status, delay_fetches_msg,  sizeof(dir_info_status));
++    res = 0;
++    goto done;
++  }
++
++  consensus =
++    networkstatus_get_reasonably_live_consensus(now,usable_consensus_flavor());
++
+   if (!consensus) {
+     if (!networkstatus_get_latest_consensus())
+       strlcpy(dir_info_status, "We have no usable consensus.",
+@@ -1511,13 +1520,6 @@ update_router_have_minimum_dir_info(void)
+     goto done;
+   }
+ 
+-  if (should_delay_dir_fetches(get_options(), &delay_fetches_msg)) {
+-    log_notice(LD_DIR, "Delaying directory fetches: %s", delay_fetches_msg);
+-    strlcpy(dir_info_status, delay_fetches_msg,  sizeof(dir_info_status));
+-    res = 0;
+-    goto done;
+-  }
+-
+   using_md = consensus->flavor == FLAV_MICRODESC;
+ 
+   {
+-- 
+1.9.1
+
+From 9c62f4677d49073332bfcdd2f8c61229c943fd22 Mon Sep 17 00:00:00 2001
+From: Roger Dingledine <arma at torproject.org>
+Date: Tue, 5 Aug 2014 17:04:39 -0400
+Subject: [PATCH 2/3] Build circuits more readily when DisableNetwork goes to 0
+
+When Tor starts with DisabledNetwork set, it would correctly
+conclude that it shouldn't try making circuits, but it would
+mistakenly cache this conclusion and continue believing it even
+when DisableNetwork is set to 0. Fixes the bug introduced by the
+fix for bug 11200; bugfix on 0.2.5.4-alpha.
+---
+ changes/bug11200-caching |  7 +++++++
+ src/or/nodelist.c        | 10 ++++++++--
+ 2 files changed, 15 insertions(+), 2 deletions(-)
+ create mode 100644 changes/bug11200-caching
+
+diff --git a/changes/bug11200-caching b/changes/bug11200-caching
+new file mode 100644
+index 0000000..e3fbaec
+--- /dev/null
++++ b/changes/bug11200-caching
+@@ -0,0 +1,7 @@
++  o Major bugfixes:
++    - When Tor starts with DisabledNetwork set, it would correctly
++      conclude that it shouldn't try making circuits, but it would
++      mistakenly cache this conclusion and continue believing it even
++      when DisableNetwork is set to 0. Fixes the bug introduced by the
++      fix for bug 11200; bugfix on 0.2.5.4-alpha.
++
+diff --git a/src/or/nodelist.c b/src/or/nodelist.c
+index a33a8b2..c863663 100644
+--- a/src/or/nodelist.c
++++ b/src/or/nodelist.c
+@@ -1494,16 +1494,21 @@ update_router_have_minimum_dir_info(void)
+ {
+   time_t now = time(NULL);
+   int res;
++  static int disabled=0;
+   const or_options_t *options = get_options();
+   const networkstatus_t *consensus;
+   int using_md;
+   const char *delay_fetches_msg = NULL;
+ 
+   if (should_delay_dir_fetches(get_options(), &delay_fetches_msg)) {
+-    log_notice(LD_DIR, "Delaying directory fetches: %s", delay_fetches_msg);
++    if (!disabled)
++      log_notice(LD_DIR, "Delaying directory fetches: %s", delay_fetches_msg);
+     strlcpy(dir_info_status, delay_fetches_msg,  sizeof(dir_info_status));
+     res = 0;
++    disabled = 1;
+     goto done;
++  } else {
++    disabled = 0;
+   }
+ 
+   consensus =
+@@ -1568,6 +1573,7 @@ update_router_have_minimum_dir_info(void)
+     control_event_client_status(LOG_NOTICE, "NOT_ENOUGH_DIR_INFO");
+   }
+   have_min_dir_info = res;
+-  need_to_update_have_min_dir_info = 0;
++  if (!disabled)
++    need_to_update_have_min_dir_info = 0;
+ }
+ 
+-- 
+1.9.1
+
+From a8f3a72027f35284b2115b078ef8a39c60e5f054 Mon Sep 17 00:00:00 2001
+From: Roger Dingledine <arma at torproject.org>
+Date: Tue, 5 Aug 2014 17:33:33 -0400
+Subject: [PATCH 3/3] Stop redundant clearing of
+ need_to_update_have_min_dir_info
+
+We were clearing it in router_have_minimum_dir_info() as well as in
+update_router_have_minimum_dir_info().
+---
+ src/or/nodelist.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/src/or/nodelist.c b/src/or/nodelist.c
+index c863663..6eb286f 100644
+--- a/src/or/nodelist.c
++++ b/src/or/nodelist.c
+@@ -1277,7 +1277,6 @@ router_have_minimum_dir_info(void)
+ {
+   if (PREDICT_UNLIKELY(need_to_update_have_min_dir_info)) {
+     update_router_have_minimum_dir_info();
+-    need_to_update_have_min_dir_info = 0;
+   }
+   return have_min_dir_info;
+ }
+@@ -1488,7 +1487,7 @@ get_frac_paths_needed_for_circs(const or_options_t *options,
+ 
+ /** Change the value of have_min_dir_info, setting it true iff we have enough
+  * network and router information to build circuits.  Clear the value of
+- * need_to_update_have_min_dir_info. */
++ * need_to_update_have_min_dir_info if we're confident of our answer. */
+ static void
+ update_router_have_minimum_dir_info(void)
+ {
+-- 
+1.9.1
+



More information about the tbb-commits mailing list