classification
Title: test_os leaks under Windows
Type: resource usage Stage: resolved
Components: Extension Modules Versions: Python 3.1, Python 3.2, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: amaury.forgeotdarc, brian.curtin, ocean-city, pitrou, rhettinger, skrah, tim.golden
Priority: normal Keywords: patch

Created on 2010-11-10 20:29 by pitrou, last changed 2010-11-27 11:56 by skrah. This issue is now closed.

Files
File name Uploaded Description Edit
posixmodule_leak.patch skrah, 2010-11-14 12:34
Messages (5)
msg120931 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-11-10 20:29
Y:\>py3k\__svn__\PCbuild\python_d.exe -m test.regrtest -R 3:2 test_os
[1/1] test_os
[33558 refs]
beginning 5 repetitions
12345
[33558 refs]
.[33558 refs]
.[33558 refs]
.[33558 refs]
.[33558 refs]
.
test_os leaked [3, 3] references, sum=6
1 test failed:
    test_os
[117612 refs]
msg120962 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2010-11-11 16:57
This leaks one reference every time:
    os.write(123456, b"b")
msg120963 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2010-11-11 17:01
This looks suspect (in function posix_write)::

    if (!PyArg_ParseTuple(args, "iy*:write", &fd, &pbuf))
        return NULL;
    if (!_PyVerify_fd(fd))
        return posix_error();

I'd prefer a "PyBuffer_Release(&pbuf);" before returning...
Many other occurrences of _PyVerify_fd have this issue.
msg121191 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2010-11-14 12:34
I agree that the buffer should be released. The patch fixes this leak
and another one. All tests pass.
msg122519 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2010-11-27 11:56
Fixed original leaks in r86804, r86806 and r86804.

Fixed additional leaks in r86829.
History
Date User Action Args
2010-11-27 11:56:58skrahsetstatus: open -> closed

components: + Extension Modules, - Library (Lib), Windows
versions: + Python 3.1, Python 2.7
nosy: rhettinger, amaury.forgeotdarc, pitrou, ocean-city, tim.golden, brian.curtin, skrah
messages: + msg122519
resolution: fixed
stage: resolved
2010-11-14 12:34:44skrahsetfiles: + posixmodule_leak.patch

nosy: + skrah
messages: + msg121191

keywords: + patch
2010-11-11 17:01:28amaury.forgeotdarcsetmessages: + msg120963
2010-11-11 16:57:19amaury.forgeotdarcsetmessages: + msg120962
2010-11-10 20:29:34pitroucreate