PowerTOP crashes on ppc64 machine with 1 idle state, reproducer:
# powertop -t 1 --html
Parameters of the machine are attached.
It seems the problem is caused by the report_display_cpu_cstates()
function from the src/cpu/cpu.cpp file.
On
https://github.com/fenrus75/powertop/blob/e8765b5475b22b7a2b6e9e8a031c68a...
it allocates table 2x1, but the table should be 2x2 (header + 1 state), so it
later crashes on
https://github.com/fenrus75/powertop/blob/e8765b5475b22b7a2b6e9e8a031c68a...
where it tries to fill the table.
Unfortunately, the whole reporting code is quite unclear, so I am not sure how
to correctly fix it and not break anything else. The attached patch fixes
the problem for me, but it can have side-effects - feel free to propose
better fix
thanks & regards
Jaroslav
Machine parameters:
# cpupower idle-info
CPUidle driver: pseries_idle
CPUidle governor: menu
analyzing CPU 0:
Number of idle states: 1
Available idle states: Shared Cede
Shared Cede:
Flags/Description: Shared Cede
Latency: 0
Usage: 1188350
Duration: 14152220333
# cat /proc/cpuinfo
processor : 0
cpu : POWER8E (raw), altivec supported
clock : 3425.000000MHz
revision : 2.1 (pvr 004b 0201)
processor : 1
cpu : POWER8E (raw), altivec supported
clock : 3425.000000MHz
revision : 2.1 (pvr 004b 0201)
processor : 2
cpu : POWER8E (raw), altivec supported
clock : 3425.000000MHz
revision : 2.1 (pvr 004b 0201)
processor : 3
cpu : POWER8E (raw), altivec supported
clock : 3425.000000MHz
revision : 2.1 (pvr 004b 0201)
processor : 4
cpu : POWER8E (raw), altivec supported
clock : 3425.000000MHz
revision : 2.1 (pvr 004b 0201)
processor : 5
cpu : POWER8E (raw), altivec supported
clock : 3425.000000MHz
revision : 2.1 (pvr 004b 0201)
processor : 6
cpu : POWER8E (raw), altivec supported
clock : 3425.000000MHz
revision : 2.1 (pvr 004b 0201)
processor : 7
cpu : POWER8E (raw), altivec supported
clock : 3425.000000MHz
revision : 2.1 (pvr 004b 0201)
timebase : 512000000
platform : pSeries
model : IBM pSeries (emulated by qemu)
machine : CHRP IBM pSeries (emulated by qemu)