From 47f1d19f8e6e1795ad7a73cb96bf44f355442e85 Mon Sep 17 00:00:00 2001 From: David Goulet Date: Thu, 17 Sep 2020 12:55:40 -0400 Subject: test: Increment rend cache allocation before freeing The rend_cache/entry_free was missing the rend cache allocation increment before freeing the object. Without it, it had an underflow bug: Sep 17 08:40:13.845 [warn] rend_cache_decrement_allocation(): Bug: Underflow in rend_cache_decrement_allocation (on Tor 0.4.5.0-alpha-dev 7eef9ced61e72b1d) Fixes #40125 Signed-off-by: David Goulet --- changes/ticket40125 | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 changes/ticket40125 (limited to 'changes') diff --git a/changes/ticket40125 b/changes/ticket40125 new file mode 100644 index 0000000000..c68e3ce7b3 --- /dev/null +++ b/changes/ticket40125 @@ -0,0 +1,4 @@ + o Testing (onion service v2): + - Fix a rendezvous cache unit test that was triggering an underflow on the + global rend cache allocation. Fixes bug 40125; bugfix on + 0.2.8.1-alpha. -- cgit v1.2.3-54-g00ecf From 7945e075a42aecaa633565ebbc5d3b809ed24e7e Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 17 Sep 2020 14:04:54 -0400 Subject: Fix underflow in rend_cache/free_all test. We already fixed these in #40099 and #40125. This patch fixes #40126. Bugfix on 0.2.8.1-alpha. --- changes/ticket40126 | 4 ++++ src/test/test_rendcache.c | 1 + 2 files changed, 5 insertions(+) create mode 100644 changes/ticket40126 (limited to 'changes') diff --git a/changes/ticket40126 b/changes/ticket40126 new file mode 100644 index 0000000000..1f5806e6cb --- /dev/null +++ b/changes/ticket40126 @@ -0,0 +1,4 @@ + o Testing (onion service v2): + - Fix another rendezvous cache unit test that was triggering an underflow on the + global rend cache allocation. Fixes bug 40126; bugfix on + 0.2.8.1-alpha. diff --git a/src/test/test_rendcache.c b/src/test/test_rendcache.c index 92e135f3b1..8b0e2df485 100644 --- a/src/test/test_rendcache.c +++ b/src/test/test_rendcache.c @@ -954,6 +954,7 @@ test_rend_cache_free_all(void *data) one->parsed = desc_one; desc_one->timestamp = time(NULL) + TIME_IN_THE_PAST; desc_one->pk = pk_generate(0); + rend_cache_increment_allocation(rend_cache_entry_allocation(one)); strmap_set_lc(rend_cache, "foo1", one); rend_cache_free_all(); -- cgit v1.2.3-54-g00ecf From faf89ec6c2e0db1ba82639c41a4c754751f4ce1d Mon Sep 17 00:00:00 2001 From: David Goulet Date: Tue, 22 Sep 2020 11:06:34 -0400 Subject: srv: Remove spammy debug log Fixes #40135 Signed-off-by: David Goulet --- changes/ticket40135 | 3 +++ src/feature/hs_common/shared_random_client.c | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) create mode 100644 changes/ticket40135 (limited to 'changes') diff --git a/changes/ticket40135 b/changes/ticket40135 new file mode 100644 index 0000000000..9b60b4f655 --- /dev/null +++ b/changes/ticket40135 @@ -0,0 +1,3 @@ + o Minor bugfix (logging): + - Remove a debug logging statement that uselessly spam the logs. Fixes bug + 40135; bugfix on 0.3.5.0-alpha. diff --git a/src/feature/hs_common/shared_random_client.c b/src/feature/hs_common/shared_random_client.c index 5772034c6d..3d6be94080 100644 --- a/src/feature/hs_common/shared_random_client.c +++ b/src/feature/hs_common/shared_random_client.c @@ -255,10 +255,6 @@ sr_state_get_start_time_of_current_protocol_run(void) protocol run */ time_t time_elapsed_since_start_of_run = curr_round_slot * voting_interval; - log_debug(LD_GENERAL, "Current SRV proto run: Start of current round: %u. " - "Time elapsed: %u (%d)", (unsigned) beginning_of_curr_round, - (unsigned) time_elapsed_since_start_of_run, voting_interval); - return beginning_of_curr_round - time_elapsed_since_start_of_run; } -- cgit v1.2.3-54-g00ecf