From e21103f2d37d339886b09387b08239c838d50ef1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Fri, 7 Jun 2019 15:21:43 +0200 Subject: [PATCH 1/2] Fix statistics for x86 Windows builds Using atomic_int_fast64_t variables with atomic functions on x86 does not cause Visual Studio to report build errors, but such operations yield useless results. Since the isc_stat_t type is unconditionally typedef'd to atomic_int_fast64_t, any code performing atomic operations on isc_stat_t variables is broken in x86 Windows builds. Fix by using the atomic_int_fast32_t type for isc_stat_t in x86 Windows builds. --- doc/arm/Bv9ARM-book.xml | 9 +++++++++ lib/isc/stats.c | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/doc/arm/Bv9ARM-book.xml b/doc/arm/Bv9ARM-book.xml index cc9921bcfc..4a27aa8024 100644 --- a/doc/arm/Bv9ARM-book.xml +++ b/doc/arm/Bv9ARM-book.xml @@ -15352,6 +15352,15 @@ HOST-127.EXAMPLE. MX 0 . BIND 8 statistics, if applicable. + + Note: BIND statistics counters are signed 64-bit values on + all platforms except one: 32-bit Windows, where they are + signed 32-bit values. Given that 32-bit values have a + vastly smaller range than 64-bit values, BIND statistics + counters in 32-bit Windows builds overflow significantly + more quickly than on all other platforms. + +
Name Server Statistics Counters diff --git a/lib/isc/stats.c b/lib/isc/stats.c index 883c1c373b..123c6dff97 100644 --- a/lib/isc/stats.c +++ b/lib/isc/stats.c @@ -28,7 +28,11 @@ #define ISC_STATS_MAGIC ISC_MAGIC('S', 't', 'a', 't') #define ISC_STATS_VALID(x) ISC_MAGIC_VALID(x, ISC_STATS_MAGIC) +#if defined(_WIN32) && !defined(_WIN64) +typedef atomic_int_fast32_t isc_stat_t; +#else typedef atomic_int_fast64_t isc_stat_t; +#endif struct isc_stats { unsigned int magic; From cbb2edb8d31b733fa0598dfb50d0b60e0de24542 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Fri, 7 Jun 2019 15:21:43 +0200 Subject: [PATCH 2/2] Add CHANGES entry 5249. [bug] Statistics were broken in x86 Windows builds. [GL #1081] --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index 11b16ae9f1..944a6a7708 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +5251. [bug] Statistics were broken in x86 Windows builds. + [GL #1081] + 5250. [func] The default size for RSA keys is now 2048 bits, for both ZSKs and KSKs. [GL #1097]