2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

Merge branch '3051-missing-destroy-for-pthread-primitives' into 'main'

Stop leaking mutex in nmworker and cond in nm socket

Closes #3051

See merge request isc-projects/bind9!5622
This commit is contained in:
Ondřej Surý
2021-12-08 17:17:17 +00:00
3 changed files with 10 additions and 1 deletions

View File

@@ -1,3 +1,7 @@
5776. [bug] Add a missing isc_condition_destroy() for nmsocket
condition variable and add missing isc_mutex_destroy()
for nmworker lock. [GL #3051]
5775. [bug] Added a timer in the resolver to kill fetches that 5775. [bug] Added a timer in the resolver to kill fetches that
have deadlocked as a result of dependency loops have deadlocked as a result of dependency loops
with the ADB or the validator. This condition is with the ADB or the validator. This condition is

View File

@@ -79,3 +79,6 @@ Bug Fixes
- The resolver could hang on shutdown due to dispatch resources not being - The resolver could hang on shutdown due to dispatch resources not being
cleaned up when a TCP connection was reset. This has been fixed. :gl:`#3026` cleaned up when a TCP connection was reset. This has been fixed. :gl:`#3026`
- On FreeBSD, a TCP connection would leak a small amount of heap memory leading
to out-of-memory problem in a long run. This has been fixed. :gl:`#3051`

View File

@@ -379,6 +379,7 @@ nm_destroy(isc_nm_t **mgr0) {
isc_mem_put(mgr->mctx, ievent, sizeof(*ievent)); isc_mem_put(mgr->mctx, ievent, sizeof(*ievent));
} }
isc_condition_destroy(&worker->cond_prio); isc_condition_destroy(&worker->cond_prio);
isc_mutex_destroy(&worker->lock);
r = uv_loop_close(&worker->loop); r = uv_loop_close(&worker->loop);
INSIST(r == 0); INSIST(r == 0);
@@ -1271,8 +1272,9 @@ nmsocket_cleanup(isc_nmsocket_t *sock, bool dofree FLARG) {
sock->ah_size * sizeof(sock->ah_frees[0])); sock->ah_size * sizeof(sock->ah_frees[0]));
isc_mem_put(sock->mgr->mctx, sock->ah_handles, isc_mem_put(sock->mgr->mctx, sock->ah_handles,
sock->ah_size * sizeof(sock->ah_handles[0])); sock->ah_size * sizeof(sock->ah_handles[0]));
isc_mutex_destroy(&sock->lock);
isc_condition_destroy(&sock->scond); isc_condition_destroy(&sock->scond);
isc_condition_destroy(&sock->cond);
isc_mutex_destroy(&sock->lock);
#if HAVE_LIBNGHTTP2 #if HAVE_LIBNGHTTP2
isc__nm_tls_cleanup_data(sock); isc__nm_tls_cleanup_data(sock);
isc__nm_http_cleanup_data(sock); isc__nm_http_cleanup_data(sock);