Bug 76932 - rdist leaks memory badly when many except_pat's are used
rdist leaks memory badly when many except_pat's are used
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: rdist (Show other bugs)
8.0
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Phil Knirsch
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-10-29 12:13 EST by John Heidemann
Modified: 2015-03-04 20:11 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-09-01 08:56:30 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 John Heidemann 2002-10-29 12:13:59 EST
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 08:56:30 EDT
Fixed with newer glibc in newer release.

Read ya, Phil

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