buggrep - Bugs: bug #31928, grep should exit(2) when memory is...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

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

Submitter:  None
Submitted:  Sun 19 Dec 2010 04:55:49 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed

Mon 20 Dec 2010 03:14:29 PM UTC, comment #1: 

Thank you for the bug report. This bug has been fixed in the
development sources, which can be downloaded using git from
git://git.sv.gnu.org/grep.git

Paolo Bonzini <bonzini>
Sun 19 Dec 2010 04:55:49 AM UTC, original submission:  


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

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bonzini (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-12-20 bonzini StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code