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: 81776
Status: open
Priority: 0/
Queue: Storable

People
Owner: Nobody in particular
Requestors: slavi [...] imperia.bg
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.20
Fixed in: (no value)



Subject: Storable misinterprets scalars as globs.
Download (untitled) / with headers
text/plain 958b
This issue happens with perl 5.10.x and any Storable newer than 2.20 (or even with older ones.). Storable uses its own way of finding the type of an SV instead of using perl's sv_reftype(). Sometimes it can misinterpret scalar values as globs and it will refuse to freeze/dclone them. If SvTYPE(sv) returns SVt_PVGV Storable directly gives up, but the check for glob should be more refined (see the attached patch) - this is exactly what Perl_sv_reftype() does: ... case SVt_PVGV: return (char *) (isGV_with_GP(sv) ? "GLOB" : "SCALAR"); ... In the case of Storable's sv_type() this translates to adding a check for SVt_PVGV: ... #if PERL_VERSION >= 10 case SVt_PVGV: return isGV_with_GP(sv) ? svis_OTHER : svis_SCALAR; #endif ... See for example this change: http://www.nntp.perl.org/group/perl.perl5.changes/2008/06/msg21927.html A lot of checks for globs are fixed there using isGV_with_GP().
Subject: Storable.patch
Download Storable.patch
text/x-diff 429b
diff --git a/ext/Storable/Storable.xs b/ext/Storable/Storable.xs index 2741c7d..b3e9f7d 100644 --- a/ext/Storable/Storable.xs +++ b/ext/Storable/Storable.xs @@ -3482,6 +3482,10 @@ static int sv_type(pTHX_ SV *sv) return svis_HASH; case SVt_PVCV: return svis_CODE; +#if PERL_VERSION >= 10 + case SVt_PVGV: + return isGV_with_GP(sv) ? svis_OTHER : svis_SCALAR; +#endif #if PERL_VERSION > 8 /* case SVt_BIND: */ #endif
From: svetlyo [...] gmail.com
The issue happens with perl 5.10.x _and newer_.


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.