[Israel.pm] segmentation fault in regex

Shlomi Fish shlomif at iglu.org.il
Sun Mar 12 05:04:14 PST 2006


On Sunday 12 March 2006 14:38, Shlomi Fish wrote:
> Interesting. I am able to reproduce the segfault on my Mandriva Linux 2006
> machine running perl-5.8.7-3.2.20060mdk.
>
> I was able to simplify the program to:
>
> <<<<<<<<<<<
> #! /usr/local/bin/perl -w
> my $name=shift;
> open (FILE,$name) or die "BLA\n";
> local $/;
> my $file=<FILE>;
> close(FILE);
> print "$name\n";
> $file =~
> s{"(\\.|[^"\\])*"|'(\\.|[^'\\])*'}{}gs;
>
>
> Now, I'll work on minimising the file.
>

OK, I was able to minimise the segfaulting program to:

<<<<<<<<<<<<<<<<
use strict;
use warnings;
my $string = qq{'} . "hello" x 10_000;
print "A\n";
$string =~ s{a|'(?:\\.|[^'\\])*'}{};
print "B\n";
>>>>>>>>>>>>>>>>

Regards,

	Shlomi Fish

> Regards,
>
> 	Shlomi Fish
>
> On Sunday 12 March 2006 14:06, Yossi.Itzkovich at ecitele.com wrote:
> > OK, let's try.
> >
> > The file is at ftp://ftp.ecitele.com/outgoing/inf_vie.htm
> >
> >
> >
> > The code:
> > #! /usr/local/bin/perl -w
> > my $name=shift;
> > open (FILE,$name) or die "BLA\n";
> > local $/;
> > my $file=<FILE>;
> > print "$name\n";
> > $file=~
> > s~/\*[^*]*\*+([^/*][^*]*\*+)*/|//[^\n]*|(\"(\\.|[^\"\\])*\"|'(\\.|[^'\\])
> >*'
> >
> >|.[^/"'\\]*)~$2~gs;
> >
> > Any ideas ?
> >
> > Yossi
> >
> >
> >
> >
> >
> > _______________________________________________
> > Perl mailing list
> > Perl at perl.org.il
> > http://perl.org.il/mailman/listinfo/perl

-- 

---------------------------------------------------------------------
Shlomi Fish      shlomif at iglu.org.il
Homepage:        http://www.shlomifish.org/

95% of the programmers consider 95% of the code they did not write, in the
bottom 5%.



More information about the Perl mailing list