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

Reference leak in test_cprofile #48253

Closed
amauryfa opened this issue Sep 30, 2008 · 2 comments
Closed

Reference leak in test_cprofile #48253

amauryfa opened this issue Sep 30, 2008 · 2 comments
Assignees

Comments

@amauryfa
Copy link
Member

BPO 4003
Nosy @brettcannon, @amauryfa, @benjaminp

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/brettcannon'
closed_at = <Date 2008-09-30.17:49:22.797>
created_at = <Date 2008-09-30.16:01:00.267>
labels = []
title = 'Reference leak in test_cprofile'
updated_at = <Date 2008-09-30.17:49:22.796>
user = 'https://github.com/amauryfa'

bugs.python.org fields:

activity = <Date 2008-09-30.17:49:22.796>
actor = 'brett.cannon'
assignee = 'brett.cannon'
closed = True
closed_date = <Date 2008-09-30.17:49:22.797>
closer = 'brett.cannon'
components = []
creation = <Date 2008-09-30.16:01:00.267>
creator = 'amaury.forgeotdarc'
dependencies = []
files = []
hgrepos = []
issue_num = 4003
keywords = ['patch', 'needs review']
message_count = 2.0
messages = ['74082', '74086']
nosy_count = 3.0
nosy_names = ['brett.cannon', 'amaury.forgeotdarc', 'benjamin.peterson']
pr_nums = []
priority = 'high'
resolution = 'accepted'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue4003'
versions = ['Python 2.6', 'Python 2.5']

@amauryfa
Copy link
Member Author

r66677 introduces a reference leak in test_cprofile, as shown by
http://mail.python.org/pipermail/python-checkins/2008-September/074355.html

IMO, the code at the end of the function should not have been modified
this way. It is enough to do:

	if (PyErr_Occurred()) {
		PyErr_WriteUnraisable(pObj->externalTimer);
		return 0;
	}

it's the same "PyErr_WriteUnraisable" statement as 18 lines above, which
is valid because pObj->externalTimer is still a living python object
even if pObj is being cleared.

@brettcannon
Copy link
Member

Amaury's fix works for me; since this is an edge case situation anyway,
I am not terribly worried about some fancy error message.

Fixed in r66700 for 2.6, r66701 for 2.5.

@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
None yet
Projects
None yet
Development

No branches or pull requests

2 participants