Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: Storable core dumping...

by devnul (Monk)
on Jun 29, 2004 at 22:53 UTC ( #370642=note: print w/ replies, xml ) Need Help??


in reply to Re: Storable core dumping...
in thread Storable core dumping...

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?...


Comment on Re^2: Storable core dumping...
Select or Download Code
Re^3: Storable core dumping...
by PodMaster (Abbot) on Jun 29, 2004 at 23:54 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?..
    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
        I don't think that $path/$name is corrupt ...
        $path/$name is your storable file, I'm saying maybe its contents are corrupt.
        As for the "umm, yeah, whatever" comment: Some ...
        I'm not an avid c programmer either, but that's besides the point. The last thing I want to do is touch C code, especially someone elses C code, especially since I might not have to. You're using an old perl with an old storable and you're having a segfault. You should try upgrading before you even think about debugging the C code in the background. s~umm, yeah, whatever~can't help you there~
        Also, is it at all noteworthy that this is happening in perl_destruct, or is that rather inconsequential to the issue?...
        Heh :) Did you try to upgrade (how about trying out those combinations I mentioned and see if something breaks -- you could even try upgrading perl)? Does it segfault before or after your program has done all it has to do? If its after, I say forget about it.

        PS - And then it's three AM and I'm on the corner, wearing my leather, This dude comes up and he's, like, "Hey, punk", I'm, like, "Yeah, whatever".

        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.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2014-12-27 14:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (177 votes), past polls