DB_File:: package bug(?), hash size troubles

DB_File:: package bug(?), hash size troubles

Post by Ken Cha » Thu, 25 Jan 1996 04:00:00



Ok, two things. First one I dont know what to do about and need a solution
or I'll have to move away entirely from DB_File::   :(

I thought DB_File had no limits on record or file sizes.

I'm using a $DB_BTREE file with defaults in place for that style of table.

One of my programs does a reverse hash on another table and writes it out to
a new BTREE file. Strange things began happening, so I started debugging by
dumping to stdout and found that appending data to a $hash{} tied to the
btree was suddenly not just not WORKING, but the $hash{} suddenly contained
NO DATA anymore.

I was doing this (for explanations of why I used this $kludge, read about
my 2nd prob below):

$kludge = $hash{$key} . $newdata;
$hash{$key} = $kludge;
print $hash{$key}, "\n";

This is inside a loop which assigns stuff to $newdata. The stuff printed out
gets longer and longer as it should, then suddenly NOTHING is printed.

Is there some limiting factor for hash entry sizes in perl5 I've not set or
something, or something specific to the package facility or DB_file in
particular? Is this a problem between passing large sized $hash{} entries
back and forth from DB_File::? Does't this mean DB_File:: is broken?

------------------------------------------------------------------------------
Well it would seem it does have a bug, or I'm not understanding how things
work with the package facility: this second problem I figured out how to work
around.

I was appending data to some records, tied via a hash{} to a DB_File::
$DB_BTREE type file:

tie %kwbus, DB_File, "kwbus.db", O_RDWR|O_CREAT, 0640, $DB_BTREE;



  $kludge = $kwbus{"foo"} . $_ ;
  $kwbus{"foo"} = $kludge ;

Quote:}

This works, but is bogus like hoek in my mind: sometimes the $kwbus{} will
be up to 200k long, tho so far in testing, I've only had records up to 4k or
so. I dont want to be moving even 4k around back and forth many times between
variables, nevermind 200k, especially ones tied to a package. (Mebbe its time
to get into refs?).

Please reply by mail, I'll post a summary.

/kc

 
 
 

1. TCP hashing (tcb hashing)

Hi,

        Is there literature any where that explains how a tcp connection
control block (tcb) is hash inserted? I am interested in:

1. Hashing data structure used. And what is the hash function?
2. How are collisions handled?
3. What is the worst case search time in case of collisions?

I did not find the answers to this anywhere. Any help would be highly
appreciated.

thanks

Sent via Deja.com http://www.deja.com/
Before you buy.

2. AAC-364 on Linux? NO WAY!

3. Public domain (in-core) hashing package

4. Apache and UserDir

5. KERN_INFO 2.4.19-pre2 IP/TCP hash table size printks

6. ICASE

7. KERN_INFO: IPv4 IP/TCP hash table size printks

8. CFS 1.2.1 Unix encrypting file system code available

9. TCP hash table sizing

10. Hash Table Troubles -- Solution

11. hash table troubles (continued)

12. MySql vs DB_File

13. AIX 5.1 - DB_File-1.72 ---> ld: 0711-317 ERROR: Undefined symbol: .__fixunssfsi