Perl586SegvRegex

I've managed to track down a problem with Perl 5.8.6 (perl-5.8.6-18, RPM on Redhat Fedora 4 with kernel 2.6.13-1.1526_FC4). Essentially, it causes the Perl process to abort with a Segmentation Violation (SEGV). There's no way to stop Perl doing this (meaning you can't put the offending code in an eval() or anything).

The problem seems to be in running a fairly simple regex on a specific string of data. I don't know exactly what the string of data is, but I have a file that causes the problem.

The code that causes the problem (and the regex that works) is shown below:

while(<FILE>)

 {<br />
    my $line=$_;<br />
    $count++;<br />
    $line=~s/[[\000]+//g;            # Causes a [[SEGV]]<br />
    #$line=~s/[[\000]//g;            # Works fine<br />
 }7

I've attached a Tar archive with the code and the file that breaks Perl on this page. Have fun!

UPDATE 5th December:
I logged a bug with perlbug, which was dispatched to the bug tracking facility at 11:25:22 PM on the 4th December. I've just had notice that the problem has been resolved (so will presumably be in the next release) at 4:55:55 PM on the 5th December. That bug was open for a total of 17 hours - incredible! Now find me a commercial support contract that good!

Top Job! to all the Perl developers, in particular Dave Mitchell, Nicholas Clark, Tomoyuki Sadahiro andRafael Garcia-Suarez for getting it sorted so unbelievably quickly.
(:biggrin:)

AttachmentSize
segv.tgz2.53 KB