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

Tim Peters tim.peters at gmail.com
Sun Jun 4 18:47:50 CEST 2006


[Neal Norwitz]
>> test_exceptions leaked [0, 2, 0] references
>> test_filecmp leaked [13, 0, 0] references

[Richard Jones]
> What's producing this output?

While I've never run it, I believe it's produced by Misc/build.sh.

> On what OS?

Windows 3.1 with Neal's cool hack to implement the Bourne shell as a
Windows device driver ;-)

> I'd like to try to find that leak in exceptions if possible.

There probably isn't a leak.  You can run the relevant bits "by hand"
in isolation (here on Windows, but it's rare for a leak to be platform
specific -- note that you need a debug build of Python to use -R):

$ python_d  ../Lib/test/regrtest.py -R 2:40: test_filecmp test_exceptions
test_filecmp
beginning 42 repetitions
123456789012345678901234567890123456789012
..........................................
test_exceptions
beginning 42 repetitions
123456789012345678901234567890123456789012
..........................................
All 2 tests OK.
[25878 refs]

No leaks.  It's one of the charms of -R that its leak output (when it
produces some) can be very hard to track down.  Here I ran exactly the
same thing a second time, but the output differed:

$ python_d  ../Lib/test/regrtest.py -R 2:40: test_filecmp test_exceptions
test_filecmp
beginning 42 repetitions
123456789012345678901234567890123456789012
..........................................
test_filecmp leaked [0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0] references
test_exceptions
beginning 42 repetitions
123456789012345678901234567890123456789012
..........................................
All 2 tests OK.
[25883 refs]

After about 10 more tries at that, yet a third outcome showed up:

$ python_d  ../Lib/test/regrtest.py -R 2:40: test_filecmp test_exceptions
test_filecmp
beginning 42 repetitions
123456789012345678901234567890123456789012
..........................................
test_exceptions
beginning 42 repetitions
123456789012345678901234567890123456789012
..........................................
test_exceptions leaked [0, 203, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0] references
All 2 tests OK.
[25883 refs]

Does that make any sense?  Not to me -- I don't know of a clear reason
other than wild loads/stores for why such runs should ever differ.


More information about the Python-checkins mailing list