bug-grep
[Top][All Lists]
Advanced

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

[bug-grep] Re: PCRE-related segfault in grep 2.5.1


From: Julian Foad
Subject: [bug-grep] Re: PCRE-related segfault in grep 2.5.1
Date: Tue, 10 May 2005 09:14:59 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8b) Gecko/20050217

(Grep now has its own mailing list, <address@hidden>, so I'm replying to there.)

Michael Henry wrote:
I believe I've found a bug in GNU grep 2.5.1 related to
Perl-compatible regular expressions.

Symptom
=================================
A segmentation fault is produced by GNU grep whenever
Perl-compatible regular expressions is turned on and a
negated character class is used that fails to match after
scanning a non-zero amount of text.

Reproducing the bug
=================================
 address@hidden ~]$ echo "No bug" | grep -P '[^a]'
 No bug
 address@hidden ~]$ echo "a" | grep -P '[^a]'
 Segmentation fault

Thank you for this report and the clear reproduction recipe. This bug has already been fixed in Grep CVS so the fix will be in the next released version.

- Julian


Test environment
=================================

Tested using GNU grep 2.5.1 on my Fedora Core 2 and 3 boxes.
 address@hidden ~]$ grep --version
 grep (GNU grep) 2.5.1

 Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.
 This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

It appears to be a problem only with the Perl-compatible regular
expression mode (enabled by the -P option).

Thanks,
Michael Henry





reply via email to

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