Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 76932 - rdist leaks memory badly when many except_pat's are used
Summary: rdist leaks memory badly when many except_pat's are used
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rdist
Version: 8.0
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Phil Knirsch
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2002-10-29 17:13 UTC by John Heidemann
Modified: 2015-03-05 01:11 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2003-09-01 12:56:30 UTC

Attachments (Terms of Use)

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:

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

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

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

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