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

UNIX mmap leaks file descriptors #42538

Closed
drylock mannequin opened this issue Nov 1, 2005 · 2 comments
Closed

UNIX mmap leaks file descriptors #42538

drylock mannequin opened this issue Nov 1, 2005 · 2 comments
Labels
stdlib Python modules in the Lib dir

Comments

@drylock
Copy link
Mannequin

drylock mannequin commented Nov 1, 2005

BPO 1344508
Files
  • t.py: Test case
  • 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 2005-11-02.05:46:40.000>
    created_at = <Date 2005-11-01.03:46:21.000>
    labels = ['library']
    title = 'UNIX mmap leaks file descriptors'
    updated_at = <Date 2005-11-02.05:46:40.000>
    user = 'https://bugs.python.org/drylock'

    bugs.python.org fields:

    activity = <Date 2005-11-02.05:46:40.000>
    actor = 'nnorwitz'
    assignee = 'nnorwitz'
    closed = True
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2005-11-01.03:46:21.000>
    creator = 'drylock'
    dependencies = []
    files = ['1828']
    hgrepos = []
    issue_num = 1344508
    keywords = []
    message_count = 2.0
    messages = ['26771', '26772']
    nosy_count = 2.0
    nosy_names = ['nnorwitz', 'drylock']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue1344508'
    versions = ['Python 2.4']

    @drylock
    Copy link
    Mannequin Author

    drylock mannequin commented Nov 1, 2005

    The commit from 2.49 to 2.50 in Modules/mmapmodule.c
    has made mmap under UNIX leak a file descriptor:

    •   m_obj-\>fd = fd;
      

    + m_obj->fd = dup(fd);

    The FD given is dup'ed in order to allow ftruncation
    later, but no close of it is done in dealloc/close.

    A test case attached, using lsof after some
    mmaps/unmaps to show leak.

    Version:

    Python 2.4.2 (#2, Sep 29 2005, 00:23:59)
    [GCC 4.0.2 (Debian 4.0.1-9)] on linux2

    @drylock drylock mannequin closed this as completed Nov 1, 2005
    @drylock drylock mannequin assigned nnorwitz Nov 1, 2005
    @drylock drylock mannequin added the stdlib Python modules in the Lib dir label Nov 1, 2005
    @drylock drylock mannequin closed this as completed Nov 1, 2005
    @drylock drylock mannequin assigned nnorwitz Nov 1, 2005
    @drylock drylock mannequin added the stdlib Python modules in the Lib dir label Nov 1, 2005
    @nnorwitz
    Copy link
    Mannequin

    nnorwitz mannequin commented Nov 2, 2005

    Logged In: YES
    user_id=33168

    Thanks!

    Committed revision 41366.
    Committed revision 41367. (cleanup)
    Committed revision 41368. (2.4)

    @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
    stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    0 participants