From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21302 invoked by alias); 27 Feb 2012 07:07:41 -0000 Received: (qmail 21293 invoked by uid 22791); 27 Feb 2012 07:07:40 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 27 Feb 2012 07:07:29 +0000 From: "eggert at gnu dot org" To: glibc-bugs-regex@sources.redhat.com Subject: [Bug regex/13762] New: re_search etc. should return -2 on memory exhaustion Date: Mon, 27 Feb 2012 07:07:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: regex X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: eggert at gnu dot org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact glibc-bugs-regex-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-regex-owner@sourceware.org X-SW-Source: 2012-02/txt/msg00005.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=13762 Bug #: 13762 Summary: re_search etc. should return -2 on memory exhaustion Product: glibc Version: unspecified Status: NEW Severity: normal Priority: P2 Component: regex AssignedTo: unassigned@sourceware.org ReportedBy: eggert@gnu.org CC: drepper.fsp@gmail.com Classification: Unclassified Created attachment 6249 --> http://sourceware.org/bugzilla/attachment.cgi?id=6249 Fix re_search to return -2 on memory exhaustion. I ran into this problem when testing GNU grep, which uses the re_search function. re_search is supposed to return -2 on internal error, but it returns -1 in some cases when memory is exhausted. -1 simply means "no match", so this causes grep to falsely claim "no match" when it should have reported an error due to memory exhaustion. I'm attaching a patch against the current git master. -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.