Bug 138076 - grep hangs with *
Summary: grep hangs with *
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: grep (Show other bugs)
(Show other bugs)
Version: rawhide
Hardware: All Linux
medium
medium
Target Milestone: ---
Assignee: Tim Waugh
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-11-04 14:18 UTC by Sammy
Modified: 2007-11-30 22:10 UTC (History)
0 users

Fixed In Version: 2.5.1-34
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-11-04 22:06:39 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)

Description Sammy 2004-11-04 14:18:29 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (compatible; Konqueror/3.3; Linux; X11; en_US) (KHTML, like Gecko)

Description of problem:
Two things:

1. grep hangs if one searches through a large number of files. it does not
   seem to go through the list a file at a time.

   Removing the MBS (patch 5) patch fixes this problem.

2. There is still the problem that if you give "*" as the file list it just sits
    there for ever. Perhaps it is reading "." and ".." ?

    This happens even after removing patch5. However, in this case if
    one gives the extension of the files e.g. *.spec than it does the job.

FYI

Version-Release number of selected component (if applicable):
grep-2.5.1-32

How reproducible:
Always

Steps to Reproduce:
1. install grep 
2. go to  a directory containing a large number of files
3. grep string *
    

Additional info:

Comment 1 Tim Waugh 2004-11-04 14:38:27 UTC
Confirmed.  Thanks for spotting it.

Comment 2 Tim Waugh 2004-11-04 15:19:53 UTC
Please try 2.5.1-34:

ftp://people.redhat.com/twaugh/tmp/grep/

Comment 3 Sammy 2004-11-04 19:17:43 UTC
Solves the problem when extension is specified e.g. 
 
grep  perl *.spec  
 
but hangs forever for 
 
grep perl * 

Comment 4 Tim Waugh 2004-11-04 21:04:38 UTC
It will be to do with one particular file in the directory -- please
can you try to narrow down which it is?  Thanks.

Comment 5 Sammy 2004-11-04 21:23:17 UTC
OK...... i had a file named "-" (I guess a freak vi accident). Removing 
that solved it. 
 
Sorry about that. 

Comment 6 Tim Waugh 2004-11-04 21:58:53 UTC
Wow, what are the odds of there being TWO causes for this problem?

Anyway, for future reference 'grep string ./*' avoids that sort of thing.

Thanks for the report.  By the way, do you find grep to be any faster
than previously?

Comment 7 Sammy 2004-11-04 22:02:22 UTC
Yes, definitely, I have just been searching something in the firefox source 
tree and it was going very fast. 

Comment 8 Tim Waugh 2004-11-04 22:06:39 UTC
Great.


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