Trivial test script crashes perl

YONETANI Tomokazu qhwt+dfly at
Sun Aug 27 19:08:54 PDT 2006

On Sun, Aug 27, 2006 at 10:21:38PM -0400, Justin C. Sherrill wrote:
> On Sun, August 27, 2006 6:32 pm, walt wrote:
> > This is a followup to my post about pkgsrc packages failing
> > because of perl crashes.  I've spent a few days trying to
> > narrow down the cause, and the attached perlscript is my
> > best effort.  {I think of it as perl haiku ;o)
> >
> > Just run 'perl' and watch for the error.
> >
> I got no output (as it should be) but no crash on OS X 10.4 or DragonFly
> 1.4.4.  The regex you are using matches zero or more incidences of: either
> any single character preceded by a backslash, or any character that isn't
> a backslash, and it does so maximally.  It produces two matches because of
> the parentheses: the whole string, and 'y'.

You may have to try with longer $str, it needed 2416 bytes
on my mail server(running 1.4.4 with 512MBytes of RAM) for it
to dump core:

$str = "x" x 2416;
if ($str =~ /((\\.|[^\\])*)/) {}

More information about the Bugs mailing list