Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Storable core dumping...

by PodMaster (Abbot)
on Jun 29, 2004 at 21:46 UTC ( #370633=note: print w/replies, xml ) Need Help??


in reply to Storable core dumping...

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.

Replies are listed 'Best First'.
Re^2: Storable core dumping...
by devnul (Monk) on Jun 29, 2004 at 22:53 UTC
    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.

        Just a few comments:

        I don't think that $path/$name is corrupt because it would never get into this code area if there were a problem with either $path or $name (I.E. $path has to be a directory which is writable and $name has to be a valid filename).

        As I may have forgotten to mention: this is not a reproducable bug.. It happens very rarely and I've been unsuccessful in creating some snippet which would reproduce it...

        As for the "umm, yeah, whatever" comment: Some of us aren't avid C programmers and we do the best we can with what we know. If there is something else that I could do or some piece of information I could provide please let me know, but please if you are going to dis my attempt at least tell me why you are doing so. Is it so useless to look at changes between versions to try and find some evidence that your bug was resolved?

        Also, is it at all noteworthy that this is happening in perl_destruct, or is that rather inconsequential to the issue?...

        I will certainly send this on to the Perl folks, at any rate, if no resolution can be found here.... For some reason I get a queasy feeling about upgrading Storable... I'd at least like to be able to point at some code that changed which is likely to have solved this problem before doing it.....

        - Greg

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://370633]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2022-05-25 01:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (84 votes). Check out past polls.

    Notices?