[New-bugs-announce] [issue26718] super.__init__ leaks memory if called multiple times

Kevin Modzelewski report at bugs.python.org
Fri Apr 8 21:02:03 EDT 2016


New submission from Kevin Modzelewski:

The super() __init__ function fills in the fields of a super object without checking if they were already set.  If someone happens to call __init__ again, the previously-set references will end up getting forgotten and leak memory.

For example:

import sys
print(sys.gettotalrefcount())
sp = super(int, 1)
for i in range(100000):
  super.__init__(sp, float, 1.0)
print(sys.gettotalrefcount())

----------
components: Interpreter Core
messages: 263053
nosy: Kevin Modzelewski
priority: normal
severity: normal
status: open
title: super.__init__ leaks memory if called multiple times
versions: Python 2.7, Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26718>
_______________________________________


More information about the New-bugs-announce mailing list