From b28327354da285319935a86f873043e4250c91db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Sat, 22 Jan 2022 16:59:50 +0100 Subject: [PATCH 1/2] Ignore the invalid L1 cache line size returned by sysconf() On some systems, the glibc can return 0 instead of cache-line size to indicate the cache line sizes cannot be determined. This is comment from glibc source code: /* In general we cannot determine these values. Therefore we return zero which indicates that no information is available. */ As the goal of the check is to determine whether the L1 cache line size is still 64 and we would use this value in case the sysconf() call is not available, we can also ignore the invalid values returned by the sysconf() call. --- lib/isc/os.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/isc/os.c b/lib/isc/os.c index 2bb7dc2158..9e2b08ce16 100644 --- a/lib/isc/os.c +++ b/lib/isc/os.c @@ -81,7 +81,7 @@ isc__os_initialize(void) { ncpus_initialize(); #if defined(HAVE_SYSCONF) && defined(_SC_LEVEL1_DCACHE_LINESIZE) long s = sysconf(_SC_LEVEL1_DCACHE_LINESIZE); - RUNTIME_CHECK((size_t)s == (size_t)ISC_OS_CACHELINE_SIZE); + RUNTIME_CHECK((size_t)s == (size_t)ISC_OS_CACHELINE_SIZE || s <= 0); #endif } From f570e41ab87a4a16d8053d9e4e82bc0eaac8f385 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Sat, 22 Jan 2022 17:04:17 +0100 Subject: [PATCH 2/2] Add CHANGES note for [GL #3108] --- CHANGES | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES b/CHANGES index 035534dd31..e60d27c779 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +5796. [bug] Ignore the invalid (<= 0) values returned + by the sysconf() check for the L1 cache line + size. [GL #3108] + 5795. [bug] rndc could crash when interrupted by a signal before receiving a response. [GL #3080]