Skip to content
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_os leaks under Windows #54592

Closed
pitrou opened this issue Nov 10, 2010 · 5 comments
Closed

test_os leaks under Windows #54592

pitrou opened this issue Nov 10, 2010 · 5 comments
Labels
extension-modules C modules in the Modules dir performance Performance or resource usage

Comments

@pitrou
Copy link
Member

pitrou commented Nov 10, 2010

BPO 10383
Nosy @rhettinger, @amauryfa, @pitrou, @tjguk, @briancurtin, @skrah
Files
  • posixmodule_leak.patch
  • 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:

    assignee = None
    closed_at = <Date 2010-11-27.11:56:58.559>
    created_at = <Date 2010-11-10.20:29:34.105>
    labels = ['extension-modules', 'performance']
    title = 'test_os leaks under Windows'
    updated_at = <Date 2010-11-27.11:56:58.556>
    user = 'https://github.com/pitrou'

    bugs.python.org fields:

    activity = <Date 2010-11-27.11:56:58.556>
    actor = 'skrah'
    assignee = 'none'
    closed = True
    closed_date = <Date 2010-11-27.11:56:58.559>
    closer = 'skrah'
    components = ['Extension Modules']
    creation = <Date 2010-11-10.20:29:34.105>
    creator = 'pitrou'
    dependencies = []
    files = ['19606']
    hgrepos = []
    issue_num = 10383
    keywords = ['patch']
    message_count = 5.0
    messages = ['120931', '120962', '120963', '121191', '122519']
    nosy_count = 7.0
    nosy_names = ['rhettinger', 'amaury.forgeotdarc', 'pitrou', 'ocean-city', 'tim.golden', 'brian.curtin', 'skrah']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'resource usage'
    url = 'https://bugs.python.org/issue10383'
    versions = ['Python 3.1', 'Python 2.7', 'Python 3.2']

    @pitrou
    Copy link
    Member Author

    pitrou commented Nov 10, 2010

    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]

    @pitrou pitrou added stdlib Python modules in the Lib dir OS-windows performance Performance or resource usage labels Nov 10, 2010
    @amauryfa
    Copy link
    Member

    This leaks one reference every time:
    os.write(123456, b"b")

    @amauryfa
    Copy link
    Member

    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.

    @skrah
    Copy link
    Mannequin

    skrah mannequin commented Nov 14, 2010

    I agree that the buffer should be released. The patch fixes this leak
    and another one. All tests pass.

    @skrah
    Copy link
    Mannequin

    skrah mannequin commented Nov 27, 2010

    Fixed original leaks in r86804, r86806 and r86804.

    Fixed additional leaks in r86829.

    @skrah skrah mannequin added extension-modules C modules in the Modules dir and removed stdlib Python modules in the Lib dir OS-windows labels Nov 27, 2010
    @skrah skrah mannequin closed this as completed Nov 27, 2010
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    extension-modules C modules in the Modules dir performance Performance or resource usage
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants