Bug 79063 - grep(1) - strange behaviour (most likely a bug) -- `grep -i --colour ""`
Summary: grep(1) - strange behaviour (most likely a bug) -- `grep -i --colour ""`
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: Tim Robbins
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-20 22:30 UTC by martinko
Modified: 2007-05-04 00:11 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description martinko 2005-03-20 22:30:02 UTC
      `grep -i --colour ""` runs mad and seems to generate ansi escape codes in a (infinite?) loop. it happens only when using empty ("") search string and both parameters (-i and --colour) are used.
pls find my orginal description below as posted to freebsd-questions mailing list. i also produced a typescript with script(1) which you may find under the 2nd link/post.

http://lists.freebsd.org/pipermail/freebsd-questions/2005-March/081083.html
http://lists.freebsd.org/pipermail/freebsd-questions/2005-March/081202.html

Fix: 

sorry, i've no idea. but if you need my assistence just let me know pls.
How-To-Repeat:       just run the following:
grep -i --colour ""
as soon as you type the first letter it gets mad and soon you'll have a huge typescript file as you can see in the link above.
codes/chars generated (as output on screen) seem to be random but i'm not sure about it.
Comment 1 Tim Robbins freebsd_committer freebsd_triage 2005-05-14 06:35:28 UTC
State Changed
From-To: open->patched

Fixed in -current, with MFC to 5-stable due after the recent grep 
changes have had some time to settle. 


Comment 2 Tim Robbins freebsd_committer freebsd_triage 2005-05-14 06:35:28 UTC
Responsible Changed
From-To: freebsd-bugs->tjr

Fixed in -current, with MFC to 5-stable due after the recent grep 
changes have had some time to settle.
Comment 3 Gavin Atkinson 2007-05-01 11:34:19 UTC
I cannot recreate this on on 6.2-R as it was fixed in -CURRENT before
-CURRENT became RELENG-6, but the changes were never merged back to 5.x.
I'm guessing that the merging of a new grep into RELENG-5 won't be
happening now, so this PR can probably be closed.
Comment 4 martinko 2007-05-02 23:51:36 UTC
Gavin Atkinson wrote:
> I cannot recreate this on on 6.2-R as it was fixed in -CURRENT before
> -CURRENT became RELENG-6, but the changes were never merged back to 5.x.
> I'm guessing that the merging of a new grep into RELENG-5 won't be
> happening now, so this PR can probably be closed.
>
>
>
>   

I'm not using 5.x anymore.

M.
Comment 5 Mark Linimon freebsd_committer freebsd_triage 2007-05-04 00:10:17 UTC
State Changed
From-To: patched->closed

This was never merged to RELENG_5, but our advice to users is to migrate 
to RELENG_6 at this point.  Since tjr is no longer a committer, let's just 
close this one.