bind9/bin
Michał Kępień b425b5d56e Move xmlInitThreads()/xmlCleanupThreads() calls
xmlInitThreads() and xmlCleanupThreads() are called from within
named_statschannels_configure() and named_statschannels_shutdown(),
respectively.  Both of these functions are executed by worker threads,
not the main named thread.  This causes ASAN to report memory leaks like
the following one upon shutdown (as long as named is asked to produce
any XML output over its configured statistics channels during its
lifetime):

    Direct leak of 968 byte(s) in 1 object(s) allocated from:
        #0 0x7f677c249cd8 in __interceptor_calloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cc:153
        #1 0x7f677bc1838f in xmlGetGlobalState (/usr/lib/libxml2.so.2+0xa838f)

The data mentioned in the above report is a libxml2 state structure
stored as thread-specific data.  Such chunks of memory are automatically
released (by a destructor passed to pthread_key_create() by libxml2)
whenever a thread that allocated a given chunk exits.  However, if
xmlCleanupThreads() is called by a given thread before it exits, the
destructor will not be invoked (due to xmlCleanupThreads() calling
pthread_key_delete()) and ASAN will report a memory leak.  Thus,
xmlInitThreads() and xmlCleanupThreads() must not be called from worker
threads.  Since xmlInitThreads() must be called on Windows in order for
libxml2 to work at all, move xmlInitThreads() and xmlCleanupThreads()
calls to the main named thread (which does not produce any XML output
itself) in order to prevent the memory leak from being reported by ASAN.
2019-12-02 16:03:23 +01:00
..
check Extend ttlval to accept ISO 8601 durations 2019-11-06 22:31:44 +01:00
confgen Make VS solution upgrading unnecessary 2019-09-26 15:11:15 +02:00
delv dns_master_indent and dns_master_indentstr must not be global 2019-11-26 13:52:18 +01:00
dig dns_master_indent and dns_master_indentstr must not be global 2019-11-26 13:52:18 +01:00
dnssec dns_master_indent and dns_master_indentstr must not be global 2019-11-26 13:52:18 +01:00
named Move xmlInitThreads()/xmlCleanupThreads() calls 2019-12-02 16:03:23 +01:00
nsupdate optionally associate a netmgr with a task manager when creating 2019-11-07 11:55:37 -08:00
pkcs11 Make VS solution upgrading unnecessary 2019-09-26 15:11:15 +02:00
plugins add a search for GeoIP2 libraries in configure 2019-06-27 14:58:13 -07:00
python prep 9.15.3 2019-08-12 14:08:12 +00:00
rndc prep 9.15.6 2019-11-17 18:59:41 -08:00
tests Refactor dns_name_dup() usage using the semantic patch 2019-11-29 14:00:37 +01:00
tools dns_master_indent and dns_master_indentstr must not be global 2019-11-26 13:52:18 +01:00
win32/BINDInstall Fix libuv.dll handling 2019-11-12 09:14:59 +00:00
Makefile.in name change from "hook modules" to "plugins" 2018-12-06 10:36:50 -08:00