Skip Menu |
Report information
Id: 4864
Status: resolved
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: andk <andreas.koenig [at] anima.de>
Cc:
AdminCc:

Operating System: Linux
PatchStatus: (no value)
Severity: medium
Type: core
Perl Version: 5.7.0
Fixed In: (no value)



To: perlbug [...] perl.org, Raphael Manfredi <Raphael_Manfredi [...] pobox.com>
Subject: Storable: Cannot restore overloading on SCALAR(0x90e1638)
From: andreas.koenig [...] anima.de (Andreas J. Koenig)
Date: 06 Dec 2000 14:53:28 +0100
Download (untitled) / with headers
text/plain 3.7k
This is a bug report for perl from k@ak-71.mind.de, generated with the help of perlbug 1.33 running under perl v5.7.0. ----------------------------------------------------------------- [Please enter your report here] From time to time I get this error from Storable: Cannot restore overloading on SCALAR(0x90e1638) at ../../lib/Storable.pm (autosplit into ../../lib/auto/Storable/fd_retrieve.al) line 295 It happened just now again with Storable 1.0.6 and perl 5.7.0@7936 within a mod_perl process which I use with Apache::Session. When this happens, I usually just have to reload the page and another mod_perl process then succeeds in retrieving the very same session file. When I then cycle through all mod_perl processes and hit the same that failed before, it works (I mean it is able to read the same session file). It doesn't happen often. Needless to say that I have no idea how to write a test case for this error, but I'm increasing the amount of debugging code for the next time this hits me. Right now I'm not even sure if the session data contain overloaded scalars but I believe yes. Any guesses? This has never, really, really never occurred with Storable 0.603. I have seen it about since Storable is in the core but didn't report--my bad. -- andreas [Please do not change anything below this line] ----------------------------------------------------------------- --- Flags: category=library severity=medium --- Site configuration information for perl v5.7.0: Configured by k at Fri Dec 1 05:23:13 CET 2000. Summary of my perl5 (revision 5.0 version 7 subversion 0) configuration: Platform: osname=linux, osvers=2.2.16a, archname=i686-linux uname='linux ak-71.mind.de 2.2.16a #1 smp wed jun 14 11:59:53 cest 2000 i686 unknown ' config_args='-Dprefix=/usr/local/perl-5.7.0@7936 -Doptimize=-g -des -Dusedevel' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef Compiler: cc='cc', ccflags ='-DDEBUGGING -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-g', cppflags='-DDEBUGGING -fno-strict-aliasing -I/usr/local/include' ccversion='', gccversion='egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=4, usemymalloc=n, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt -lutil perllibs=-lnsl -ldl -lm -lc -lposix -lcrypt -lutil libc=/lib/libc-2.1.3.so, so=so, useshrplib=false, libperl=libperl.a Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic' cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib' Locally applied patches: DEVEL7928 --- @INC for perl v5.7.0: /usr/local/perl-5.7.0@7936/lib/5.7.0/i686-linux /usr/local/perl-5.7.0@7936/lib/5.7.0 /usr/local/perl-5.7.0@7936/lib/site_perl/5.7.0/i686-linux /usr/local/perl-5.7.0@7936/lib/site_perl/5.7.0 /usr/local/perl-5.7.0@7936/lib/site_perl . --- Environment for perl v5.7.0: HOME=/home/k LANG=en_US LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/home/k/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/local/perl/bin:/usr/X11/bin:/sbin:/usr/sbin:/usr/local/Office51/bin PERL_BADLANG (unset) SHELL=/bin/zsh
Date: Wed, 6 Dec 2000 20:02:07 +0100
From: Raphael Manfredi <Raphael_Manfredi [...] pobox.com>
To: "Andreas J. Koenig" <andreas.koenig [...] anima.de>
Cc: perlbug [...] perl.org
Subject: Re: [ID 20001206.008] Storable: Cannot restore overloading on SCALAR(0x90e1638)
Quoting Andreas J. Koenig: : It happened just now again with Storable 1.0.6 and perl 5.7.0@7936 : within a mod_perl process which I use with Apache::Session. When this : happens, I usually just have to reload the page and another mod_perl : process then succeeds in retrieving the very same session file. When I : then cycle through all mod_perl processes and hit the same that failed : before, it works (I mean it is able to read the same session file). It : doesn't happen often. Needless to say that I have no idea how to write : a test case for this error, but I'm increasing the amount of debugging : code for the next time this hits me. Right now I'm not even sure if : the session data contain overloaded scalars but I believe yes. : : Any guesses? Yes, it probably means the package defining the overloading magic was not "require'd" or "use'd" yet, and so Storable has no way to find the "stash" (or it finds it, but it does not has the proper magic indicating overloading). Since the scalar was stored with "overloading" magic, Storable croaks because it cannot restore it at retrieve time, meaning you would not get what you stored. A no-no by my book! Try this patch (compiles, but untested): --- Storable.xs 2000/11/05 17:21:24 1.0.1.5 +++ Storable.xs 2000/12/06 18:59:20 @@ -3375,9 +3377,10 @@ stash = (HV *) SvSTASH (sv); if (!stash || !Gv_AMG(stash)) - CROAK(("Cannot restore overloading on %s(0x%"UVxf")", + CROAK(("Cannot restore overloading on %s(0x%"UVxf") (package %s)", sv_reftype(sv, FALSE), - PTR2UV(sv))); + PTR2UV(sv), + stash ? HvNAME(stash) : "<unknown>")); SvAMAGIC_on(rv); It will not make it work, but it should tell you in which package the scalar expects its magic. Then you will be able to determine whether it was already require'd or not. : This has never, really, really never occurred with Storable 0.603. I : have seen it about since Storable is in the core but didn't report--my : bad. No wonder: overloading was never stored nor retrieved by then. ;-) Raphael
To: Raphael Manfredi <Raphael_Manfredi [...] pobox.com>
Cc: "Andreas J. Koenig" <andreas.koenig [...] anima.de>, perlbug [...] perl.org
Subject: Re: [ID 20001206.008] Storable: Cannot restore overloading on SCALAR(0x90e1638)
From: andreas.koenig [...] anima.de (Andreas J. Koenig)
Date: 06 Dec 2000 22:10:11 +0100
Download (untitled) / with headers
text/plain 1.8k
Show quoted text
>>>>> On Wed, 6 Dec 2000 20:02:07 +0100, Raphael Manfredi <Raphael_Manfredi@pobox.com> said:
Show quoted text
> Since the scalar was stored with "overloading" magic, Storable croaks > because it cannot restore it at retrieve time, meaning you would not get > what you stored. A no-no by my book!
Show quoted text
> Try this patch (compiles, but untested):
Show quoted text
> --- Storable.xs 2000/11/05 17:21:24 1.0.1.5 > +++ Storable.xs 2000/12/06 18:59:20 > @@ -3375,9 +3377,10 @@
Show quoted text
> stash = (HV *) SvSTASH (sv); > if (!stash || !Gv_AMG(stash)) > - CROAK(("Cannot restore overloading on %s(0x%"UVxf")", > + CROAK(("Cannot restore overloading on %s(0x%"UVxf") (package %s)", > sv_reftype(sv, FALSE), > - PTR2UV(sv))); > + PTR2UV(sv), > + stash ? HvNAME(stash) : "<unknown>"));
Show quoted text
> SvAMAGIC_on(rv);
Show quoted text
> It will not make it work, but it should tell you in which package the scalar > expects its magic. Then you will be able to determine whether it was already > require'd or not.
This is a great patch and now I also know how to reproduce it: setting MaxRequestPerChild to a low value. Because then we more often than usual we talk to a child that has not yet loaded the associated magic because it is a "virgin" module. With your patch I get: Cannot restore overloading on SCALAR(0x90dab14) (package URI::http) at blib/lib/Storable.pm (autosplit into blib/lib/auto/Storable/fd_retrieve.al) line 297, at /usr/local/apache/lib/map_box/aplan.pm line 552 which clearly indicates what I have to do before trying to retrieve the session. Show quoted text
> : This has never, really, really never occurred with Storable 0.603. I > : have seen it about since Storable is in the core but didn't report--my > : bad.
Show quoted text
> No wonder: overloading was never stored nor retrieved by then. ;-)
;-) Thanks!
The patch will be in the next Storable release.


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

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org