DB_File WTF (was GDBM_File WTF?)

Dirk Koopman djk at tobit.co.uk
Sun Apr 8 19:09:05 BST 2007


Andy Armstrong wrote:
> On 8 Apr 2007, at 18:25, Dirk Koopman wrote:
> 
>> I see to be getting a similar and rather more final problem along a 
>> similar vein. Except that it bangs out with:
>>
>> Out of memory during ridiculously large request at 
>> /spider/perl/DXDupe.pm line 78.
>>
>>  $dbm = tie (%d, 'DB_File', $fn);
>>
>> ..
>> ..
>>
>>  if ($main::systime - $lasttime >=  3600) {
>>     while (($k, $v) = each %d) {
>>        delete $d{$k} if $main::systime >= $v; # line 78
>>     }
>>     $lasttime = $main::systime;
>>  }
>>
>> But only on the latest freebsd 6.2.
>>
>> Any clues?
> 
> Did you miss my post? It's not safe to modify the tied hash during 
> iteration. That's a limitation the Perl wrapper inherits from the 
> underlying library.
> 

Ah, I caught it, but misunderstood. It is now fixed anyway. Funny thing 
is that that code has been running on 100's of nodes on everything from 
i386 linux, windows up to suns without a problem for nearly ten years 
now. Never had this problem before, until a chap wanted to try the 
latest freebsd.

Having said that, I think the freebsd DB_File uses its own source of db 
1.85/86 rather than compiling directly against a DB [234] in 1.85 
"compatibility" mode like the modern linuxes do.





More information about the london.pm mailing list