summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Perry <mikeperry-git@torproject.org>2023-08-25 22:43:14 +0000
committerMike Perry <mikeperry-git@torproject.org>2023-08-25 22:53:07 +0000
commit7666dd777afb6e604406ef4ba8676b722d13586e (patch)
tree065e1586cbc964e40957ebfaaf4feec214bdb01d
parentfd6f098c9df0015f503cf8ccacbedbb3ee6ac61a (diff)
downloadtor-7666dd777afb6e604406ef4ba8676b722d13586e.tar.gz
tor-7666dd777afb6e604406ef4ba8676b722d13586e.zip
Bug #40842: Additional diagnostics
Just in case there are other instances hiding in the maze.
-rw-r--r--src/core/or/conflux_util.c18
-rw-r--r--src/core/or/relay.c2
2 files changed, 20 insertions, 0 deletions
diff --git a/src/core/or/conflux_util.c b/src/core/or/conflux_util.c
index 9d1a4bd308..31ab983f8f 100644
--- a/src/core/or/conflux_util.c
+++ b/src/core/or/conflux_util.c
@@ -49,6 +49,20 @@ circuit_get_package_window(circuit_t *circ,
/* If conflux has no circuit to send on, the package window is 0. */
if (!circ) {
+ /* Bug #40842: Additional diagnostics for other potential cases */
+ if (!orig_circ->conflux->curr_leg) {
+ if (orig_circ->marked_for_close) {
+ log_warn(LD_BUG, "Conflux has no circuit to send on. "
+ "Circuit %p idx %d marked at line %s:%d",
+ orig_circ, orig_circ->global_circuitlist_idx,
+ orig_circ->marked_for_close_file,
+ orig_circ->marked_for_close);
+ } else {
+ log_warn(LD_BUG, "Conflux has no circuit to send on. "
+ "Circuit %p idx %d not marked for close.",
+ orig_circ, orig_circ->global_circuitlist_idx);
+ }
+ }
return 0;
}
@@ -83,6 +97,10 @@ conflux_can_send(conflux_t *cfx)
if (send_circ) {
return true;
} else {
+ if (BUG(!cfx->in_full_teardown && !cfx->curr_leg)) {
+ log_fn(LOG_WARN,
+ LD_BUG, "Conflux has no current circuit to send on. ");
+ }
return false;
}
}
diff --git a/src/core/or/relay.c b/src/core/or/relay.c
index 87f8053686..6abe802355 100644
--- a/src/core/or/relay.c
+++ b/src/core/or/relay.c
@@ -641,6 +641,8 @@ relay_send_command_from_edge_,(streamid_t stream_id, circuit_t *orig_circ,
if (BUG(!circ)) {
log_warn(LD_BUG, "No circuit to send for conflux for relay command %d, "
"called from %s:%d", relay_command, filename, lineno);
+ conflux_log_set(LOG_WARN, orig_circ->conflux,
+ CIRCUIT_IS_ORIGIN(orig_circ));
circ = orig_circ;
} else {
/* Conflux circuits always send multiplexed relay commands to