Bug 132797 - mmap ia64 memory leak partial page ia32
Summary: mmap ia64 memory leak partial page ia32
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: kernel
Version: 3.0
Hardware: ia64
OS: Linux
medium
high
Target Milestone: ---
Assignee: Dave Anderson
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-09-17 07:30 UTC by venkatesh Natarajan
Modified: 2007-11-30 22:07 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-10-19 19:18:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description venkatesh Natarajan 2004-09-17 07:30:02 UTC
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>

main()
{
        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)
                        abort();

                sleep(1);
                munmap(a, 4096);
                munmap(b, 4096);
                munmap(c, 4096);
                fclose(fp);
        }

        return 0;
}



The above problem seems to be solved in 2.6.8.1rc2 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 Program Management 2007-10-19 19:18:16 UTC
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:
http://www.redhat.com/security/updates/errata/
 
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.