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

subprocess_fork_exec leaks memory when extra_groups are supplied #85127

Closed
tiran opened this issue Jun 12, 2020 · 4 comments
Closed

subprocess_fork_exec leaks memory when extra_groups are supplied #85127

tiran opened this issue Jun 12, 2020 · 4 comments
Labels
3.9 only security fixes 3.10 only security fixes extension-modules C modules in the Modules dir performance Performance or resource usage

Comments

@tiran
Copy link
Member

tiran commented Jun 12, 2020

BPO 40955
Nosy @gpshead, @tiran, @koobs, @miss-islington
PRs
  • bpo-40955: Fix memory leak in subprocess module #20825
  • [3.9] bpo-40955: Fix memory leak in subprocess module (GH-20825) #20831
  • [3.8] bpo-40955: Fix memory leak in subprocess module (GH-20825) #20832
  • [3.7] bpo-40955: Fix memory leak in subprocess module (GH-20825) #20833
  • 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 2020-06-12.17:09:12.793>
    created_at = <Date 2020-06-12.09:54:50.526>
    labels = ['extension-modules', '3.9', '3.10', 'performance']
    title = 'subprocess_fork_exec leaks memory when extra_groups are supplied'
    updated_at = <Date 2020-06-12.17:09:12.791>
    user = 'https://github.com/tiran'

    bugs.python.org fields:

    activity = <Date 2020-06-12.17:09:12.791>
    actor = 'christian.heimes'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-06-12.17:09:12.793>
    closer = 'christian.heimes'
    components = ['Extension Modules']
    creation = <Date 2020-06-12.09:54:50.526>
    creator = 'christian.heimes'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 40955
    keywords = ['patch']
    message_count = 4.0
    messages = ['371346', '371392', '371396', '371397']
    nosy_count = 4.0
    nosy_names = ['gregory.p.smith', 'christian.heimes', 'koobs', 'miss-islington']
    pr_nums = ['20825', '20831', '20832', '20833']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'resource usage'
    url = 'https://bugs.python.org/issue40955'
    versions = ['Python 3.9', 'Python 3.10']

    @tiran
    Copy link
    Member Author

    tiran commented Jun 12, 2020

    asan has detected a minor memory leak in subprocess_fork_exec:

    Direct leak of 8 byte(s) in 1 object(s) allocated from:
    #0 0x7f008bf19667 in __interceptor_malloc (/lib64/libasan.so.6+0xb0667)
    #1 0x7f007a0bee4a in subprocess_fork_exec /home/heimes/dev/python/cpython/Modules/_posixsubprocess.c:774
    #2 0xe0305b in cfunction_call Objects/methodobject.c:546
    #3 0x4bdd0c in _PyObject_MakeTpCall Objects/call.c:191
    #4 0x462fd0 in _PyObject_VectorcallTstate Include/cpython/abstract.h:112
    #5 0x462fd0 in _PyObject_VectorcallTstate Include/cpython/abstract.h:99
    #6 0x462fd0 in PyObject_Vectorcall Include/cpython/abstract.h:123
    #7 0x462fd0 in call_function Python/ceval.c:5110
    #8 0x462fd0 in _PyEval_EvalFrameDefault Python/ceval.c:3510
    #9 0x8c1c1d in _PyEval_EvalFrame Include/internal/pycore_ceval.h:40
    #10 0x8c1c1d in _PyEval_EvalCode Python/ceval.c:4365

    @tiran tiran added 3.7 (EOL) end of life 3.8 only security fixes 3.10 only security fixes 3.9 only security fixes performance Performance or resource usage labels Jun 12, 2020
    @gpshead gpshead changed the title subprocess_fork_exec leaks memory subprocess_fork_exec leaks memory when extra_groups are supplied Jun 12, 2020
    @miss-islington
    Copy link
    Contributor

    New changeset 0d3350d by Christian Heimes in branch 'master':
    bpo-40955: Fix memory leak in subprocess module (GH-20825)
    0d3350d

    @miss-islington
    Copy link
    Contributor

    New changeset ee3f7fe by Miss Islington (bot) in branch '3.9':
    bpo-40955: Fix memory leak in subprocess module (GH-20825)
    ee3f7fe

    @tiran
    Copy link
    Member Author

    tiran commented Jun 12, 2020

    3.8 and 3.7 don't have the code path and are not affected.

    @tiran tiran added extension-modules C modules in the Modules dir and removed 3.7 (EOL) end of life 3.8 only security fixes labels Jun 12, 2020
    @tiran tiran closed this as completed Jun 12, 2020
    @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
    3.9 only security fixes 3.10 only security fixes extension-modules C modules in the Modules dir performance Performance or resource usage
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants