Merge ~paelzer/ubuntu/+source/numad:fix-1832915-fix-sparse-numa-ids-disco into ~paelzer/ubuntu/+source/numad:importer/ubuntu/disco-devel

Proposed by Christian Ehrhardt 
Status: Merged
Approved by: Christian Ehrhardt 
Approved revision: 39d196cb4bd6fb1000c9a38e56f12667b34ff043
Merge reported by: Christian Ehrhardt 
Merged at revision: 39d196cb4bd6fb1000c9a38e56f12667b34ff043
Proposed branch: ~paelzer/ubuntu/+source/numad:fix-1832915-fix-sparse-numa-ids-disco
Merge into: ~paelzer/ubuntu/+source/numad:importer/ubuntu/disco-devel
Diff against target: 104 lines (+70/-1)
4 files modified
debian/changelog (+7/-0)
debian/control (+2/-1)
debian/patches/lp-1832915-fix-sparse-node-ids.patch (+60/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Christian Ehrhardt  Approve
Canonical Server Pending
Review via email: mp+370043@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

SRU version of https://code.launchpad.net/~paelzer/ubuntu/+source/numad/+git/numad/+merge/369036

Since the code didn't change since Bionic -> Eoan all that is new is the versioning.

Revision history for this message
Bryce Harrington (bryce) wrote :

- Verified patch matches what was uploaded for eoan
- Verified new versioning is correct
- Verified update-maintainer has been run
- Verified matching patch name is listed in d/p/series

* The SRU paperwork needs filled out at LP: #1832915
* Exact steps to reproduce and/or disco/bionic ppas would be helpful for verification

See bionic for attempt at reproducing the original issue.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Added the SRU paperwork, thanks for the hint

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Thank you for your review and checking all the details Bryce, since I addressed all findings I'll set it to approved now to get this ball rolling.

Revision history for this message
Christian Ehrhardt  (paelzer) :
review: Approve
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

This is in universe, hence not in gut-ubuntu. Therefore NOT tagged and pushed;
But uploaded - waiting for SRU review

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

held in proposed, but merged in terms of the archive

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index fdbc70a..03d908b 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,10 @@
6+numad (0.5+20150602-5ubuntu0.19.04.1) disco; urgency=medium
7+
8+ * d/p/lp-1832915-fix-sparse-node-ids.patch: fix a crash on ppc64el
9+ (LP: #1832915)
10+
11+ -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Wed, 19 Jun 2019 13:05:33 +0200
12+
13 numad (0.5+20150602-5) unstable; urgency=medium
14
15 * fix systemd doesn't read /etc/default/numad (Closes: #845447)
16diff --git a/debian/control b/debian/control
17index a8ad461..f3d7658 100644
18--- a/debian/control
19+++ b/debian/control
20@@ -1,7 +1,8 @@
21 Source: numad
22 Section: admin
23 Priority: optional
24-Maintainer: Jeremías Casteglione <debian@jrms.com.ar>
25+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
26+XSBC-Original-Maintainer: Jeremías Casteglione <debian@jrms.com.ar>
27 Uploaders: gustavo panizzo <gfa@zumbi.com.ar>, Kamal Mostafa <kamal@whence.com>
28 Build-Depends: debhelper (>= 9),dh-systemd (>= 1.5)
29 Standards-Version: 3.9.6
30diff --git a/debian/patches/lp-1832915-fix-sparse-node-ids.patch b/debian/patches/lp-1832915-fix-sparse-node-ids.patch
31new file mode 100644
32index 0000000..956edfe
33--- /dev/null
34+++ b/debian/patches/lp-1832915-fix-sparse-node-ids.patch
35@@ -0,0 +1,60 @@
36+From ab79ec5b6389507b4970d68862abb95d0b2b94c9 Mon Sep 17 00:00:00 2001
37+From: Christian Ehrhardt <christian.ehrhardt@canonical.com>
38+Date: Mon, 17 Jun 2019 12:37:48 +0200
39+Subject: [PATCH] fix sparse node ids
40+
41+CPU-ids can be sparse due to disabling a subset of CPUs.
42+On ppc64le this even will make the node_ids sparse, this is actually pretty
43+common on ppc64 when SMT is disabled.
44+
45+Numad has the assumption of cpu/node-ids always being linear and due to that
46+accesses the 'node' array out of bounds. That triggers crashes like the
47+following:
48+
49+ Thread 1 "numad" received signal SIGSEGV, Segmentation fault.
50+ #0 0x00000fb6cd2779f4 in bind_process_and_migrate_memory (p=0xfb6fc1e0f70)
51+ at numad.c:998
52+ #1 0x00000fb6cd27d148 in manage_loads () at numad.c:2225
53+ #2 0x00000fb6cd2734dc in main (argc=<optimized out>, argv=<optimized out>)
54+ at numad.c:2654
55+
56+Instead of directly indexing with node_id we need to detect which array
57+element has the matching node_id and use that.
58+
59+Forwarded: yes (https://pagure.io/numad/pull-request/3)
60+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1832915
61+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=930725
62+Last-Update: 2019-06-19
63+
64+Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
65+---
66+ numad.c | 13 ++++++++++++-
67+ 1 file changed, 12 insertions(+), 1 deletion(-)
68+
69+diff --git a/numad.c b/numad.c
70+index a6a7a5d..524bf61 100644
71+--- a/numad.c
72++++ b/numad.c
73+@@ -995,7 +995,18 @@ int bind_process_and_migrate_memory(process_data_p p) {
74+ int node_id = 0;
75+ while (nodes) {
76+ if (ID_IS_IN_LIST(node_id, p->node_list_p)) {
77+- OR_LISTS(cpu_bind_list_p, cpu_bind_list_p, node[node_id].cpu_list_p);
78++ int id = -1;
79++ for (int node_ix = 0; (node_ix < num_nodes); node_ix++) {
80++ if (node[node_ix].node_id == node_id) {
81++ id = node_ix;
82++ break;
83++ }
84++ }
85++ if (id == -1) {
86++ numad_log(LOG_CRIT, "Node %d is requested, but unknown\n", node_id);
87++ exit(EXIT_FAILURE);
88++ }
89++ OR_LISTS(cpu_bind_list_p, cpu_bind_list_p, node[id].cpu_list_p);
90+ nodes -= 1;
91+ }
92+ node_id += 1;
93+--
94+2.21.0
95+
96diff --git a/debian/patches/series b/debian/patches/series
97index b51a504..9944620 100644
98--- a/debian/patches/series
99+++ b/debian/patches/series
100@@ -5,3 +5,4 @@ makefile-better-cleanup.path
101 abd1802c58d40cd99c69a0f3c10041c0c2b1bd55.patch
102 fix-build-for-no-NR-migrate-pages.patch
103 systemd-read-defaults-file
104+lp-1832915-fix-sparse-node-ids.patch

Subscribers

People subscribed via source and target branches

to all changes: