Subject: | Segfault when restoring blessed reference to overloaded object |
Storable is segfaulting when restoring a serialized blessed reference to
overloaded object. This happens with a blessed reference to a DateTime
object. This happens on Perl 5.8 and Storable 2.18. On Perl 5.10, it
prints the following message:
sv_upgrade from type 8 down to type 4 at ../../lib/Storable.pm
(autosplit into ../../lib/auto/Storable/thaw.al) line 415, at
overload.pl line 6
I have attached a script which produces the problem.
Subject: | overload.pl |
#!/usr/local/bin/perl58
use Storable qw/ freeze thaw /;
my $bar = Bar->new();
thaw(freeze($bar));
package Bar;
sub new { return bless \Foo->new(), 'Bar'; }
package Foo;
use overload
'-' => \&mysub;
sub new { return bless {}, 'Foo' }
sub mysub {
return 1;
}