Bug 132797 - mmap ia64 memory leak partial page ia32
mmap ia64 memory leak partial page ia32
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: kernel (Show other bugs)
ia64 Linux
medium Severity high
: ---
: ---
Assigned To: Dave Anderson
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2004-09-17 03:30 EDT by venkatesh Natarajan
Modified: 2007-11-30 17:07 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-10-19 15:18:16 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description venkatesh Natarajan 2004-09-17 03:30:02 EDT
Description of problem:

Version-Release number of selected component (if applicable):
2.4.21-4.EL #1 RedHat EL 3 Update 1

How reproducible:
The following program has virtual memory leak.
The program was compiled on Redhat-8

#include <stdio.h>
#include <unistd.h>
#include <sys/mman.h>

        void *a, *b, *c;
        int i;
        char buf[256], buff[5000];
        FILE *fp;

        sprintf(buf, "/proc/%d/status", getpid());

        for (i = 0; i < 100000; i++) {
                fp = fopen(buf, "r");
                fread(buff, sizeof(buff), 1, fp);
                a = mmap(0, 4096, PROT_READ|PROT_WRITE,
                        MAP_SHARED|MAP_ANONYMOUS, -1, 0);
                b = mmap(0, 4096, PROT_READ|PROT_WRITE,
                        MAP_SHARED|MAP_ANONYMOUS, -1, 0);
                c = mmap(0, 4096, PROT_READ|PROT_WRITE,
                        MAP_SHARED|MAP_ANONYMOUS, -1, 0);
                if ((long)a == -1 || (long)b == -1 || (long)c == -1)

                munmap(a, 4096);
                munmap(b, 4096);
                munmap(c, 4096);

        return 0;

The above problem seems to be solved in kernel patch
For more information see: http://lwn.net/Articles/93176/

Steps to Reproduce:
1. Compile the above program with g++/gcc on x86 m/c (32bit)
2. Run the compiled program and watch the VmSize of this process
   in /proc/<pid>/status file every 5 seconds.
Actual results:

Expected results:

Additional info:
Comment 1 RHEL Product and Program Management 2007-10-19 15:18:16 EDT
This bug is filed against RHEL 3, which is in maintenance phase.
During the maintenance phase, only security errata and select mission
critical bug fixes will be released for enterprise products. Since
this bug does not meet that criteria, it is now being closed.
For more information of the RHEL errata support policy, please visit:
If you feel this bug is indeed mission critical, please contact your
support representative. You may be asked to provide detailed
information on how this bug is affecting you.

Note You need to log in before you can comment on or make changes to this bug.