From e4aaf7666028c30866ad63053ad9f6eb6bf16bf7 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 21 Sep 2016 19:01:12 -0400 Subject: When clearing cells from a circuit for OOM reasons, tell cmux we did so. Not telling the cmux would sometimes cause an assertion failure in relay.c when we tried to get an active circuit and found an "active" circuit with no cells. Additionally, replace that assert with a test and a log message. Fix for bug 20203. This is actually probably a bugfix on 0.2.8.1-alpha, specifically my code in 8b4e5b7ee902fb7fa0776 where I made circuit_mark_for_close_() do less in order to simplify our call graph. Thanks to "cypherpunks" for help diagnosing. --- src/or/circuitlist.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/or/circuitlist.c') diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c index 716024df6a..5fb8be54b6 100644 --- a/src/or/circuitlist.c +++ b/src/or/circuitlist.c @@ -1836,8 +1836,14 @@ marked_circuit_free_cells(circuit_t *circ) return; } cell_queue_clear(&circ->n_chan_cells); - if (! CIRCUIT_IS_ORIGIN(circ)) - cell_queue_clear(& TO_OR_CIRCUIT(circ)->p_chan_cells); + if (circ->n_mux) + circuitmux_clear_num_cells(circ->n_mux, circ); + if (! CIRCUIT_IS_ORIGIN(circ)) { + or_circuit_t *orcirc = TO_OR_CIRCUIT(circ); + cell_queue_clear(&orcirc->p_chan_cells); + if (orcirc->p_mux) + circuitmux_clear_num_cells(orcirc->p_mux, circ); + } } static size_t -- cgit v1.2.3-54-g00ecf