Bug 97526

Summary: bad fgrep matching 2.5
Product: [Retired] Red Hat Linux Reporter: Oscar Fernandez Cantero <ofcantero>
Component: grepAssignee: Tim Waugh <twaugh>
Status: CLOSED RAWHIDE QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: medium    
Version: 9CC: mitr, ofcantero
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: 2.5.1-26 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-02-26 14:34:48 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:
Attachments:
Description Flags
small file
none
gzipped big file fileB for testing none

Description Oscar Fernandez Cantero 2003-06-17 09:50:19 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.2) Gecko/20021120
Netscape/7.01

Description of problem:
Definitely fgrep 2.5.x fails finding matches between two lists of strings. To
see it try "fgrep -wf fileA fileB" where fileA and fileB are two ascii files
with strings to match, one per line, and fileA is a subset of fileB (all the
strings of fileA are contained in fileB). In the general case, fgrep is unable
to match all the entries in fileA to the corresponding strings in fileB, it just
do it for the most of them, but not all, in such a way that when running 

"fgrep -wf fileA fileB | wc -l" 

you won't obtain the number of real coincidences, but less. If you invert the
order of files 

"fgrep -wf fileB fileA | wc -l"

in this case it matches correctly all the common strings, and you obtain as a
result of the above command a number which is equal to the number of lines of
the fileA (as it have to be). Remember fileB is the greater one.

If necessary I could provide with two files prepared for the test.

Version-Release number of selected component (if applicable):
grep-2.5.x

How reproducible:
Always

Steps to Reproduce:
1. Explained in detail at the Description
2.
3.
    

Additional info:

I can realize the fail only happens in version 2.5.x of grep. Not in 2.4.x.

So it affects redhat 7.3 and the following

Comment 1 Tim Waugh 2003-06-17 09:54:10 UTC
Please supply a test case.

Comment 2 Oscar Fernandez Cantero 2003-06-17 10:10:02 UTC
Created attachment 92441 [details]
small file

Comment 3 Oscar Fernandez Cantero 2003-06-17 10:22:52 UTC
Created attachment 92442 [details]
gzipped big file fileB for testing

Comment 4 Oscar Fernandez Cantero 2003-06-17 10:29:51 UTC
Here you have the files to do the test, as attachments of the bug.
Regards
Oscar

Comment 5 Tim Waugh 2004-02-26 14:34:48 UTC
I think this is now fixed in grep-2.5.1-26.