]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
resolve a BUG() on relays at startup
authorRoger Dingledine <arma@torproject.org>
Thu, 27 Oct 2022 23:54:31 +0000 (19:54 -0400)
committerRoger Dingledine <arma@torproject.org>
Fri, 28 Oct 2022 00:07:48 +0000 (20:07 -0400)
Remove a harmless "Bug" log message that can happen in
relay_addr_learn_from_dirauth() on relays during startup:

tor_bug_occurred_(): Bug: ../src/feature/relay/relay_find_addr.c:225: relay_addr_learn_from_dirauth: Non-fatal assertion !(!ei) failed. (on Tor 0.4.7.10 )
Bug: Tor 0.4.7.10: Non-fatal assertion !(!ei) failed in relay_addr_learn_from_dirauth at ../src/feature/relay/relay_find_addr.c:225. Stack trace: (on Tor 0.4.7.10 )

Finishes fixing bug 40231.

Fixes bug 40523; bugfix on 0.4.5.4-rc.

changes/bug40523 [new file with mode: 0644]
src/feature/relay/relay_find_addr.c

diff --git a/changes/bug40523 b/changes/bug40523
new file mode 100644 (file)
index 0000000..880fc46
--- /dev/null
@@ -0,0 +1,4 @@
+  o Minor bugfixes (relay):
+    - Remove a harmless "Bug" log message that can happen in
+      relay_addr_learn_from_dirauth() on relays during startup. Finishes
+      fixing bug 40231. Fixes bug 40523; bugfix on 0.4.5.4-rc.
index f4f9d408238445fe1f0aa8946de01296804a7c1e..5a32283a7b709fbb63401248391597da88746867 100644 (file)
@@ -212,17 +212,19 @@ relay_addr_learn_from_dirauth(void)
       return;
     }
     const node_t *node = node_get_by_id(rs->identity_digest);
-    if (!node) {
+    extend_info_t *ei = NULL;
+    if (node) {
+      ei = extend_info_from_node(node, 1, false);
+    }
+    if (!node || !ei) {
       /* This can happen if we are still in the early starting stage where no
        * descriptors we actually fetched and thus we have the routerstatus_t
        * for the authority but not its descriptor which is needed to build a
        * circuit and thus learn our address. */
-      log_info(LD_GENERAL, "Can't build a circuit to an authority. Unable to "
-                           "learn for now our address from them.");
-      return;
-    }
-    extend_info_t *ei = extend_info_from_node(node, 1, false);
-    if (BUG(!ei)) {
+      log_info(LD_GENERAL,
+               "Trying to learn our IP address by connecting to an "
+               "authority, but can't build a circuit to one yet. Will try "
+               "again soon.");
       return;
     }