arvindm95 / unladen-swallow

Automatically exported from code.google.com/p/unladen-swallow
Other
0 stars 0 forks source link

Referenceleaks in LLVM mode #32

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
When running regrtest -R:: (which requires a pydebug build) with -L0 or
higher, some of the tests end up leaking references:

test_codecs leaked [27, 27, 27, 27] references, sum=108
test_copy leaked [2, 2, 2, 2] references, sum=8
test_datetime leaked [2, 2, 2, 2] references, sum=8
test_decimal leaked [2, 2, 2, 2] references, sum=8
test_difflib leaked [56, 56, 56, 56] references, sum=224
test_generators leaked [296, 296, 296, 296] references, sum=1184
test_grammar leaked [3, 3, 3, 3] references, sum=12
test_io leaked [2, 2, 2, 2] references, sum=8
test_itertools leaked [26, 26, 26, 26] references, sum=104
test_lib2to3 leaked [22, 22, 22, 22] references, sum=88

These tests do not leak without -L. Considering test_llvm does not leak, I
suspect a leak in an error path that test_llvm fails to test.

Original issue reported on code.google.com by thomaswout@gmail.com on 20 May 2009 at 1:12

GoogleCodeExporter commented 8 years ago
Whittled the test_copy leak down to:

def leak():
    class C(object):
        def f(self, memo=None):
            return C

Just calling leak once leaks two references (but not more than 2, which is a 
little
odd.) Removing the default to 'f' removes the leak. Returning something other 
than C
removes the leak. The same code does not leak without -L0 or higher.

Original comment by thomaswout@gmail.com on 20 May 2009 at 4:26

GoogleCodeExporter commented 8 years ago
Fixed in r569.

Original comment by thomaswout@gmail.com on 20 May 2009 at 9:07