devnul has asked for the wisdom of the Perl Monks concerning the following question:

Hello,

I am having a problem with Storable core-dumping...
OS: Solaris (Sparc) 5.8
Perl: 5.8.0
Storable: 2.0.4


.. it is being used inside of EmbPerl...
(gdb) bt #0 0xff170620 in memcpy () from /usr/platform/SUNW,UltraAX-MP/lib/libc_psr.so.1 #1 0xfef97714 in magic_write () from /usr/local/lib/perl5/5.8.0/sun4-solaris/auto/Storable/Storabl +e.so #2 0xfef97834 in do_store () from /usr/local/lib/perl5/5.8.0/sun4-solaris/auto/Storable/Storabl +e.so #3 0xfef979ac in net_mstore () from /usr/local/lib/perl5/5.8.0/sun4-solaris/auto/Storable/Storabl +e.so #4 0xfef9c304 in XS_Storable_net_mstore () from /usr/local/lib/perl5/5.8.0/sun4-solaris/auto/Storable/Storabl +e.so #5 0x7c4bc in Perl_pp_entersub () #6 0x74670 in Perl_runops_standard () #7 0x27ca8 in S_call_body () #8 0x279a4 in Perl_call_sv () #9 0x85250 in Perl_sv_clear () #10 0x85998 in Perl_sv_free () #11 0x7d878 in do_clean_objs () #12 0x7d7c0 in S_visit () #13 0x7d9ac in Perl_sv_clean_objs () #14 0x24f68 in perl_destruct () #15 0x23f08 in main ()

Any idea what might be causing this and what I can do?...

- Greg

Replies are listed 'Best First'.
Re: Storable core dumping...
by PodMaster (Abbot) on Jun 29, 2004 at 21:46 UTC
    Any idea what might be causing this and what I can do?...
    You can google for the error message, and you might get lucky, but if you don't, the only way to get good feedback is to submit a short piece of code which reproduces the bug.

    update: Also, UPGRADE YOUR STORABLE (latest version is Storable-2.13) and see if that fixes it (no point in debugging outdated code).

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

      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?...
        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?..
        That is not the case. I upgrade core (albeit generally only ones which are distributed separately on CPAN) modules every day and so should you (for example, File::Spec is continually being improved).
        ...my $res=retrieve("$path/$name");...
        It could very well be that $path/$name is corrupt somehow, but how would anyone except you reproduce that?
        I started doing diff on storable.xs and am pretty sure that it must be ...
        Um, yeah, whatever. Did you try your code with the newest storable? Did it work? Did you try regenerating $path/$name? Does it still break (with the newest storable)? If you still can't get it to work try contacting the perl Storable people (perl5-porters at at at at at at at at at at at at at at at at at at at perl.org), and be sure to send them a self-contained snippet which reproduces the bug (including a copy of your storable file).

        Good luck

        MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
        I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
        ** The third rule of perl club is a statement of fact: pod is sexy.