*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.
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
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); }