Umm, this looks ok - that's what supposed to happen. Linux can't fix the
fact that grep doesn't work well on /dev/null (or any file that is that
huge), but at least the above isn't a crash..
> It allocated much more memory than it should. I had a limit of 4MB, but the
> size went up to 12MB (5MB resident).
Umm, _what_ size? If you set a RLIMIT_DATA (or whatever the name is),
that will only make a difference for the process bss (*), and if grep
uses mmap(), then we'd need to have a "virtual memory" limit. However, we
don't have any such limit, although I added a RLIMIT_AS for 2.0 (but it's
currently unchecked).
(*) that's the curent Linux interpretation, at least. Do other unixes
consider mmap'ed data part of RLIMIT_DATA?
> Also I was able to run the memtest
> program on 8MB despite datasize limited to 1MB. Hmm I have to check the
> sources to see what happened. And my program with a global definition of
> 'char a[128MB]' still dumpos core.
Well, dumping core is the corect thing to do - it failed to get the BSS
at exec time, so when the program actually ran it was "kind of" unhappy..
Linus