[Python-checkins] Python Regression Test Failures refleak (1)

Neal Norwitz nnorwitz at gmail.com
Fri Apr 14 06:03:49 CEST 2006


On 4/13/06, Tim Peters <tim.peters at gmail.com> wrote:
> [Thomas Heller]
> > Neal, does this mean that test_ctypes does not leak anymore, or is it
> > somehow excluded from this list?
>
> I'm guessing, but I believe Neal uses Misc/build.sh for this, and
> ctypes is now in its LEAKY_TESTS pattern of test names to skip:
>
> LEAKY_TESTS="test_(cmd_line|ctypes|filecmp|socket|threadedtempfile|threading|threading_local|urllib2)"

Tim's right, the leak report comes from Misc/build.sh (same with
building the docs and other emails sent to python-checkins).  ctypes
leaks inconsistently which is why it's in the LEAKY_TESTS.  In this
case it didn't show any leaks.  I don't know if the leaks will return.
 When the leaks aren't consistent and report the same number, it
usually means there are references elsewhere that may or may not be
cleaned up.

However, ctypes still leaks when reloaded.  We probably ought to have
a test for each module that just does reload(module) and see if that
leaks.  I wouldn't be surprised if several C modules leak.

>>> import ctypes, gc
[30740 refs]
>>> reload(ctypes) ; gc.collect() ; gc.collect() ; gc.collect()
<module 'ctypes' from
'/Users/nnorwitz/build/python/trunk2/Lib/ctypes/__init__.pyc'>
20
0
0
[32090 refs]
>>> reload(ctypes) ; gc.collect() ; gc.collect() ; gc.collect()
<module 'ctypes' from
'/Users/nnorwitz/build/python/trunk2/Lib/ctypes/__init__.pyc'>
103
13
0
[32576 refs]
>>> reload(ctypes) ; gc.collect() ; gc.collect() ; gc.collect()
<module 'ctypes' from
'/Users/nnorwitz/build/python/trunk2/Lib/ctypes/__init__.pyc'>
103
13
0
[33048 refs]
>>> reload(ctypes) ; gc.collect() ; gc.collect() ; gc.collect()
<module 'ctypes' from
'/Users/nnorwitz/build/python/trunk2/Lib/ctypes/__init__.pyc'>
103
13
0
[33520 refs]
>>> reload(ctypes) ; gc.collect() ; gc.collect() ; gc.collect()
<module 'ctypes' from
'/Users/nnorwitz/build/python/trunk2/Lib/ctypes/__init__.pyc'>
103
13
0
[33992 refs]


Cheers,
n


More information about the Python-checkins mailing list