Bug 76932

Summary: rdist leaks memory badly when many except_pat's are used
Product: [Retired] Red Hat Linux Reporter: John Heidemann <johnh>
Component: rdistAssignee: Phil Knirsch <pknirsch>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: 8.0CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-09-01 12:56:30 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description John Heidemann 2002-10-29 17:13:59 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2b) Gecko/20021017

Description of problem:
rdist leaks memory badly when many except_pat's are used.
This appears to be due to the fact that glibc's re_comp leaks about 100KB per
invocation (see bug 76594).

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. set up a distfile something like this

MASTER1_FILES = ( ~ )
HOSTS = ( other machine )
rmaster1: ${RMASTER1_FILES} -> ${HOSTS}
	install -w -y -R;
	except_pat ${EXCEPT_PAT};
EXCEPT_PAT = (
        xxx
        yyy
        zzz
	)

2. run rdist with that distfile (rdist -f distfile)
  make sure there are 100s of files in ~
3. cring as the machine swaps like mad

(See bug 76594 for a much simpler test case illustrating the re_comp problem.)
	

Actual Results:  the rdist process quickly consumes 100s of MB of RAM

Expected Results:  rdist should run in <30MB ram

Additional info:

IMHO, the proper fix is to fix glibc (see bug 76594).

This patch will work-around the glibc bug by using rdist's internal re_comp:

dash> diff -u config/mf.linux{~,}
--- config/mf.linux~    1998-11-09 19:53:01.000000000 -0800
+++ config/mf.linux     2002-10-24 13:42:28.000000000 -0700
@@ -16,7 +16,7 @@
 # Functions that are missing in this OS are contained in the
 # files specified in ${MISSINGOBJS}.
 #
-#MISSINGOBJS   = $(O)strerror.o $(O)strcasecmp.o
+MISSINGOBJS    = $(O)regex.o
 
 #
 # System libraries that we need to load.

Comment 1 Phil Knirsch 2003-09-01 12:56:30 UTC
Fixed with newer glibc in newer release.

Read ya, Phil