[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #31928] grep should exit(2) when memory is exhausted

From: anonymous
Subject: [bug #31928] grep should exit(2) when memory is exhausted
Date: Sun, 19 Dec 2010 04:55:50 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20101203 Firefox/3.6.13


                 Summary: grep should exit(2) when memory is exhausted
                 Project: grep
            Submitted by: None
            Submitted on: Sun 19 Dec 2010 04:55:49 AM UTC
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any



When grep exhausts memory due to trying to read()
or mmap() a large binary file, it prints

  grep: memory exhausted

on stderr, then exits with exit status, 1.

I expect the failure, but I believe that
it should exit(2), or something greater than 1,
in order to distinguish this type of failure
from simply a failure to find a match.

The EXIT STATUS section of the man page for grep
says that grep exits with 2 (or greater) in case
of errors, so I believe this is a bug, in the
sense that grep does not behave according to its
documentation.  But, even if the man page were
not explicit about that, grep ought to make it
possible for errors to be distinguished from the
case where no matches are found.

-- Guy Shaw


Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]