-
Bug
-
Resolution: Done
-
Normal
-
rhel-9.2.0
-
None
-
procps-ng-3.3.17-14.el9
-
None
-
None
-
rhel-sst-cs-plumbers
-
ssg_core_services
-
25
-
3
-
False
-
-
Yes
-
None
-
Pass
-
None
-
Bug Fix
-
-
Done
-
-
All
-
None
What were you trying to do that didn't work?
- top -u <username>
press "M" to sort by memory usage
Please provide the package NVR for which bug is seen:
procps-ng-3.3.17-11.el9.x86_64
How reproducible:
Consistently even on a fresh install.
Steps to reproduce
There are multiple ways to reproduce this issue:
A:
- I have a user "test" who currently has two ssh sessions which are each watching a log file. As the root user, I execute "top -u test":
------------------------------- - top -u test
top - 11:34:11 up 15 days, 3:17, 4 users, load average: 0.00, 0.00, 0.00
Tasks: 111 total, 1 running, 110 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.0 us, 0.3 sy, 0.0 ni, 99.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
MiB Mem : 1766.2 total, 1111.2 free, 356.0 used, 446.8 buff/cache
MiB Swap: 0.0 total, 0.0 free, 0.0 used. 1410.2 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
22696 test 20 0 8816 5564 3520 S 0.0 0.3 0:00.02 bash
22723 test 20 0 8684 5500 3540 S 0.0 0.3 0:00.01 bash
22744 test 20 0 6156 2820 2420 S 0.0 0.2 0:00.14 watch
22764 test 20 0 6156 2804 2408 S 0.0 0.2 0:00.13 watch
-------------------------------
- Pressing "M" results in no processes showing:
-------------------------------
top - 11:35:00 up 15 days, 3:18, 4 users, load average: 0.00, 0.00, 0.00
Tasks: 111 total, 1 running, 110 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.3 us, 0.7 sy, 0.0 ni, 98.3 id, 0.0 wa, 0.3 hi, 0.0 si, 0.3 st
MiB Mem : 1766.2 total, 1111.2 free, 356.0 used, 446.8 buff/cache
MiB Swap: 0.0 total, 0.0 free, 0.0 used. 1410.2 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
-------------------------------
B:
- This can also be reproduced by executing "top", then searching for a specific user and sorting with M. While the same test user is logged in with the same processes running in another console, I execute simply "top" as the root user, then press "u" and enter "test" to show only processes owned by the test user:
-------------------------------
top - 11:37:06 up 15 days, 3:20, 4 users, load average: 0.00, 0.00, 0.00
Tasks: 111 total, 1 running, 110 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.3 us, 0.7 sy, 0.0 ni, 98.7 id, 0.0 wa, 0.3 hi, 0.0 si, 0.0 st
MiB Mem : 1766.2 total, 1111.2 free, 356.0 used, 446.8 buff/cache
MiB Swap: 0.0 total, 0.0 free, 0.0 used. 1410.2 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
22764 test 20 0 6156 2804 2408 S 0.3 0.2 0:00.22 watch
22681 test 20 0 22360 14392 11244 S 0.0 0.8 0:00.15 systemd
22683 test 20 0 173456 7236 0 S 0.0 0.4 0:00.00 (sd-pa+
22695 test 20 0 20612 7872 5712 S 0.0 0.4 0:00.15 sshd
22696 test 20 0 8816 5564 3520 S 0.0 0.3 0:00.02 bash
22722 test 20 0 20616 7912 5748 S 0.0 0.4 0:00.15 sshd
22723 test 20 0 8684 5500 3540 S 0.0 0.3 0:00.01 bash
22744 test 20 0 6156 2820 2420 S 0.0 0.2 0:00.21 watch
-------------------------------
- If I then press "M" to sort by memory, the processes disappear again:
-------------------------------
top - 11:37:47 up 15 days, 3:21, 4 users, load average: 0.00, 0.00, 0.00
Tasks: 111 total, 1 running, 110 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.0 us, 2.0 sy, 0.0 ni, 96.0 id, 0.0 wa, 2.0 hi, 0.0 si, 0.0 st
MiB Mem : 1766.2 total, 1111.2 free, 356.0 used, 446.8 buff/cache
MiB Swap: 0.0 total, 0.0 free, 0.0 used. 1410.2 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
-------------------------------
Expected results
Sorting a particular user's processes by memory should not cause top to fail.
Actual results
Top stops showing processes if you limit the results to a specific user and then sort by memory.
Additional notes:
If I run "top" as the test user, and then press "M", the processes are sorted by memory usage as expected and do not disappear.
Additionally, if "top" is executed by the root user and you sort with "M" first and then limit the processes to a single user with "u", the processes are still displayed and sorted by memory usage as expected.
- duplicates
-
RHEL-16279 top hides output when a user filter is applied, then sorted by Memory
- Closed
- is cloned by
-
RHEL-46760 top fails to display processes for a specific user if sorting by memory with M
- Planning
- links to
-
RHBA-2024:128558 procps-ng update
- mentioned on