pmap: wrong output in extended format (-x option)

Bug #753124 reported by Andrey Bondarenko
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
procps (Debian)
Fix Released
Unknown
procps (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: procps

As of version 3.2.8-10ubuntu1 pmap -x always prints zero in Kbytes column and does not count summaries for RSS and dirty columns. For example:

$ pmap -x 2868
2868: /bin/bash
Address Kbytes RSS Dirty Mode Mapping
08048000 0 608 0 r-x-- bash
08107000 0 4 0 r---- bash
08108000 0 16 16 rw--- bash
0810d000 0 20 20 rw--- [ anon ]
09405000 0 2464 2044 rw--- [ anon ]
...
b7855000 0 4 4 rw--- ld-2.12.1.so
bfb1f000 0 24 24 rw--- [ stack ]
-------- ------- ------- ------- -------
total kB 9984 - - -

I think it should print something like:

$ ./pmap -x 2868
2868: /bin/bash
Address Kbytes RSS Dirty Mode Mapping
08048000 764 608 0 r-x-- bash
08107000 4 4 0 r---- bash
08108000 20 16 16 rw--- bash
0810d000 20 20 20 rw--- [ anon ]
09405000 3608 2464 2044 rw--- [ anon ]
...
b7855000 4 4 4 rw--- ld-2.12.1.so
bfb1f000 132 24 24 rw--- [ stack ]
-------- ------- ------- ------- -------
total kB 9984 4064 2152 -

Related branches

Revision history for this message
Andrey Bondarenko (abone) wrote :

The bug is here since pmaps_smaps.patch was accepted.

The cause of zero in Kbytes column is line 170 in pmap.c, the patch sets diff = 0 (pmap.c:170) for every mapping line. This is incorrect because mapping virtual size is lost while parsing mapping statistics like dirty pages count. The variable should be initialized only in parsing mapping line.

Summary values was not available until pmaps_smaps.patch and probably author simply forgot to print them in line 292 of pmap.c.

I'll attach debdiff that fixes both problems for me, when it is done.

Revision history for this message
Andrey Bondarenko (abone) wrote :
Changed in procps (Debian):
status: Unknown → New
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package procps - 1:3.2.8-10ubuntu2

---------------
procps (1:3.2.8-10ubuntu2) natty; urgency=low

  * pmap.c: pmap -x correctly reports Kbytes column and prints
    summaries for RSS and Dirty (LP: #753124)
 -- Andrey Bondarenko <email address hidden> Thu, 07 Apr 2011 08:51:12 +0600

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.