[ZODB-Dev] BTree data loss bug under Python 3.x

Tres Seaver tseaver at palladion.com
Sat May 25 01:31:55 UTC 2013


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

On 05/24/2013 01:28 PM, Marius Gedminas wrote:
> I was trying to debug a failing ZEO test case
> (testConcurrentUpdates), and found out it had nothing to do with ZEO.
> There's a bug either in BTrees or in ZODB itself that causes data
> corruption under Python 3.x.
> 
> Here's a test case: 
> https://gist.github.com/mgedmin/5644876#file-zodbfail_simple-py
> 
> It initializes an OOBTree to {0:0, 1:0, 2:0}, then launches two 
> threads that attempt just one write each:
> 
> tree[1] = 1           # thread 1 tree[2] = 2           # thread 2
> 
> All transactions are committed successfully and the end result
> _sometimes_ is {0:0, 1:0, 2:2} instead of the expected {0:0, 1:1,
> 2:2}.
> 
> There's also a larger test case (zodbfail.py) that modifies more than 
> one item in a thread.  That one fails pretty reliably.
> 
> This only happens under Python 3.x.
> 
> To reproduce::
> 
> git clone git://gist.github.com/5644876.git zodbfail cd zodbfail 
> detox

Thanks for the detective work!  I can confirm the bug, and that it is in
the BTrees C extensions (the tests pass after 'rm
.tox/py32/lib/python3.2/site-packages/BTrees/*.so').



Tres.
- -- 
===================================================================
Tres Seaver          +1 540-429-0999          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iEYEARECAAYFAlGgFIsACgkQ+gerLs4ltQ5QxgCgves8VGndIxt37UCV/CPMKeuw
t3EAoK+gwFE3SNOpBSLJ0p+mZ4ftP7gl
=wxp6
-----END PGP SIGNATURE-----



More information about the ZODB-Dev mailing list