From a3c0b00ef6b37e51e9c0075a8afffb8e1ff3398c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Thu, 26 Sep 2019 10:20:26 +0200 Subject: [PATCH 1/2] Properly initialize libxml2 When libxml2 is to be used in a multi-threaded application, the xmlInitThreads() function must be called before any other libxml2 function. This function does different things on various platforms and thus one can get away without calling it on Unix systems, but not on Windows, where it initializes critical section objects used for synchronizing access to data structures shared between threads. Add the missing xmlInitThreads() call to prevent crashes on affected systems. Also add a matching xmlCleanupThreads() call to properly release the resources set up by xmlInitThreads(). --- bin/named/statschannel.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bin/named/statschannel.c b/bin/named/statschannel.c index 4d277d9ed8..d7f864acec 100644 --- a/bin/named/statschannel.c +++ b/bin/named/statschannel.c @@ -3587,6 +3587,10 @@ named_statschannels_configure(named_server_t *server, const cfg_obj_t *config, ISC_LIST_INIT(new_listeners); +#ifdef HAVE_LIBXML2 + xmlInitThreads(); +#endif /* HAVE_LIBXML2 */ + /* * Get the list of named.conf 'statistics-channels' statements. */ @@ -3719,6 +3723,10 @@ named_statschannels_shutdown(named_server_t *server) { ISC_LIST_UNLINK(server->statschannels, listener, link); shutdown_listener(listener); } + +#ifdef HAVE_LIBXML2 + xmlCleanupThreads(); +#endif /* HAVE_LIBXML2 */ } isc_result_t From b5bcd4b8d64301e3c10c1bfadfda26fb53e4a4b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Thu, 26 Sep 2019 10:20:26 +0200 Subject: [PATCH 2/2] Add CHANGES entry 5293. [bug] On Windows, named crashed upon any attempt to fetch XML statistics from it. [GL #1245] --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index 1d9c0190f2..c31a99a8d7 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +5293. [bug] On Windows, named crashed upon any attempt to fetch XML + statistics from it. [GL #1245] + 5292. [bug] Queue 'rndc nsec3param' requests while signing inline zone changes. [GL #1205]