Thanks for the detailed report, Chris. It seems that this bug is fixed in the CVS. Using the CVS grep:
> echo \? | ./grep -P '\?\s' ? > Could you try your test cases with the CVS version? You may download the CVS version from: http://savannah.gnu.org/cvs/?group=grep If you don't wish to build grep from the CVS, you may download a nightly build from: http://www.dal-acm.ca/~taa/grep/ Cheers, TAA ----------------------------------------------------- Tony Abou-Assaleh Lecturer, Computer Science Department Brock University, St. Catharines, ON, Canada, L2S 3A1 Office: MC J215 Tel: +1(905)688-5550 ext. 5243 Fax: +1(905)688-3255 Email: [EMAIL PROTECTED] WWW: http://www.cosc.brocku.ca/~taa/ ----------------------[THE END]---------------------- On Fri, 27 Jan 2006, Chris Stith wrote: > The options > > # grep -P '\?\s' filename > > segfaults and coredumps when the file consists of the single character '?'. > > ############### > > I got this from gdb: > > # gdb --args /bin/grep -P '\?\s' bar > GNU gdb 6.3-5mdk (Mandriva Linux release 2006.0) > Copyright 2004 Free Software Foundation, Inc. > GDB is free software, covered by the GNU General Public License, and you are > welcome to change it and/or distribute copies of it under certain conditions. > Type "show copying" to see the conditions. > There is absolutely no warranty for GDB. Type "show warranty" for details. > This GDB was configured as "i586-mandriva-linux-gnu"...(no debugging > symbols found) > Using host libthread_db library "/lib/tls/libthread_db.so.1". > > (gdb) run > Starting program: /bin/grep -P \\\?\\s bar > Reading symbols from shared object read from target memory...(no > debugging symbols found)...done. > Loaded system supplied DSO at 0xffffe000 > (no debugging symbols found) > (no debugging symbols found) > > Program received signal SIGSEGV, Segmentation fault. > 0xb7ef5c4a in pcre_exec () from /lib/libpcre.so.0 > (gdb) q > > > ############### > > This PHP program works as expected: > <?php > $file = $argv[1]; > $content = file_get_contents ( $file ); > if ( preg_match ( '/\?>\s/', $content ) ) { > print 'matched!' . "\n"; > } > ?> > > PHP uses PCRE for the Perl-compatible regex functions it offers. > > ################ > > I hope this helps. > >
