~ubuntu-branches/ubuntu/vivid/numactl/vivid-proposed

« back to all changes in this revision

Viewing changes to debian/patches/from-git-6a7c2cf3-fix-uninitialised-mask.patch

  • Committer: Package Import Robot
  • Author(s): Daniel J Blueman
  • Date: 2015-04-08 05:30:55 UTC
  • Revision ID: package-import@ubuntu.com-20150408053055-u80t7q2kbrmzfnqt
Tags: 2.0.10-1ubuntu2
d/patches/from-git-6a7c2cf3-fix-uninitialised-mask.patch: Fix libnuma SEGV
due to uninitialised mask. (LP: #1441388)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
commit 6a7c2cf3f00e32082a1ada300cc585740e2b4bbd
 
2
Author: Daniel J Blueman <daniel@numascale.com>
 
3
Date:   Wed, 08 Apr 2015 05:30:55 +0200
 
4
 
 
5
   SEGV due to uninitialised mask
 
6
 
 
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.
 
10
 
 
11
   Also mark another internal function local to the compilation unit.
 
12
 
 
13
   Signed-off-by: Daniel J Blueman <daniel@numascale.com>
 
14
 
 
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
 
18
@@ -58,7 +58,7 @@
 
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;
 
24
 
 
25
 WEAK void numa_error(char *where);
 
26
 
 
27
@@ -1233,7 +1233,7 @@
 
28
 }
 
29
 __asm__(".symver numa_parse_bitmap_v2,numa_parse_bitmap@@libnuma_1.2");
 
30
 
 
31
-void
 
32
+static void
 
33
 init_node_cpu_mask_v2(void)
 
34
 {
 
35
        int nnodes = numa_max_possible_node_v2_int() + 1;