Subject: | segfaults when called during global destruction |
This is apparently an old problem that went under the radar. It was
already reported in May, 2005 in
http://www.mail-archive.com/perl5-porters@perl.org/msg86928.html, but
nobody could reproduce it at the time. Also it was discussed on
http://www.perlmonks.org/?node_id=651966.
I have tried the attached test in at least 4 different architectures
(i386, ia64, armel and sparc64) in Debian, and also tried FreeBSD,
RedHat, Mandriva and Gentoo. In every try, I got a segfault like this:
$ perl test.pl
Destroying Foo=HASH(0x6000000000009630), bar=baz at test.pl line 17
during global destruction.
Segmentation fault
$ uname -a
Linux merulo 2.6.18-dsa-mckinley #1 SMP Mon Feb 11 09:57:09 MST 2008
ia64 GNU/Linux
This seems to be the cause of -at least-
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=315669
Thanks.
Subject: | test.pl |
#!/usr/bin/perl
use strict;
use warnings;
our $a = new Foo();
$a->{bar} = "baz";
package Foo;
use Storable;
sub new {
return bless({}, "Foo");
}
sub DESTROY {
my $this = shift;
warn "Destroying $this, bar=$this->{bar}";
my $f = Storable::freeze($this);
}