From: David Goulet Date: Thu, 27 Mar 2025 12:49:40 +0000 (-0400) Subject: conflux: Avoid non fatal assert in CIRCUIT_IS_CONFLUX() X-Git-Tag: tor-0.4.9.2-alpha~6^2^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=46161b194f7a0ca7a2c83c36d1eb01f8110d80a1;p=thirdparty%2Ftor.git conflux: Avoid non fatal assert in CIRCUIT_IS_CONFLUX() In the circuit_about_to_free(), we clear the circ->conflux object and then we end up trying to emit an event on the control port which calls CIRCUIT_IS_CONFLUX() and non fatal assert on the false branch. Fixes #41037 Signed-off-by: David Goulet --- diff --git a/changes/ticket41037 b/changes/ticket41037 new file mode 100644 index 0000000000..c56165ade2 --- /dev/null +++ b/changes/ticket41037 @@ -0,0 +1,3 @@ + o Minor bugfix (conflux): + - Avoid a non fatal assert when describing a conflux circuit on the control + port after being prepped to be freed. Fixes bug 41037; bugfix on 0.4.8.15. diff --git a/src/core/or/conflux_util.h b/src/core/or/conflux_util.h index 501ce61d82..f259c3a3e1 100644 --- a/src/core/or/conflux_util.h +++ b/src/core/or/conflux_util.h @@ -28,8 +28,9 @@ CIRCUIT_IS_CONFLUX(const circuit_t *circ) tor_assert_nonfatal(circ->purpose == CIRCUIT_PURPOSE_CONFLUX_LINKED); return true; } else { - tor_assert_nonfatal(circ->purpose != CIRCUIT_PURPOSE_CONFLUX_LINKED); - tor_assert_nonfatal(circ->purpose != CIRCUIT_PURPOSE_CONFLUX_UNLINKED); + /* We don't assert on purposes here because we can end up in this branch + * with circ->conflux being NULL but for a conflux purpose. This happens in + * the about_to_free() code path. */ return false; } }