develooper Front page | perl.perl5.porters | Postings from February 2009

[perl #63150] 5.8.9 panic restartop on certain goto

Thread Next
From:
Bram via RT
Date:
February 15, 2009 09:25
Subject:
[perl #63150] 5.8.9 panic restartop on certain goto
Message ID:
rt-3.6.HEAD-12283-1234610385-77.63150-15-0@perl.org
On Tue Feb 10 16:38:05 2009, kryde wrote:
> The program foo.pl below run in my build of 5.8.9 ends with
> 
>     panic: restartop
> 
> where I hoped it would get to the "done" print.
> 
> foo.pl is a cut-down version of my Tie::TZ module version 4 on cpan.
> The problem might be specific to perl 5.8.9.  foo.pl is ok for me in
> debian packaged 5.10.0, and cpantesters reports say the module is ok
> in
> 5.8.8, but not 5.8.9 (across various systems).
 
It seems to be a specific 5.8.9 problem.. (or maybe the bug is hiding 
in blead/maint-5.10)


Binary search on maint-5.8:

----Program----
package MyTie;
use strict;
use warnings;
use POSIX ();

use vars qw($TZ);
tie $TZ, __PACKAGE__;

my $my_tzset;

sub TIESCALAR {
my ($class) = @_;
my $self = 'dummy';
return bless \$self, $class;
}

sub FETCH {
#print "fetch\n";
return 'abc';
}

sub STORE {
my $self = shift;
my $newval = shift;
#print "store ",(defined $newval ? $newval : 'undef'),"\n";

#print " goto tzset() $my_tzset\n";
goto $my_tzset;
}

$my_tzset = sub {
#print " my_tzset runs\n";
$my_tzset = \&POSIX::tzset;
};

package main;
use strict;
use warnings;

eval {
#print "start of eval\n";
local $MyTie::TZ = 'GMT';

#print "\nnow die\n";
die;
};
#print "done\n";

----Output of .../pf9c33q/perl-5.8.8@30127/bin/perl----

----EOF ($?='0')----
----Output of .../pwc3FWG/perl-5.8.8@30130/bin/perl----
panic: restartop

----EOF ($?='0')----


Change http://public.activestate.com/cgi-bin/perlbrowse/p/30130:
Integrate:
	[ 24535]
	[perl #35878] goto &xsub that croaks corrupts memory
	When an XS sub is called, a CxSUB context shouldn't be pushed. 
Make
	goto &xs_sub mimic this behaviour by first popping the old CxSUB
	
	[ 24642]
	add pointer to email explaining why eval {goto &foo} is banned


Change 24642 is only a comment so I did a binary search around 24535 in 
blead:

24534-24535:
----Output of .../ph0SWHo/perl-5.9.2@24534/bin/perl----

----EOF ($?='0')----
----Output of .../pmzeyzN/perl-5.9.2@24535/bin/perl----

----EOF ($?='0')----


24535-34126:
----Output of .../pmzeyzN/perl-5.9.2@24535/bin/perl----

----EOF ($?='0')----
----Output of ...prQOzxg/perl-5.10.0@34126/bin/perl----

----EOF ($?='0')----



Perhaps a missing integrate in maint-5.8?


Kind regards,

Bram

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