bind9/lib/isc
Ondřej Surý ebcfb16576 Enable tracking of pthreads mutexes
Some POSIX threads implementations (e.g. FreeBSD's libthr) allocate
memory on the heap when pthread_mutex_init() is called.  Every call to
that function must be accompanied by a corresponding call to
pthread_mutex_destroy() or else the memory allocated for the mutex will
leak.

jemalloc can be used for detecting memory allocations which are not
released by a process when it exits.  Unfortunately, since jemalloc is
also the system allocator on FreeBSD and a special (profiling-enabled)
build of jemalloc is required for memory leak detection, this method
cannot be used for detecting leaked memory allocated by libthr on a
stock FreeBSD installation.

However, libthr's behavior can be emulated on any platform by
implementing alternative versions of libisc functions for creating and
destroying mutexes that allocate memory using malloc() and release it
using free().  This enables using jemalloc for detecting missing
pthread_mutex_destroy() calls on any platform on which it works
reliably.

Introduce a new ISC_TRACK_PTHREADS_OBJECTS preprocessor macro, which
causes isc_mutex_t structures to be allocated on the heap by
isc_mutex_init() and freed by isc_mutex_destroy().  Reuse existing mutex
macros (after renaming them appropriately) for other operations.
2022-07-13 13:19:32 +02:00
..
include Enable tracking of pthreads mutexes 2022-07-13 13:19:32 +02:00
netmgr TLS: do not ignore accept callback result 2022-07-12 14:40:22 +03:00
.gitignore [master] update gitignore files; use rev-parse to get srcid 2014-06-17 13:49:30 -07:00
aes.c Remove EVP_CIPHER_CTX_new() and EVP_CIPHER_CTX_free() shims 2022-03-02 10:48:09 +00:00
app.c REQUIRE should not have side effects 2022-07-05 12:22:55 -07:00
assertions.c Simplify way we tag unreachable code with only ISC_UNREACHABLE() 2022-03-25 08:33:43 +01:00
astack.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
backtrace.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
base32.c Remove use of the inline keyword used as suggestion to compiler 2022-03-25 08:33:43 +01:00
base64.c Remove use of the inline keyword used as suggestion to compiler 2022-03-25 08:33:43 +01:00
bind9.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
buffer.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
commandline.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
condition.c Enable tracking of pthreads mutexes 2022-07-13 13:19:32 +02:00
counter.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
crc64.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
dir.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
entropy.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
entropy_private.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
errno.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
errno2result.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
errno2result.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
error.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
event.c Add detailed tracing when TASKMGR_TRACE is defined 2022-04-19 14:25:23 +02:00
file.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
fsaccess.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
fsaccess_common.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
fsaccess_common_p.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
glob.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
hash.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
heap.c Make isc_heap_create() and isc_heap_insert() return void 2022-03-08 11:19:34 +01:00
hex.c Remove use of the inline keyword used as suggestion to compiler 2022-03-25 08:33:43 +01:00
hmac.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
ht.c Make isc_ht optionally case insensitive 2022-03-28 15:02:18 -07:00
httpd.c Allow listening on less than nworkers threads 2022-04-19 11:08:13 +02:00
interfaceiter.c Simplify way we tag unreachable code with only ISC_UNREACHABLE() 2022-03-25 08:33:43 +01:00
iterated_hash.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
jemalloc_shim.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
lex.c Remove use of the inline keyword used as suggestion to compiler 2022-03-25 08:33:43 +01:00
lib.c Use library constructor to create default mutex attr once 2022-07-13 13:19:32 +02:00
log.c Simplify way we tag unreachable code with only ISC_UNREACHABLE() 2022-03-25 08:33:43 +01:00
Makefile.am Use library constructor to create default mutex attr once 2022-07-13 13:19:32 +02:00
managers.c Replace netievent lock-free queue with simple locked queue 2022-03-04 13:49:51 +01:00
md.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
mem.c REQUIRE should not have side effects 2022-07-05 12:22:55 -07:00
mem_p.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
meminfo.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
mutex.c Enable tracking of pthreads mutexes 2022-07-13 13:19:32 +02:00
mutex_p.h Use library constructor to create default mutex attr once 2022-07-13 13:19:32 +02:00
mutexblock.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
net.c Remove use of the inline keyword used as suggestion to compiler 2022-03-25 08:33:43 +01:00
netaddr.c Simplify way we tag unreachable code with only ISC_UNREACHABLE() 2022-03-25 08:33:43 +01:00
netmgr_p.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
netscope.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
nonce.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
openssl_shim.c Do not provide a shim for SSL_SESSION_is_resumable() 2022-05-23 18:25:18 +03:00
openssl_shim.h Do not provide a shim for SSL_SESSION_is_resumable() 2022-05-23 18:25:18 +03:00
os.c Remove use of the inline keyword used as suggestion to compiler 2022-03-25 08:33:43 +01:00
os_p.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
parseint.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
portset.c Remove use of the inline keyword used as suggestion to compiler 2022-03-25 08:33:43 +01:00
quota.c REQUIRE should not have side effects 2022-07-05 12:22:55 -07:00
radix.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
random.c Revert "Move random number re-seeding out of the hot path" 2022-04-25 15:18:58 +01:00
ratelimiter.c Don't use reference counting in isc_timer unit 2022-04-02 01:23:15 +02:00
regex.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
region.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
resource.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
result.c Add ISC_R_TLSBADPEERCERT error code to the TLS related code 2022-03-28 15:32:30 +03:00
rwlock.c Directly cause assertion failure on pthreads primitives failure 2022-07-13 13:19:32 +02:00
safe.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
serial.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
siphash.c Simplify way we tag unreachable code with only ISC_UNREACHABLE() 2022-03-25 08:33:43 +01:00
sockaddr.c Simplify way we tag unreachable code with only ISC_UNREACHABLE() 2022-03-25 08:33:43 +01:00
stats.c Assert if statistics counter underflows in the developer mode 2022-02-10 17:18:09 +01:00
stdio.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
stdtime.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
string.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
symtab.c Remove use of the inline keyword used as suggestion to compiler 2022-03-25 08:33:43 +01:00
syslog.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
task.c REQUIRE should not have side effects 2022-07-05 12:22:55 -07:00
task_p.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
tests Move all the unit tests to /tests/<libname>/ 2022-05-28 14:53:02 -07:00
thread.c Add an ERRNO_CHECK() preprocessor macro 2022-07-13 13:19:32 +02:00
time.c Remove use of the inline keyword used as suggestion to compiler 2022-03-25 08:33:43 +01:00
timer.c Directly cause assertion failure on pthreads primitives failure 2022-07-13 13:19:32 +02:00
timer_p.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
tls.c REQUIRE should not have side effects 2022-07-05 12:22:55 -07:00
tls_p.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
tm.c Add FALLTHROUGH macro for __attribute__((fallthrough)) 2022-03-25 08:33:43 +01:00
trampoline.c Lock the trampoline when attaching 2022-05-13 10:07:20 +02:00
trampoline_p.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
url.c Simplify way we tag unreachable code with only ISC_UNREACHABLE() 2022-03-25 08:33:43 +01:00
utf8.c Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
uv.c Restore the implementation of uv_os_getenv() shim 2022-05-04 12:31:46 +02:00