Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Storable CPAN distribution.

Report information
The Basics
Id: 59531
Status: open
Priority: 0/
Queue: Storable

People
Owner: Nobody in particular
Requestors: adam_lounds [...] hotmail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.21
Fixed in: (no value)



Subject: Segfault if STORABLE_freeze returns '' as first value
was using this code: sub STORABLE_freeze { my ( $self, $cloning ) = @_; return if $cloning; my $copy = { %$self }; delete $copy->{dao}; return ( '', $copy ); } and thaw segfaults, no matter what the STORABLE_thaw sub. The following code doesn't - the only difference is the value of the first return value. sub STORABLE_freeze { my ( $self, $cloning ) = @_; return if $cloning; my $copy = { %$self }; delete $copy->{dao}; return ( 'dummy', $copy ); }
On Mon Jul 19 08:36:32 2010, adam_lounds@hotmail.com wrote: Show quoted text
> was using this code: > sub STORABLE_freeze { > my ( $self, $cloning ) = @_; > return if $cloning; > my $copy = { %$self }; > delete $copy->{dao}; > return ( '', $copy ); > } > > and thaw segfaults, no matter what the STORABLE_thaw sub. The following > code doesn't - the only difference is the value of the first return > value. > > sub STORABLE_freeze { > my ( $self, $cloning ) = @_; > return if $cloning; > my $copy = { %$self }; > delete $copy->{dao}; > return ( 'dummy', $copy ); > }
I've been trying to reproduce this, both with my Storable development branch and with older versions of perl, but haven't been able to reproduce it. Do you have a complete example that demonstrates it? Also, please let me know what version of perl and Storable you are (or were) using when you encountered this problem. Storable has included a test for a zero-length string return from STORABLE_freeze(), both freezing and thawing the object since around 0.7.0. Thanks, Tony
On Tue Dec 05 18:37:18 2017, TONYC wrote: Show quoted text
> I've been trying to reproduce this, both with my Storable development > branch and with older versions of perl, but haven't been able to > reproduce it.
While I couldn't reproduce your crash, I could reproduce the problem in https://rt.perl.org/Ticket/Display.html?id=118551 which might be related to yours.q I've fixed that in my working branch and it may also fix your problem. Tony