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.

classification
Title: bsddb closing a DB object before all DBCursors using it are closed crashes
Type: crash Stage:
Components: Extension Modules Versions: Python 3.0, Python 2.5
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: jcea Nosy List: gregory.p.smith, jcea
Priority: low Keywords:

Created on 2007-10-12 19:20 by gregory.p.smith, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (4)
msg56383 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2007-10-12 19:20
If a bsddb.db.DB object is closed before any DBCursor objects
referencing it are closed, python will crash when the cursors are closed
or deleted.

Workaround: never close a database with open cursors.  this is annoying
in unittest code where a tearDown method closes the DB in the exception
handling path on a test failure before the cursors have been closed or
garbage collected.

I've got a test in my sandbox, I'll check it in with the fix as its a
crasher otherwise.
msg61375 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2008-01-21 03:16
a code snipped using a database d that demonstrates this:

    c = d.cursor()
    d.close()
    print >>sys.stderr, "database closed before cursor"
    del c
    print >>sys.stderr, "cursor deleted and we didn't crash!"
msg63444 - (view) Author: Jesús Cea Avión (jcea) * (Python committer) Date: 2008-03-10 16:35
This issue is solved in pybsddb 4.6.1, available in pypi. Python bsddb3
module must be updated and this issue closed as "fixed".
msg66977 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2008-05-17 06:54
This is fixed in trunk now that jcea has done his merge.

If anyone wants it fixed in release25-maint it'll need a volunteer to
backport just the bugfix parts without the bsddb 4.6.x feature additions.
History
Date User Action Args
2022-04-11 14:56:27adminsetgithub: 45616
2010-03-17 11:18:25jceasetstatus: open -> closed
resolution: out of date
2008-05-17 06:54:50gregory.p.smithsetpriority: normal -> low
assignee: gregory.p.smith -> jcea
messages: + msg66977
versions: - Python 2.6, Python 2.4
2008-03-10 16:35:57jceasetnosy: + jcea
messages: + msg63444
2008-01-21 03:16:37gregory.p.smithsetpriority: normal
messages: + msg61375
versions: + Python 2.6, Python 2.5, Python 2.4, Python 3.0
2007-10-12 19:20:02gregory.p.smithcreate