Subject: Re: bin/8681: grep may bomb out with "memory exhausted"
To: None <simonb@NetBSD.ORG>
From: None <Havard.Eidnes@runit.sintef.no>
List: netbsd-bugs
Date: 10/28/1999 09:51:39
> This is what the maintainer of grep has to say:
>
> 	GNU grep needs to buffer a line of input in main memory.  If
> 	your input lines are too long to fit into your main memory,
> 	then the right thing to do is to get more memory.  See the
> 	section `Memory Usage' in the GNU coding standards for more.

Hm, so folks stuck with traditional systems should try to buy more
memory, and if that can't be done (the hp300 can AFAIK only hold
64MB, I suppose other NetBSD platforms have more restrictions).

The end result is that on these systems grep will bomb out and not
search subsequent files if one of these "problem" files are among
the files being searched.  I don't think that's acceptable, and I
find the above response just a little bit too snotty for my tastes
(I'm sure you agree).

> Personally, I'd be happy to put the size limit in and put a note
> in the man page stating "you may have problems if you are
> searching for a regex that is greater than 4MB, or if you want to
> see a line greater than 2MB long that has a match".  This doesn't
> seem unreasonable to me...

Right.  Except the formulation should probably be "you may have
problems if you are searching with a pattern which may end up with a
match larger than 4MB, or if you want to see a line greater than 2MB
long that has a match" (?).

- H=E5vard