Bug 1288497

Summary: pmap - no sums computed for RSS and Dirty column
Product: Red Hat Enterprise Linux 6 Reporter: Branislav Náter <bnater>
Component: procpsAssignee: Ondrej Vasik <ovasik>
Status: CLOSED ERRATA QA Contact: Branislav Náter <bnater>
Severity: low Docs Contact: Petr Bokoc <pbokoc>
Priority: medium    
Version: 6.7CC: albert, pbokoc
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: i686   
OS: Unspecified   
Whiteboard:
Fixed In Version: procps-3.2.8-36.el6 Doc Type: Bug Fix
Doc Text:
Previously the layout of the extended pmap output differed on 32-bit and 64-bit architectures due to the fact, that it is generated for both bit widths with a different part of the source code. While the 64-bit code went through an evolution, the 32-bit code was forgotten and the layout was kept intact for a long time and some of the values were missing (for example the sums for the RSS/Dirty columns). This update fixes the 32-bit layout to match the 64-bit layout. The only expected difference is the width of the address column.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-11 00:29:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
procps-3.2.8-pmap-32bit-layout-fix.patch none

Description Branislav Náter 2015-12-04 12:13:32 UTC
Description of problem:
pmap produce output with no sums/totals for RSS and Dirty column. Issue is presented only on i686 architecture, all other (x86_64, ppc64, s390x) arch works as expected (sum is prented)

Version-Release number of selected component (if applicable):
procps-3.2.8-34.el6_7.i686

How reproducible:
always, see bellow

Steps to Reproduce:
1. pmap -x $$

Actual results:
# pmap -x $$
19555:   -bash
Address   Kbytes     RSS   Dirty Mode   Mapping
00426000      88      68       0 r-x--  libtinfo.so.5.7
0043c000      12       8       4 rw---  libtinfo.so.5.7
0056e000       4       4       0 r-x--    [ anon ]
0087f000     120     100       0 r-x--  ld-2.12.so
0089d000       4       4       4 r----  ld-2.12.so
0089e000       4       4       4 rw---  ld-2.12.so
008a5000    1600     536       0 r-x--  libc-2.12.so
00a35000       4       0       0 -----  libc-2.12.so
00a36000       8       8       4 r----  libc-2.12.so
00a38000       4       4       4 rw---  libc-2.12.so
00a39000      12      12      12 rw---    [ anon ]
00a5b000      12       8       0 r-x--  libdl-2.12.so
00a5e000       4       4       4 r----  libdl-2.12.so
00a5f000       4       4       4 rw---  libdl-2.12.so
00b91000      48      16       0 r-x--  libnss_files-2.12.so
00b9d000       4       4       4 r----  libnss_files-2.12.so
00b9e000       4       4       4 rw---  libnss_files-2.12.so
08047000     836     532       0 r-x--  bash
08118000      20      20      20 rw---  bash
0811d000      20      20      20 rw---    [ anon ]
084f7000     264     140     140 rw---    [ anon ]
b7531000    2048      68       0 r----  locale-archive
b7731000       8       8       8 rw---    [ anon ]
b7735000       8       8       8 rw---    [ anon ]
b7737000      28      20       0 r--s-  gconv-modules.cache
b773e000       4       4       0 r----  locale-archive
b773f000       4       4       4 rw---    [ anon ]
bf967000      84      20      20 rw---    [ stack ]
-------- ------- ------- ------- -------
total kB    5260       -       -       -                  <-------------

Comment 1 Jaromír Cápík 2015-12-04 12:25:55 UTC
I'm trying to test that on 32-bit ppc in order to get more info that could help us to understand the problem better.

Comment 2 Jaromír Cápík 2015-12-04 12:48:19 UTC
I'm unable to install 32-bit RHEL5 on PPC. The installer is terminated unexpectedly. Gonna debug on i686.

Comment 3 Jaromír Cápík 2015-12-04 15:51:20 UTC
It's really strange. The whole layout differs on i686. There are 5 dashed columns instead of 4 and the total is incorrect.

Comment 4 Jaromír Cápík 2015-12-04 15:52:52 UTC
x86_64:

00007fff5bd42000      84      24      24 rw---    [ stack ]
00007fff5bd93000       4       4       0 r-x--    [ anon ]
ffffffffff600000       4       0       0 r-x--    [ anon ]
----------------  ------  ------  ------
total kB          108728    2020     604



i686:

b77c9000       8       8       8 rw---    [ anon ]
b77d7000       4       4       4 rw---    [ anon ]
bf96a000      84      20      20 rw---    [ stack ]
-------- ------- ------- ------- -------
total kB 1195600       -       -       -

Comment 5 Jaromír Cápík 2015-12-04 16:02:43 UTC
For some reason, the 32-bit code differs from the 64-bit code. Someone probably did some kind of enhancement and forgot to modify the bottom code.

    if(x_option){
      if(sizeof(KLONG)==8){
        printf("----------------  ------  ------  ------\n");
        printf(
          "total kB %15ld %7llu %7llu\n",
          (total_shared + total_private_writeable + total_private_readonly) >> 10,
          total_rss, (total_shared_dirty+total_private_dirty)
   
        );
      }else{
        printf("-------- ------- ------- ------- -------\n");
        printf(
          "total kB %7ld       -       -       -\n",
          (total_shared + total_private_writeable + total_private_readonly) >> 10
        );
      }
    }

Comment 6 Jaromír Cápík 2015-12-04 16:11:20 UTC
Created attachment 1102322 [details]
procps-3.2.8-pmap-32bit-layout-fix.patch

Comment 12 errata-xmlrpc 2016-05-11 00:29:08 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-0904.html