Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bsddb closing a DB object before all DBCursors using it are closed crashes #45616

Closed
gpshead opened this issue Oct 12, 2007 · 4 comments
Closed
Assignees
Labels
extension-modules C modules in the Modules dir type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@gpshead
Copy link
Member

gpshead commented Oct 12, 2007

BPO 1275
Nosy @gpshead, @jcea

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/jcea'
closed_at = <Date 2010-03-17.11:18:25.690>
created_at = <Date 2007-10-12.19:20:02.553>
labels = ['extension-modules', 'type-crash']
title = 'bsddb closing a DB object before all DBCursors using it are closed crashes'
updated_at = <Date 2010-03-17.11:18:25.690>
user = 'https://github.com/gpshead'

bugs.python.org fields:

activity = <Date 2010-03-17.11:18:25.690>
actor = 'jcea'
assignee = 'jcea'
closed = True
closed_date = <Date 2010-03-17.11:18:25.690>
closer = 'jcea'
components = ['Extension Modules']
creation = <Date 2007-10-12.19:20:02.553>
creator = 'gregory.p.smith'
dependencies = []
files = []
hgrepos = []
issue_num = 1275
keywords = []
message_count = 4.0
messages = ['56383', '61375', '63444', '66977']
nosy_count = 2.0
nosy_names = ['gregory.p.smith', 'jcea']
pr_nums = []
priority = 'low'
resolution = 'out of date'
stage = None
status = 'closed'
superseder = None
type = 'crash'
url = 'https://bugs.python.org/issue1275'
versions = ['Python 2.5', 'Python 3.0']

@gpshead
Copy link
Member Author

gpshead commented Oct 12, 2007

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.

@gpshead gpshead self-assigned this Oct 12, 2007
@gpshead gpshead added extension-modules C modules in the Modules dir type-crash A hard crash of the interpreter, possibly with a core dump labels Oct 12, 2007
@gpshead
Copy link
Member Author

gpshead commented Jan 21, 2008

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!"

@jcea
Copy link
Member

jcea commented Mar 10, 2008

This issue is solved in pybsddb 4.6.1, available in pypi. Python bsddb3
module must be updated and this issue closed as "fixed".

@gpshead
Copy link
Member Author

gpshead commented May 17, 2008

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.

@gpshead gpshead assigned jcea and unassigned gpshead May 17, 2008
@jcea jcea closed this as completed Mar 17, 2010
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension-modules C modules in the Modules dir type-crash A hard crash of the interpreter, possibly with a core dump
Projects
None yet
Development

No branches or pull requests

2 participants