top errors out when a cpu is taken offline

Bug #1399861 reported by David Leonard on 2014-12-06
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
procps (Ubuntu)
Undecided
Unassigned

Bug Description

1. start top in a session
2. press '1' to show the CPUs individually
3. in a separate (root) session, shut down a cpu like this:
    # echo 0 > /sys/devices/system/cpu/cpu2/online
4. top will exit with a message like this:
          top: failed /proc/stat read

Related: when reactivating a cpu, top will only continue to show the first N-1 cpus in its display.

The workaround for people who want to keep an active system monitor up, can do:
$ while true; do top; done

cpus_refresh() assumes that Cpu_tot never changes; it reads that many cpu* entries from /proc/stat, incorrectly interpreting the 'intr' line as a failed cpu line read.

David Leonard (d+) wrote :

procps-3.2.8
Distributor ID: Ubuntu
Description: Ubuntu 12.04.5 LTS
Release: 12.04
Codename: precise

rdks (rdks-deactivatedaccount) wrote :

I can confirm this behaviour for procps-3.2.8.

Additional information:
procps is not used in newer releases any longer.
At least as of 14.04 it is replaced by procps-ng, the top implementation of which handles this scenario correctly.

Changed in procps (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers