[Zope-Checkins] CVS: Packages/ZODB - FileStorage.py:1.135.6.5
Tim Peters
tim.one at comcast.net
Fri Jun 18 10:38:12 EDT 2004
Update of /cvs-repository/Packages/ZODB
In directory cvs.zope.org:/tmp/cvs-serv11279/ZODB
Modified Files:
Tag: Zope-2_7-branch
FileStorage.py
Log Message:
Collector #1379: Undo + FileStorage.restore go BOOM.
FileStorage.__data_find(): When marching across the data records in a
transaction, this had an "off-by-8 error" for data records containing a
backpointer. The result was reading nonsense bytes as if they were a
data record header, which could lead to an exception (bad argument to
file.seek()), or silent failure to find data that exists.
New test checkRestoreWithMultipleObjectsInUndoRedo provokes two
instances of the bug before the patch.
ZODB 3.3 trunk doesn't have this bug. ZODB 3.1.5 does have this bug,
but I'm not fixing it at this time. It's a critical bug for ZRS
(secondaries doing recovery indirectly rely on _data_find); I don't
think base Zope uses FileStorage.restore().
=== Packages/ZODB/FileStorage.py 1.135.6.4 => 1.135.6.5 ===
--- Packages/ZODB/FileStorage.py:1.135.6.4 Thu Jun 17 13:37:34 2004
+++ Packages/ZODB/FileStorage.py Fri Jun 18 10:37:42 2004
@@ -847,6 +847,8 @@
reclen = DATA_HDR_LEN + vl + dl
if vl:
reclen += 16
+ if dl == 0: # skip over backpointer
+ reclen += 8
if _oid == oid:
if vl:
self._file.read(vl + 16)
More information about the Zope-Checkins
mailing list