Bug 97526 - bad fgrep matching 2.5
Summary: bad fgrep matching 2.5
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: grep   
(Show other bugs)
Version: 9
Hardware: i386 Linux
medium
medium
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Mike McLean
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-06-17 09:50 UTC by Oscar Fernandez Cantero
Modified: 2007-04-18 16:54 UTC (History)
2 users (show)

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: ---


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

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.


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