[ZODB-Dev] weird BTrees KeyError (CVS HEAD)
Christian Reis
kiko at async.com.br
Fri Jun 27 16:13:45 EDT 2003
Hi there,
I'm trying to track down a bug with IC, and since I know Jeremy and Tim
have been working on BTrees lately, I'll try and take advantage of the
freshness of memory. I haven't been able to reproduce the bug in a
simple testcase (after hours of trying), so I'll try and paste out the
simple error.
I have a BTree (held by ListIndex for the IC-interested) that uses
PersistentLists as keys. I'm running into the following situation:
>>> pprint.pprint(list(index.keys()))
[[<OutPayment -856997433 at 0x139009928: None (10)>],
[<OutPayment -184497724 at 0x139009744: Pergunte AO JÃO (9)>],
[<OutPayment -996636965 at 0x135391528: (7)>,
<OutPayment 685848900 at 0x135391624: (8)>],
[<OutPayment 76244553 at 0x139117880: (6)>],
[<OutPayment 233388722 at 0x139019608: 231232131 (4)>],
[<OutPayment 479303017 at 0x139596568: 23123231 (3)>],
[<OutPayment -984951907 at 0x139600696: 21331421 (2)>],
[<OutPayment 310965931 at 0x139119824: XXX XXX XXX 123 (1)>]]
>>> print x
[<OutPayment -856997433 at 0x139009928: None (10)>]
>>> print x in index.keys()
1
>>> print x in list(index.keys())
1
>>> print index.get(key)
None
>>> print index[x]
Traceback (most recent call last):
File "<console>", line 1, in ?
KeyError: [<OutPayment -856997433 at 0x139009928: None (10)>]
I've tried to track this down, but it seems very odd. The worst part is
that *sometimes* it works -- once every 4 or 5 runs no keyerror is
produced. The only thing really special here is that these objects have
custom hash functions, but I don't think hash is used in this case.
This was happening before, and I moved to BTrees from CVS HEAD, hopeful
that the problem was fixed, but using yesterday's version, I still get
the same errors.
I can provide a FileStorage that contains the problematic BTree along
with a script that reproduces the error, if it's helpful.
Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL
More information about the ZODB-Dev
mailing list