On 18 Feb 2002, raptor wrote:

> Date: 18 Feb 2002 12:56:36 +0200
> From: raptor <[EMAIL PROTECTED]>
> To: modperl <[EMAIL PROTECTED]>
> Subject: Storable segfaulting
>
> hi,
>
>
> I have object that inherit Storable... so I store the object.. later
> when I try to "retrieve" the object I get :
>
> Segmentation fault (11)
>
> Mandrake 8.1, Storable 1.012
>
> Can u help me .....

This may have to do with Bugid 20020221.007 which I submitted to perlbug a
couple of days ago:
http://bugs.perl.org/_perlbug.cgi?req=bug_id&bug_id=20020221.007&format=H&trim=25&range=412

The short summary is that a scalar object consisting of an empty
string (but not undef) stored and retrieved by Storable will cause a
segmentation fault/SEGV/Bus error at a point soon after the retrieval.
This occurs regardless of whether the primary reference you store is
the object or another object/reference such as a hash or array that
contains the object.  The simplest test case I've come up with is:

#####################################################
#! /usr/bin/perl
use Storable;

package TestString;
sub new {
    my ($type, $string) = @_;
    return bless(\$string, $type);
};

1;

my $empty_string_obj = TestString->new('');
my $clone = Storable::dclone($empty_string_obj);
#####################################################

You might want to check if you're doing something similar in your code
(and ending up with an empty string object isn't that hard to do).  If
you're not it may indicate a different bug or just that the bug goes
deeper than I thought.


-- 
Jonathan Conway                                               [EMAIL PROTECTED]

Not only is there no accounting for taste, there is no accounting for what can
happen when entirely new tech meets bad taste.             [John P. Caplinger]

Reply via email to