Chris Stith wrote:
When using this command:
grep -P '\?>\s' *
I get a core dump.
Thanks for the report. Unfortunately, with that "*", that's not a complete
reproduction recipe. Presumably "*" matches the file that you attached, but
what else? I don't get a seg-fault when "*" matches only the file that you
attached:
$ grep-2.5.1/src/grep -P '\?>\s' bad_grep.txt
foo:?>
bin/sh
(The '\s' matches the newline at the end of the first line, and so the second
line is also printed. I don't know whether that's correct behaviour.)
However, by my own, simplified reproduction recipe, I can confirm that a bug
that is probably this one existed in v2.5.1, and is already fixed in CVS. My
test cases for it look like this:
$ echo '?> ' | grep-2.5.1/src/grep -P '\?>\s'
?>
$ echo '?>' | grep-2.5.1/src/grep -P '\?>\s'
Segmentation fault
$ echo '?>' | grep -P '\?>\s'
?>
(The third command is running Grep built from CVS in the last few weeks.)
So I consider this bug to be fixed unless shown otherwise.
- Julian