This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ysj.ray
Recipients r.david.murray, ysj.ray
Date 2011-03-02.04:28:51
SpamBayes Score 2.6165123e-06
Marked as misclassified No
Message-id <1299040132.69.0.988386092802.issue11350@psf.upfronthosting.co.za>
In-reply-to
Content
Here is a test case.

First here is a patch which implements a simple builtin function "abort()" that calls exit(0) directly, it simulates the cases that Py_FatalError occurred or segment fault.

Then run the following:

import dbm.dumb as dumb

db = dumb.open('test_db', 'c')
db.clear()
db['a'] = 'a'
db.sync()
db['a'] = 'aa'
abort()


Now the database 'test_db' is corrupt because .dat file and .dir file are out of sync:

db = dumb.open('test_db', 'c')
print(db['a'])
db.close()

prints:
b'a'

But the value of key 'a' in .dat file are: 'aa':
cat test_db.dat
aa
History
Date User Action Args
2011-03-02 04:28:52ysj.raysetrecipients: + ysj.ray, r.david.murray
2011-03-02 04:28:52ysj.raysetmessageid: <1299040132.69.0.988386092802.issue11350@psf.upfronthosting.co.za>
2011-03-02 04:28:52ysj.raylinkissue11350 messages
2011-03-02 04:28:52ysj.raycreate