bug-grep
[Top][All Lists]
Advanced

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

core dump when using a certain Perl-compatible pattern


From: Chris Stith
Subject: core dump when using a certain Perl-compatible pattern
Date: Fri, 27 Jan 2006 11:45:59 -0600

When using this command:

grep -P '\?>\s' *

I get a core dump. Likewise with the -r option as well, as in:

grep -r -P '\?>\s' *

###################

The problem is reliably reproducible. It in fact dumps core every
single time I run it with these options and it finds something
matching. It also always dumps on files containing '?>' with no
trailing whitspace. It even dumps on a file containing only '?>'. It
does not on files containing only '?' or on a file consisting of '?
>'.


###################


my grep is:
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.


My install is via Mandriva RPM from the 2006.0 release:
# rpm -qa |grep grep
grep-2.5.1a-1mdk
rgrep-0.99.17-0.111.2mdk



###################


I also get the same behavior with a fresh build of 2.5.1a downloaded
from ftp.gnu.org and built on this platform via a simple configure and
make on this system.

# md5sum grep
f5861cf66f64970df1191309c4cc8168  grep

In the source directory for this build, it also finds many lines which
have no apparent business matching '\?>\s'. See attachment
'bad_grep.txt' for those results.


###################


My platform is:
Mandriva 2006.0 on AMD

# uname -a
Linux serverman-x 2.6.12-12mdk #1 Fri Sep 9 18:15:22 CEST 2005 i686
AMD Athlon(tm) Processor unknown GNU/Linux

####################

The processor is:

processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 6
model           : 4
model name      : AMD Athlon(tm) Processor
stepping        : 2
cpu MHz         : 1009.328
cache size      : 256 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca
cmov pat pse36 mmx fxsr syscall mmxext 3dnowext 3dnow
bogomips        : 1998.84

######################

I don't have another proper environment with which to test, but I do
have Windows. The grep 2.5.1 which is compiled as part of the GNU
ports to Windows at http://unxutils.sourceforge.net/ makes my command
prompt window scroll wildly, beep much (probably jsut embedded \cg
chars in the output), and eventually stop responding with the command:

grep -P "\?>\s" foo

where 'foo' is the name of the file containing '?>'. It seems to
behave normally with the files consisting of '?' or '? >', but it
return an exit code of 1. It seems, though, that this build of grep
always does when it completes -- even when not using the -P switch.


I wish I could offer a patch, but time and limited skills with C
prohibit. I have saved several but not all of the core files in case
those are needed. If this is a PCRE library issue, I would be happy to
make that bug report but I can only guess the grep team would have
more interesting and accurate things to tell the PCRE team than I.

Christopher E. Stith

Attachment: bad_grep.txt
Description: Text document


reply via email to

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