Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue16690

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:Reference leak with custom tp_dealloc in PyType_FromSpec
Type:resource usageStage:resolved
Components:Interpreter CoreVersions:Python 3.2, Python 3.3, Python 3.4
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: Robin.Schreiber, bfroehle, loewis, ncoghlan, petr.viktorin, pitrou, python-dev
Priority:normalKeywords:

Created on2012-12-15 01:39 bybfroehle, last changed2022-04-11 14:57 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
heaptype_refcnt_testcases.pybfroehle,2012-12-20 01:18
Messages (6)
msg177527 -(view)Author: Bradley Froehle (bfroehle)*Date: 2012-12-15 01:39
There is a reference leak when using PyType_FromSpec with custom tp_dealloc.  This was first noted in issue#15142, where a fix was given which only applies to types which do not override tp_dealloc.For example, the xxlimited.Xxo type suffers from this:Python 3.3.0 (default, Oct 26 2012, 11:06:17) [GCC 4.6.3] on linuxType "help", "copyright", "credits" or "license" for more information.>>> import xxlimited>>> import sys>>> Xxo = type(xxlimited.new())>>> e = Xxo()>>> sys.getrefcount(Xxo)7>>> e = Xxo()>>> sys.getrefcount(Xxo)8>>> e = Xxo()>>> sys.getrefcount(Xxo)9
msg177528 -(view)Author: Bradley Froehle (bfroehle)*Date: 2012-12-15 02:06
I see this issue came up in the course of#15653 as well.
msg177794 -(view)Author: Bradley Froehle (bfroehle)*Date: 2012-12-20 01:18
The attached file `heaptype_refcnt_testcases.py` runs through several test cases (ssl.SSLError, a subclass of ssl.SSLError, and xxlimited.Xxo) seeing if references are leaked in each instance.Unfortunately `xxlimited.Xxo` isn't set to be a base type and I don't know of any other types in the default install which use PyType_FromSpec with a custom tp_dealloc.
msg244420 -(view)Author: Alyssa Coghlan (ncoghlan)*(Python committer)Date: 2015-05-29 21:29
The new test cases forPEP 489 (multi-phase extension module import) appear to be encountering this leak.Seeissue 24268 for context.
msg244814 -(view)Author: Roundup Robot (python-dev)(Python triager)Date: 2015-06-04 11:58
New changeset265eeb60443a by Nick Coghlan in branch '3.5':Issue#24373: EliminatePEP 489 test refleakshttps://hg.python.org/cpython/rev/265eeb60443a
msg352187 -(view)Author: Petr Viktorin (petr.viktorin)*(Python committer)Date: 2019-09-12 14:43
This is fixed in Python 3.5+.
History
DateUserActionArgs
2022-04-11 14:57:39adminsetgithub: 60894
2019-09-12 14:43:43petr.viktorinsetstatus: open -> closed
resolution: fixed
messages: +msg352187

stage: resolved
2015-06-04 11:58:34python-devsetnosy: +python-dev
messages: +msg244814
2015-05-29 21:29:34ncoghlansetnosy: +petr.viktorin
messages: +msg244420
2015-05-29 21:26:17ncoghlansetnosy: +ncoghlan
2012-12-20 01:18:48bfroehlesetfiles: +heaptype_refcnt_testcases.py

messages: +msg177794
2012-12-19 18:45:07bfroehlesetnosy: +pitrou
2012-12-15 15:45:51pitrousetnosy: +loewis,Robin.Schreiber
2012-12-15 02:06:20bfroehlesetmessages: +msg177528
2012-12-15 01:39:25bfroehlecreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp