classification
Title: Reference leak in test_cprofile
Type: Stage:
Components: Versions: Python 2.6, Python 2.5
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: brett.cannon Nosy List: amaury.forgeotdarc, benjamin.peterson, brett.cannon
Priority: high Keywords: needs review, patch

Created on 2008-09-30 16:01 by amaury.forgeotdarc, last changed 2008-09-30 17:49 by brett.cannon. This issue is now closed.

Messages (2)
msg74082 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2008-09-30 16:00
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.
msg74086 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2008-09-30 17:49
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.
History
Date User Action Args
2008-09-30 17:49:22brett.cannonsetstatus: open -> closed
resolution: accepted
messages: + msg74086
2008-09-30 16:01:00amaury.forgeotdarccreate