From 92be76fb89a27359ef6992e3a07d8bd1e27b1df8 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Thu, 1 Aug 2024 17:15:07 +0200 Subject: [PATCH] - Fix that the worker mem report with alloc stats does not attempt to print memory use of forwards and hints if they have been deleted already. --- daemon/worker.c | 8 +++++--- doc/Changelog | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/daemon/worker.c b/daemon/worker.c index b35fe65a3..dd14a5a3c 100644 --- a/daemon/worker.c +++ b/daemon/worker.c @@ -160,9 +160,11 @@ worker_mem_report(struct worker* ATTR_UNUSED(worker), + sizeof(worker->rndstate) + regional_get_mem(worker->scratchpad) + sizeof(*worker->env.scratch_buffer) - + sldns_buffer_capacity(worker->env.scratch_buffer) - + forwards_get_mem(worker->env.fwds) - + hints_get_mem(worker->env.hints); + + sldns_buffer_capacity(worker->env.scratch_buffer); + if(worker->daemon->env->fwds) + me += forwards_get_mem(worker->env.fwds); + if(worker->daemon->env->hints) + me += hints_get_mem(worker->env.hints); if(worker->thread_num == 0) me += acl_list_get_mem(worker->daemon->acl); if(cur_serv) { diff --git a/doc/Changelog b/doc/Changelog index 7e1b81eb4..f94ed7fec 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -4,6 +4,9 @@ to free the tail, specifically in the free of the list since that picked up the next item in the list for its loop causing invalid free. Added internal unit test to unbound-dnstap-socket for that. + - Fix that the worker mem report with alloc stats does not attempt + to print memory use of forwards and hints if they have been + deleted already. 31 July 2024: Wouter - Fix for #1114: Fix that cache fill for forward-host names is -- 2.47.3