]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Log more information when bug8185 is about to trigger.
authorNick Mathewson <nickm@torproject.org>
Fri, 29 Sep 2017 13:24:01 +0000 (09:24 -0400)
committerNick Mathewson <nickm@torproject.org>
Fri, 29 Sep 2017 13:24:01 +0000 (09:24 -0400)
My current theory is that this is just a marked circuit that hasn't
closed yet, but let's gather more information in case that theory is
wrong.

Diagnostic for 8185.

changes/8185_diagnostic [new file with mode: 0644]
src/or/relay.c

diff --git a/changes/8185_diagnostic b/changes/8185_diagnostic
new file mode 100644 (file)
index 0000000..b809c4f
--- /dev/null
@@ -0,0 +1,4 @@
+  o Minor features (logging diagnostic):
+    - Log more circuit information whenever we are about to try to
+      package a relay cell on a circuit with a nonexistent n_chan.
+      Attempt to diagnose bug 8185.
index 2bfec342d38ebb4dccb196925e9e6974756e5317..ef4b1f423f80908c34e62fe70f9033fe225c70a3 100644 (file)
@@ -500,7 +500,15 @@ circuit_package_relay_cell(cell_t *cell, circuit_t *circ,
     chan = circ->n_chan;
     if (!chan) {
       log_warn(LD_BUG,"outgoing relay cell sent from %s:%d has n_chan==NULL."
-               " Dropping.", filename, lineno);
+               " Dropping. Circuit is in state %s (%d), and is "
+               "%smarked for close. (%s:%d, %d)", filename, lineno,
+               circuit_state_to_string(circ->state), circ->state,
+               circ->marked_for_close ? "" : "not ",
+               circ->marked_for_close_file?circ->marked_for_close_file:"",
+               circ->marked_for_close, circ->marked_for_close_reason);
+      if (CIRCUIT_IS_ORIGIN(circ)) {
+        circuit_log_path(LOG_WARN, LD_BUG, TO_ORIGIN_CIRCUIT(circ));
+      }
       log_backtrace(LOG_WARN,LD_BUG,"");
       return 0; /* just drop it */
     }