http://www.perlmonks.org?node_id=370642


in reply to Re: Storable core dumping...
in thread Storable core dumping...

I was under the impression that you cannot (err, should not) upgrade Storable without upgrading Perl at the same time.. Is that not the case?..

Also, I am not sure if it is failing during a read or a write, but according to the stack trace I'd say probably more likely a write...

Here is the code for writing:
my @vals=(\@someArray,\%someHash); my $res=store(\@vals,"$path/$name");
Here is some code for reading:
my @someArray = (); my %someHash = (); my $res=retrieve("$path/$name"); if($res) { my ($tmp1, $tmp2) = @$res; if($tmp1) { @someArray = @$tmp1; } if($tmp2) { %someHash = %$tmp2; } }
I started doing diff on storable.xs and am pretty sure that it must be failing inside magic_write, somewhere around this line:
WRITE(header, length);
Interestingly this was changed in 2.07 to:
WRITE( (unsigned char*) header, length);
The WRITE #define has been unchanged, even up to version 2.13:
#define WRITE(x,y) \ STMT_START { \ if (!cxt->fio) \ MBUF_WRITE(x,y); \ else if (PerlIO_write(cxt->fio, x, y) != y) \ return -1; \ } STMT_END
I'm not a C programmer so I'm not sure what relevance any of this has, could this be the source of the problem?... I can't find in the ChangeLog why that particular change was made and don't really know what it does...

Any ideas?...