in reply to Small Corrupted Storable Retrieve Dies With an Invalid "Out of memory!"

I feel silly following up tachyon's great analysis with something so mundane, but...

On the subject of why the file gets corrupted, I recommend looking for file-locking bugs in the code that's calling Storable::store.

As it happens, I ran in to this same exact problem last week, and it hasn't recurred since I fixed my file locking mechanism to actually, you know, prevent concurrent writes. ;)

(My problems occurred using Perl 5.8.3 and Storable 2.13 on FreeBSD 4.10-STABLE, btw.)

  • Comment on Re: Small Corrupted Storable Retrieve Dies With an Invalid "Out of memory!"

Replies are listed 'Best First'.
Re^2: Small Corrupted Storable Retrieve Dies With an Invalid "Out of memory!"
by tachyon (Chancellor) on Oct 27, 2004 at 23:14 UTC

    Hi Matt,

    You up you are quite possibly right about the cause. As noted it looks like a buffer and offset issue. What I forgot to mention is that the restored data structure after the 8 bytes of edit stores and retrieves just fine. It could be that there are no missing bytes (as I speculated above) but that it is simply a locking issue as you suggest. Catching the croak and the datastructure will prove that either way. It will be interesting to find out.

    cheers

    tachyon