Bug 97526 - bad fgrep matching 2.5
bad fgrep matching 2.5
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: grep (Show other bugs)
9
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
Mike McLean
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-06-17 05:50 EDT by Oscar Fernandez Cantero
Modified: 2007-04-18 12:54 EDT (History)
2 users (show)

See Also:
Fixed In Version: 2.5.1-26
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-02-26 09:34:48 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
small file (197.06 KB, text/plain)
2003-06-17 06:10 EDT, Oscar Fernandez Cantero
no flags Details
gzipped big file fileB for testing (336.70 KB, application/octet-stream)
2003-06-17 06:22 EDT, Oscar Fernandez Cantero
no flags Details

  None (edit)
Description Oscar Fernandez Cantero 2003-06-17 05:50:19 EDT
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 05:54:10 EDT
Please supply a test case.
Comment 2 Oscar Fernandez Cantero 2003-06-17 06:10:02 EDT
Created attachment 92441 [details]
small file
Comment 3 Oscar Fernandez Cantero 2003-06-17 06:22:52 EDT
Created attachment 92442 [details]
gzipped big file fileB for testing
Comment 4 Oscar Fernandez Cantero 2003-06-17 06:29:51 EDT
Here you have the files to do the test, as attachments of the bug.
Regards
Oscar
Comment 5 Tim Waugh 2004-02-26 09:34:48 EST
I think this is now fixed in grep-2.5.1-26.

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