develooper Front page | perl.perl5.porters | Postings from December 2013

Re: [perl #72406] Segmentation fault v5.10.1

Thread Previous | Thread Next
From:
wolfsage
Date:
December 15, 2013 15:56
Subject:
Re: [perl #72406] Segmentation fault v5.10.1
Message ID:
CAJ0K8bjo2=FaFhoYLf-bSvBvmEXJubsxZ0EMnGg1dxyk+GyEJA@mail.gmail.com
On Sun, Dec 15, 2013 at 2:10 AM, Father Chrysostomos <sprout@cpan.org> wrote:
> Bisecting seems impossible, as the crash is intermittent.  My read-
> ing of the source code suggests this has been present in some form or
> another since perl 5.000.
>

I bisected with this:

  $ cat crash.pl
  #!/usr/bin/perl

  use strict;
  use warnings;

  use File::Temp;

  my $code = <<'EOF';
          { package o; use overload bool => sub { exit unless $::ok++;
return 1 }
  }
  use constant OK => bless [], o::;
  do{print("foobar");}until OK;
  exit;
  __END__
  EOF

  my ($fh, $name) = File::Temp::tempfile;
  print $fh $code;
  close $fh;

  for (1..50) {
          if (system("./perl -Ilib $name")) {
                  print "it broke\n";
                  exit 1;
          }
  }

  print "Things look fine\n";
  exit;

And when running (i've since lost the output):

 $ ../perl-1/Porting/bisect.pl --start perl-5.8.8 --end perl-5.10.1 -j
4 /usr/bin/perl ~/crash.pl

It ended telling me two commits it could possibly be but it skipped
them for some reason.

I tried b7f7fd0bbdc7d1d714e682f9a3250ab7d97ac560~1 vs
b7f7fd0bbdc7d1d714e682f9a3250ab7d97ac560 and it seemed fine before
b7f7fd0bbdc (though I didn't check with valgrind), but after applying
b7f7fd0bbdc I consistently got:

  $ cat ~/break.pl
          { package o; use overload bool => sub { exit unless $::ok++;
return 1 } }
  use constant OK => bless [], o::;
  do{print("foobar");}until OK;

  $ ./perl -Ilib/ ~/break.pl
  panic: fold_constants JMPENV_PUSH returned 2 at
/home/mhorsfall/break.pl line 1.

The commit:

  $ git show b7f7fd0bbdc7d1d714e682f9a3250ab7d97ac560
  commit b7f7fd0bbdc7d1d714e682f9a3250ab7d97ac560
  Author: Nicholas Clark <nick@ccl4.org>
  Date:   Mon Mar 27 19:25:02 2006 +0000

      If constant folding fails, don't fold constants, rather than reporting
      the error at compile time. This allows illegal constant expressions in
      dead code to be ignored.

      p4raw-id: //depot/perl@27615

Hope that helps.

-- Matthew Horsfall (alh)

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About