[DB-SIG] Bug with the BSDDB Module for NT4.0

Vic Vaishnavi vick@opticominc.com
Wed, 30 Jun 1999 09:26:30 -0400


This is a multi-part message in MIME format.
--------------09494E4FC21B7397E18C7EBC
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hello

We are using the BSDDB module for Python in our product set and are
seeing a really
bizarre bug on NT.

It seems that as we load data records into the BSDDB dictionary, it
crashes at a really
unpredictable stage.

We have tried to debug it by looking into the KEY length and also the
RECORD length
but to no avail.

We would REALLY appreciate if someone can help us with this issue. For
your convenience
I am enclosing our test program as well.

Note that this bug happens ONLY on NT. We think it has "something" to do
with the BSDDB
restrictions on how it accesses memory and it seems to violate something
causing a Dr.Watson
error on NT.

If anyone can give us a hand with this, that would be most appreciated.

Thanks

- Vick


--------------09494E4FC21B7397E18C7EBC
Content-Type: text/plain; charset=us-ascii;
 name="dbtest.py"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="dbtest.py"

import random
import xdbm
import time

def test ():
	dbkey = '1'
	record = '1'
	count = 0
	adb = xdbm.open ('test.db', 'c')
	longstring1 = 'a' * 1001
	while 1:
		num = random.random()
		longstring = str(int(num * 1000000)) * 200
		keylen = int(random.random() * 16) + 1
		reclen = int(random.random() * 1000) + 1
		keylen = 6
		key = longstring[:keylen]
		rec = longstring1[:reclen]
		count = count + 1
		print 'count = ', count
		print 'lengths = ', keylen, reclen, keylen + reclen
		print 'Key = ', key
		adb[key] = rec
		continue
		try:
			print'Reading for existing record existence', len(dbkey), len(record)
			rec = adb[dbkey]
			print'RECORD ALREADY EXISTS'
		except:
			print'###########################################################'
			print'Entering RECORD in the DATABASE'
			print'KEY= ',dbkey
			print'RECORD is = ',repr(record)
			#self.db[dbkey] = repr(record)
			adb[dbkey] = record
			#print'LATEST DATABASE RECORDS = ',len(self.db.keys())
			print'###########################################################'
		adb.close ()
		record = record + '1'
		if len(record) > 300:
			record = '1'
			dbkey = dbkey + '1'
			aa = raw_input ('hit enter> ')
		

test ()

--------------09494E4FC21B7397E18C7EBC--