1
commit 6a7c2cf3f00e32082a1ada300cc585740e2b4bbd
2
Author: Daniel J Blueman <daniel@numascale.com>
3
Date: Wed, 08 Apr 2015 05:30:55 +0200
5
SEGV due to uninitialised mask
7
As node_cpu_mask_v2 is not defined as local to the compilation unit with
8
'static', it is not guaranteed to be initialised to zero (ie in the .bss).
9
This was leading to some SEGVs we've seen.
11
Also mark another internal function local to the compilation unit.
13
Signed-off-by: Daniel J Blueman <daniel@numascale.com>
15
diff -Nur -x '*.orig' -x '*~' numactl-2.0.10/libnuma.c numactl-2.0.10.new/libnuma.c
16
--- numactl-2.0.10/libnuma.c 2015-04-10 13:06:03.878415799 +0200
17
+++ numactl-2.0.10.new/libnuma.c 2015-04-10 13:06:28.650585381 +0200
19
struct bitmask *numa_nodes_ptr = NULL;
20
static struct bitmask *numa_memnode_ptr = NULL;
21
static unsigned long *node_cpu_mask_v1[NUMA_NUM_NODES];
22
-struct bitmask **node_cpu_mask_v2;
23
+static struct bitmask **node_cpu_mask_v2;
25
WEAK void numa_error(char *where);
29
__asm__(".symver numa_parse_bitmap_v2,numa_parse_bitmap@@libnuma_1.2");
33
init_node_cpu_mask_v2(void)
35
int nnodes = numa_max_possible_node_v2_int() + 1;