Bug 10942 - catopen leaking memory
catopen leaking memory
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
6.0
All Linux
high Severity high
: ---
: ---
Assigned To: David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-04-20 09:56 EDT by rh
Modified: 2008-05-01 11:37 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-05-10 17:46:40 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description rh 2000-04-20 09:56:10 EDT
It appears that the catopen function is leaking memory.
If you place a catopen call inside of a while(1) memory
is leaked.  Checked this using memprof.
Comment 1 Brock Organ 2000-05-09 13:41:59 EDT
Verified this behavior in 6.0; this does not fail in 6.2 (latest release)...

attached is the sample code to reproduce this (thanks to the folks who provided
it ...!):

g++  -g -Wall -c leak.cpp
g++  -o leak leak.o

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <nl_types.h>

void leak()
{
        char      domainpath[1024];// Domain of resource
        nl_catd catfd;                  // File Descriptor for Catalogue

	memset(domainpath,0,1024);
	catfd=0;

	strcpy(domainpath,"ivbas15.mo");
	if ((catfd=catopen ((char *)domainpath, 0)) > 0) {
                int ii=catclose (catfd);
	}
}

// main program
int main()
{

while(1)
  {
	leak();
    sleep(1);
  }


}
Comment 2 matt.domencic 2000-05-09 13:58:59 EDT
Could you do an rpm -qa > rpmlist on the system that
does not leak for catopen and e-mail it to me.

Thanks,
Matt Domencic
Merant

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