Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 4 product line. The current stable release is 4.9. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 198167

Summary: grep should not crash on big files
Product: Red Hat Enterprise Linux 4 Reporter: Russell Coker <russell>
Component: grepAssignee: Tim Waugh <twaugh>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0CC: kasal, staubach
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2007-0281 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-05-01 22:43:55 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:
Bug Depends On: 198165    
Bug Blocks: 216882    

Description Russell Coker 2006-07-10 12:43:28 UTC
Grep buffers entire lines into memory.  When a line is greater than the 
virtual memory capacity of the machine it crashes, in the process it hurts 
performance and gives inaccurate results.

This bug depends on the rawhide bug 198165 (I don't expect a fix to go in to 
RHEL until after it's been tested in rawhide/Fedora).

Comment 1 Peter Staubach 2006-08-18 14:40:34 UTC
I am seeing this bug just doing my normal development work.  It would
be useful for me to get it fixed.

Comment 3 RHEL Program Management 2006-10-16 16:17:08 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 5 Russell Coker 2006-11-21 08:15:48 UTC
As documented in #198165 create a large sparse file and grep it.

Comment 11 Red Hat Bugzilla 2007-05-01 22:43:55 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2007-0281.html


Comment 12 Stepan Kasal 2009-01-27 15:57:50 UTC
Note that the fix caused another problem, so it needs to be adapted.
See bug #440258 for details.