-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
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
test_datetime leaks memory on Windows #79503
Comments
test_datetime currently leaks memory blocks: test_datetime leaked [3, 4, 3] memory blocks, sum=10 Attached patch should be added to Lib/test/ to only run a minimum set of tests which reproduce the bug. |
C:\vstinner\python\master>python -m test -R 3:20 -u all test_datetime == Tests result: FAILURE == 1 test failed: Total duration: 562 ms |
This is because of a leak of 'wstr' at cpython/Objects/unicodeobject.c Line 3476 in 1005c84
There is another leak and usage of uninitialized 'str' because the following "else if" clause doesn't have a 'return' (probably due to copy-paste from unicode_decode_locale() in 3d4226a). |
Correction: the fall-through in "else if (res == -3)" clause doesn't cause a memory leak, but still results in usage of uninitialized 'str'. |
Oh, I see. unicode_encode_locale() has multiple bugs in the code handling errors :-( I don't think that my commit 3d4226a introduced the memory leak triggered by test_datetime, it seems older. Python 3.7 also has the bug in unicode_encode_locale(). The memory leak has been introduced by commit 7ed7aea, also written by me :-) |
bpo-34482 added the test in test_datetime which triggered the bug. |
I tested manually that "python -m test test_datetime -R 3:3" pass on 3.7 and master branches. Note: PyUnicode_DecodeLocale() is still untested, only _Py_DecodeLocaleEx() and _Py_EncodeLocaleEx() are tested. |
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: