New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reference leaks in Python 3.0rc3 #48623
Comments
A refleak test of r67311 py3k shows several leaks: test_distutils leaked [142, 142, 142, 142] references, sum=568 |
Only distutils and pickle seem to have real leaks. $ ./python Lib/test/regrtest.py -R:15: test_multiprocessing
test_multiprocessing
beginning 20 repetitions
12345678901234567890
....................
1 test OK.
[124096 refs]
$ ./python Lib/test/regrtest.py -R:15: test_distutils
test_distutils
beginning 20 repetitions
12345678901234567890
....................
test_distutils leaked [144, 144, 144, 144, 144, 144, 144, 144, 144, 144,
144, 144, 144, 144, 144] references, sum=2160
1 test OK.
[123507 refs]
$ ./python Lib/test/regrtest.py -R:15: test_httpservers
[...]
test_httpservers leaked [-217, 0, 198, 19, -35, 20, -202, 217, -217,
217, 0, 0, 0, 0, -33] references, sum=-33
1 test OK.
[96060 refs]
$ ./python Lib/test/regrtest.py -R:15: test_pickle
test_pickle
beginning 20 repetitions
12345678901234567890
....................
test_pickle leaked [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
references, sum=15
1 test OK.
[96783 refs] |
distutils.tests.test_build_ext leaks the references. I think it's |
This simple patch doesn't load the 'xx' module more than once in ref The problem may also be caused by the xxmodule itself. Somebody should |
I have studied this some time ago. The xx module comes each time from a Every instance of the module creates a new entry in the static I do not see any way to clear this dictionary. The proposed patch is |
The refleak in test_pickle comes from unpickler_read(). The attached |
Good analysis Amaury! The new patch for build ext uses a single temp dir. |
The problem is that on Windows (and cygwin) you cannot unlink a .pyd I tried to use ctypes and call FreeLibrary. Now the .pyd can be removed, |
Amaury's patch for pickle looks fine to me. |
Applied pickle-leak2.patch in 67381. |
Second fix applied in r67382 |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: