[pybsddb] "pgin failed" errors at seemingly arbitrary intervals

Jesus Cea jcea at argo.es
Wed Feb 17 18:24:56 CET 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 09/17/2009 08:01 PM, 5m0pjkx02 at sneakemail.com wrote:
> I am getting fairly regular errors when writing to a bsddb3 hash table. The errors I get are always of the form:
>
> DBRunRecoveryError: (-30974, 'DB_RUNRECOVERY: Fatal error, run database recovery -- test.db: pgin failed for page 312')
>
> The page listed varies, and the error occurs only occasionally. It seems to happen only when overwriting an existing value, though I'm not sure of that.
>
> The following code reproduces the error for me every few times I run it:
> <code>
> import random
> import bsddb3
>
> db=bsddb3.hashopen('test.db','n')
> niter=1000000
> keyrange=5000
> for i in xrange(niter):
>     if (i%5000)==0:
>         print i
>     k=str(random.choice(xrange(keyrange)))
>     v=db.setdefault(k,'')
>     v += str(random.choice(xrange(10)))
>     db[k]=v
> </code>
>
> I'm running:
> Fedora 11, Kernel Linux 2.6.30.5-43.fc11.x86_64
> Python 2.5.4 |EPD 5.0.0| (r254:67916, Aug 21 2009, 16:48:27)
> IPython 0.9.1
> bsddb3-4.7.6-py2.5-linux-x86-64
>
> Everything but bsddb3 was installed from the Enthought Python Distribution 64-bit stack. bsddb3 was installed via easy_install.
>
> More possibly relevant information: Trying to run "import bsddb" (as opposed to "import bsddb3") throws this error:"ImportError: libdb-4.3.so: cannot open shared object file: No such file or directory"
>
> Any help or advice the list could offer would be very much appreciated.

What Berkeley DB version are you using?.

I have executed your code (on a 32bit machine) 25 times, with no problem.

If you are still seeing this, initialize the random seed to a constant
value, and change it until you find a consistent crash. Try executing on
32 bits; I test the code in 64 bits machines, but my daily production
use is on 32 bits. Just to be sure.

- -- 
Jesus Cea Avion                         _/_/      _/_/_/        _/_/_/
jcea at jcea.es - http://www.jcea.es/     _/_/    _/_/  _/_/    _/_/  _/_/
jabber / xmpp:jcea at jabber.org         _/_/    _/_/          _/_/_/_/_/
.                              _/_/  _/_/    _/_/          _/_/  _/_/
"Things are not so easy"      _/_/  _/_/    _/_/  _/_/    _/_/  _/_/
"My name is Dump, Core Dump"   _/_/_/        _/_/_/      _/_/  _/_/
"El amor es poner tu felicidad en la felicidad de otro" - Leibniz
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQCVAwUBS3wmZ5lgi5GaxT1NAQLeMQP/eHT95j58y5eM+9KemDR7HDGr5U6XrnDY
lY+w8n806K+3oxEN8i0tcIlBTZoj56ooj8Ol4thbgoFWoXJv1YgXB8SH27quhk+b
r1DHoADn4ha8KPP936t2MpDFnk8qTIY4yl6SUWeBW5chQyFiwZWKH+aCCYlLNW+W
HIo6xmWOIUM=
=TK+L
-----END PGP SIGNATURE-----



More information about the pybsddb mailing list