Bug 138076 - grep hangs with *
grep hangs with *
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: grep (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-11-04 09:18 EST by Sammy
Modified: 2007-11-30 17:10 EST (History)
0 users

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

  None (edit)
Description Sammy 2004-11-04 09:18:29 EST
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 09:38:27 EST
Confirmed.  Thanks for spotting it.
Comment 2 Tim Waugh 2004-11-04 10:19:53 EST
Please try 2.5.1-34:

ftp://people.redhat.com/twaugh/tmp/grep/
Comment 3 Sammy 2004-11-04 14:17:43 EST
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 16:04:38 EST
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 16:23:17 EST
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 16:58:53 EST
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 17:02:22 EST
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 17:06:39 EST
Great.

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