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: 37181
Status: new
Priority: 0/
Queue: Storable

People
Owner: Nobody in particular
Requestors: jleader [...] alumni.caltech.edu
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in:
  • 2.13
  • 2.14
  • 2.15
  • 2.16
  • 2.17
  • 2.18
Fixed in: (no value)



Subject: $Storable::accept_future_minor default value doesn't take effect until second retrieval
Download (untitled) / with headers
text/plain 1.5k
$Storable::accept_future_minor is supposed to default to 1, but on the first call to retrieve, the code behaves as if it is 0. Walking through Storable.xs, I figured out why. In Storable.xs, magic_check fetches $Storable::accept_future_minor and stores it in ctxt->accept_future_minor if the latter was set to -1. init_retrieve_context initializes it to that value. Unfortunately, do_retrieve calls magic_check before it calls init_retrieve_context, so at that point, ctxt->accept_future_minor is still 0. A work-around for this bug is to retrieve a dummy file before the first attempt to retrieve a file which might have a future minor version, like so: BEGIN { Storable::thaw(Storable::nfreeze({})); }; This will cause init_retrieve_context to get called, so that later when the future-versioned file is retrieved, ctxt->accept_future_minor is -1, and the code behaves as intended. A fix would be to initialize ctxt->accept_future_minor to -1 earlier, right before the call to magic_check on line 6119 of Storable.xs. I first found this bug in Storable-2.13, trying to read a file created by Storable-2.15, but I've confirmed that code is the same in 2.18 as well, so the next time the format minor version is bumped, this will bite people again. I found the problem with Perl-5.8.6 and Perl-5.8.8, but I don't think it's dependent on the version of Perl. "uname -a" is probably similarly irrelevant, but here it is just in case: Linux jleader.sys.corp.oversee.net 2.6.18-53.1.21.el5 #1 SMP Tue May 20 09:34:18 EDT 2008 i686 i686 i386 GNU/Linux


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.