Bug in BSDDB?

Bryan Mongeau bryan at eevolved.com
Fri Dec 15 20:01:28 EST 2000


Greetings Python gurus,

I was doing some benchmarks of the dbhash module when I came across some 
unsettling behavior in Windows 98:

1 - When shelve creates a new database with the "c" flag, it can only add 
85652 keys to the dictionary before raising an error in bsddb.

2- If that error is caught and the write operation tried a second time, the 
key is written just fine.

NB. To reproduce the above behaviour, consult the attached file hashtest1.py


3- A dbhash file with 100000 simple records is 140 MB in Windows, compared 
to 21 MB in Unix. If you attempt to add more than 100000 keys in Windows, 
the size of the file quickly balloons to > 1 GIG. Keep in mind I was using 
unicode strings and cPickle.

4- An attempt to write more than 100000 keys will result in errors 
described in point 1, with ever-increasing frequency until eventually 
python itself will explode (illegal operation).

NB. To reproduce the above behaviour, consult the attached file hashtest2.py
*save your work first* ;-)


I hope someone can shed some light on the situation. I am aware of some 
bugs in bsddb, but none like this.  It is important to note that the code 
in question works *beautifully* on Unix.

Any advice/replacement db module recommendations would be greatly 
appreciated. 
-- 
<==================================>
Bryan Mongeau
Lead Developer, Director
eEvolved Real-Time Technologies Inc.
www.eevolved.com
<==================================>

"Let us understand what our own selfish genes are up to, because we may 
then at least have a chance to upset their designs, something that no other 
species has ever aspired to do." -- Richard Dawkins

-------------- next part --------------
A non-text attachment was scrubbed...
Name: hashtest1.py
Type: application/x-python
Size: 712 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20001216/f380a140/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hashtest2.py
Type: text/x-java
Size: 777 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20001216/f380a140/attachment.java>


More information about the Python-list mailing list