Bug 21808

Summary: bash uses too much memory when processing big "hereis" documents
Product: [Retired] Red Hat Linux Reporter: Need Real Name <tony_naccarato>
Component: bashAssignee: Tim Waugh <twaugh>
Status: CLOSED CANTFIX QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0   
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: 2006-10-18 17:18:34 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 Need Real Name 2000-12-06 16:51:19 UTC
I need to use "shar" to archive a 20MB binary. 
When I unshar the resulting archive on my RedHat 6.0 box,
using "sh filename" it seemingly hangs. It is not really hanging but
rather it is consuming more and more memory and getting slower and slower
and usually when "top" reports it used 160MB and still increasing I kill
the process. On another machine when we let it continue for longer,
lazy-swap starting killing processes and eventually we had to reboot the
machine to recover.
  
Note : no problem with zsh on Linux, or AIX/Solaris or HPUX posix shells.
  
The problem appears to be that the shar archive contains a 40MB "hereis"
document (a uuencoded version of my 20MB binary) which is input to the
"unpacker" program. The shell appears to be trying to read it all into
memory. 
  
I can work around the problem if I manually edit the shar archive to
avoid the use of the "hereis" document (using awk to pipe every line
between the beginning and end markers directly into the unpacker program
seems to use the least amount of memory). But I do not want to do this
every time I generate such a shar file.
  
I am using RedHat 6.0, bash 1.14.7 (but I also reproduced it on 2.03), on
a Pentium III PC with 128MB of Memory.

Comment 1 Bill Nottingham 2006-08-07 19:59:31 UTC
Red Hat Linux is no longer supported by Red Hat, Inc. If you are still
running Red Hat Linux, you are strongly advised to upgrade to a
current Fedora Core release or Red Hat Enterprise Linux or comparable.
Some information on which option may be right for you is available at
http://www.redhat.com/rhel/migrate/redhatlinux/.

Red Hat apologizes that these issues have not been resolved yet. We do
want to make sure that no important bugs slip through the cracks.
Please check if this issue is still present in a current Fedora Core
release. If so, please change the product and version to match, and
check the box indicating that the requested information has been
provided. Note that any bug still open against Red Hat Linux on will be
closed as 'CANTFIX' on September 30, 2006. Thanks again for your help.


Comment 2 Bill Nottingham 2006-10-18 17:18:34 UTC
Red Hat Linux is no longer supported by Red Hat, Inc. If you are still
running Red Hat Linux, you are strongly advised to upgrade to a
current Fedora Core release or Red Hat Enterprise Linux or comparable.
Some information on which option may be right for you is available at
http://www.redhat.com/rhel/migrate/redhatlinux/.

Closing as CANTFIX.