Bug 1262870

Summary: pmap produces ludicrous output on shared memory using programs due to bogus parsing
Product: Red Hat Enterprise Linux 6 Reporter: Martin Poole <mpoole>
Component: procpsAssignee: Ondrej Vasik <ovasik>
Status: CLOSED ERRATA QA Contact: Branislav NĂ¡ter <bnater>
Severity: high Docs Contact: Petr Bokoc <pbokoc>
Priority: urgent    
Version: 6.7CC: albert, asanders, bnater, fkrska, jkurik, ovasik, pbokoc, qe-baseos-apps, tbowling
Target Milestone: rcKeywords: Patch, Reproducer, ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: procps-3.2.8-35.el6 Doc Type: Bug Fix
Doc Text:
*pmap* no longer reports incorrect totals With the introduction of `VmFlags` in the kernel *smaps* interface, the *pmap* tool could no longer reliably process the content due to format differences of the `VmFlags` entry. As a consequence, *pmap* reported incorrect totals. The underlying source code has been patched, and *pmap* now works as expected.
Story Points: ---
Clone Of: 1262864
: 1277512 (view as bug list) Environment:
Last Closed: 2016-05-11 00:28:50 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:
Bug Depends On:    
Bug Blocks: 1172231, 1277512    

Comment 2 Martin Poole 2015-09-17 14:42:26 UTC
RHEL6 reproducer

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <stdio.h>


int
main( int argc, char *argv[] )
{
    int fd, shmid;
    void *vp;
    char cmdline[4096];
    char *pwdname = "/etc/passwd";

    /* memory map something */
    fd = open( pwdname, O_RDONLY );
    vp = mmap( NULL, 4096, PROT_READ, MAP_SHARED, fd, 0 );
    fprintf( stderr, "mmap of %s at %p\n", pwdname, vp );

    /* call out to get our own maps */
    sprintf( cmdline, "pmap -x %ld", getpid() );
    system( cmdline );
    return(0);
}

Comment 14 errata-xmlrpc 2016-05-11 00:28:50 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