jbisbee has asked for the wisdom of the Perl Monks concerning the following question:
Attention: the corrupted storable file I have was created under perl 5.6.0 / Storable 1.013 and reproduced under 5.6.2 / Storable 2.13. If don't have a 5.6 install handy, then you won't be able to reproduce the issue because the storable file isn't binary compatible with 5.8
I have a issue that shows up every couple of days. A storable file (happens to be a user profile) gets corrupted somehow and when I attempt to retrieve it, I get an "Out of memory!" error. (and I have _plenty_ of memory to spare for the small frozen structure)
This really sucks because its under mod_perl and it actually kills a httpd proccess each time the user with the "bad" profile attempts to go visit our site.
I've filled a bug here against Storable and figured I'd see if anyone has a minute to take it further than my limited C/XS skills could take me.
Here is the text from my bug report:
You can get the corrupt storable file, out-of-memory.storable, here (attached to the bug)
I'm just looking for the "proper" way to throw an exception in this test case so I can trap the exception in an eval rather than having a click happy user take down httpd process after httpd process util we remove the offending profile.I've verified this issue with both perl 5.6.0 / Storable 1.013 perl 5.6.2 / Storable 2.13 I looked at the Storable.xs code in 2.13 and turned on the DEBUGME flag and reran my test retrieve code. (test.pl) #!/usr/bin/perl use Storable qw(retrieve); $Storable::DEBUGME = 1; retrieve(shift); Then ran it ./test.pl out-of-memory.storable and got this output (truncated to show the error) ** extending kbuf to -184127888 bytes (had 128) Out of memory! I tracked it down to retreive_hash() and this code KBUFCHK((STRLEN)size); /* Grow hash key read pool if needed */ Storables are created every couple of days that trigger this bug and because these are profiles and we have no way of trapping the exception, our we have users that are kill httpd processes each time they attempt to load our site until we remove the offending storable file. I've attached the 'out-of-memory.storable' file so you can easily reproduce this problem. From my basic knowledge I'm wondering if we could just ASSERT if you attempt to grow the hash key read pool if its not a positive integer. (I stress basic) :)
-biz-
|
|---|