| View previous topic :: View next topic |
| Author |
Message |
ljgibson n00b

Joined: 06 Nov 2004 Posts: 9 Location: Florida
|
Posted: Wed Jul 13, 2005 1:45 am Post subject: Segmentation fault doing grep -P |
|
|
I can consistently make grep crash on my two Gentoo machines. Would anyone be interested in trying this to see if they're getting this too?
Create a text file with a couple of lines like this:
| Code: |
230 0 0.000000 58 0 0.000000
230 1 0.000000 58 0 0.000000
|
(All the whitespace you see are space characters.)
Then I use grep on the file:
| Code: |
grep -P '^\s*\d+\s+\d+\s+0\.000000\s+\d+\s+\d+\s+0\.000000\s*$' myfile.txt
|
grep's output is:
| Code: |
230 0 0.000000 58 0 0.000000
230 1 0.000000 58 0 0.000000
Segmentation fault
|
If I remove the '$' from the pattern supplied to grep, the crash doesn't occur. However, grep -P '^.*$' myfile.txt will not cause grep -P to crash for me.
Does anyone else get results like this? Would it be appropriate to submit this to bugzilla? |
|
| Back to top |
|
 |
BitJam Advocate

Joined: 12 Aug 2003 Posts: 2513 Location: Silver City, NM
|
Posted: Wed Jul 13, 2005 2:27 am Post subject: |
|
|
| I've got grep-2.5.1-r1 installed and it doesn't accept the -P option. No segfault. |
|
| Back to top |
|
 |
ljgibson n00b

Joined: 06 Nov 2004 Posts: 9 Location: Florida
|
Posted: Wed Jul 13, 2005 2:37 am Post subject: |
|
|
I didn't remember to post my build information. I'm using grep 2.5.1-r7. nls and pcre use flags were set when I emerge'd grep. (I believe the pcre use flag must be set in order for grep to use perl regex's.)
I just reproduced the same crash on a RH 9 system which has version 2.5.1 of grep. |
|
| Back to top |
|
 |
limn l33t

Joined: 13 May 2005 Posts: 997
|
Posted: Wed Jul 13, 2005 3:07 pm Post subject: |
|
|
Reproduced the error and clearly it is related to the anchor as you noted.
| ljgibson wrote: | | Would it be appropriate to submit this to bugzilla? |
Probably this is an upstream bug, but perhaps you should start there. |
|
| Back to top |
|
 |
|