Bug 10942 - catopen leaking memory
Summary: catopen leaking memory
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc
Version: 6.0
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: David Lawrence
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-04-20 13:56 UTC by rh
Modified: 2008-05-01 15:37 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-05-10 21:46:40 UTC
Embargoed:


Attachments (Terms of Use)

Description rh 2000-04-20 13:56:10 UTC
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 17:41:59 UTC
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 17:58:59 UTC
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.