]> granicus.if.org Git - procps-ng/commitdiff
top: swat nasty obscure bug associated with numa nodes
authorJim Warner <james.warner@comcast.net>
Tue, 14 Jun 2016 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@dropbear.xyz>
Fri, 17 Jun 2016 11:44:29 +0000 (21:44 +1000)
When experimenting with two macro constants for stat.c
(#define STACKS_INCR & #define NEWOLD_INCR), a bug was
revealed in top, only surfacing if both were set to 1.

At those settings an absolute minimum number of stacks
would be allocated for CPUs & numa NODEs. This in turn
led top to overrun the lessor number of nodes since he
used the cpu index when accessing those numa stack(s).

What he should have been accessing was the cpu stacks.

Signed-off-by: Jim Warner <james.warner@comcast.net>
top/top.c

index d20f8fd3a7a1b6beaa3b56d7fd721edf4a788fc6..1c58b0a6b4b8d46201472888680f8dec98f62696 100644 (file)
--- a/top/top.c
+++ b/top/top.c
@@ -4714,7 +4714,7 @@ numa_oops:
                if (Numa_node_sel == CPU_VAL(stat_NU, s_int, i)) {
                   if (!isROOM(anyFLG, 1)) break;
                   snprintf(tmp, sizeof(tmp), N_fmt(WORD_eachcpu_fmt), CPU_VAL(stat_ID, s_int, i));
-                  summary_hlp(Stat_reap->nodes->stacks[i], tmp);
+                  summary_hlp(Stat_reap->cpus->stacks[i], tmp);
                   Msg_row += 1;
                }
             }