Skip to content

memory leaks detected with valgrind for python -V #80514

Closed

Description

@matrixise
BPO 36333
Nosy @vstinner, @matrixise
PRs
  • bpo-36333: Fix leaks in pymain_init and _PyPreConfig_ReadFromArgv #12389
  • bpo-36333: Fix leak in _PyRuntimeState_Fini #12400
  • bpo-36333: Clarify fileutils.h documentation #12406
  • bpo-36301: Fix Py_Main() memory leaks #12420
  • bpo-36333, bpo-36356: Fix _PyEval_FiniThreads() #12432
  • Files
  • valgrind.log
  • valgrind-without-memory-leak.log
  • 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 = 'https://github.com/vstinner'
    closed_at = <Date 2019-03-19.23:57:14.461>
    created_at = <Date 2019-03-17.23:45:18.465>
    labels = ['interpreter-core', '3.8']
    title = 'memory leaks detected with valgrind for python -V'
    updated_at = <Date 2019-03-19.23:57:14.460>
    user = 'https://github.com/matrixise'

    bugs.python.org fields:

    activity = <Date 2019-03-19.23:57:14.460>
    actor = 'vstinner'
    assignee = 'vstinner'
    closed = True
    closed_date = <Date 2019-03-19.23:57:14.461>
    closer = 'vstinner'
    components = ['Interpreter Core']
    creation = <Date 2019-03-17.23:45:18.465>
    creator = 'matrixise'
    dependencies = []
    files = ['48213', '48214']
    hgrepos = []
    issue_num = 36333
    keywords = ['patch']
    message_count = 9.0
    messages = ['338147', '338148', '338149', '338185', '338191', '338288', '338342', '338351', '338424']
    nosy_count = 2.0
    nosy_names = ['vstinner', 'matrixise']
    pr_nums = ['12389', '12400', '12406', '12420', '12432']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue36333'
    versions = ['Python 3.8']

    Activity

    1. matrixise commented on Mar 17, 2019

      @matrixise
      MemberAuthor

      I have detected 3 memory leaks when I execute python -V with valgrind -> 162 bytes.

      The leaks do seem to be in pymain_init and in _PyPreConfig_ReadFromArgv (the string for the locale is not freed).

      Also _PyRuntimeState_Fini does not release the memory of the mutex on runtime->xidregistry.

      You can find the first status in the valgrind.log file (with the leaks).

    2. matrixise commented on Mar 17, 2019

      @matrixise
      MemberAuthor

      The report of valgrind with no leaks.

    3. matrixise commented on Mar 17, 2019

      @matrixise
      MemberAuthor

      @vstinner I ping you because you are the main author for the new changes in the interpreter and the PyPreConfig part.

    4. vstinner commented on Mar 18, 2019

      @vstinner
      Member

      I assign the issue to myself, since I'm currently working on the code: bpo-36301.

    5. self-assigned this
      on Mar 18, 2019
    6. matrixise commented on Mar 18, 2019

      @matrixise
      MemberAuthor

      I close the PR 12389 because it superseded by PR 12400 (only the fix for _PyRuntimeState_Fini).

    7. vstinner commented on Mar 18, 2019

      @vstinner
      Member

      New changeset c183444 by Victor Stinner in branch 'master':
      bpo-36301: Fix Py_Main() memory leaks (GH-12420)
      c183444

    8. vstinner commented on Mar 19, 2019

      @vstinner
      Member

      New changeset 943395f by Victor Stinner (Stéphane Wirtel) in branch 'master':
      bpo-36333: Fix leak _PyRuntimeState_Fini (GH-12400)
      943395f

    9. vstinner commented on Mar 19, 2019

      @vstinner
      Member

      New changeset a712679 by Victor Stinner in branch 'master':
      bpo-36333, bpo-36356: Fix _PyEval_FiniThreads() (GH-12432)
      a712679

    10. vstinner commented on Mar 19, 2019

      @vstinner
      Member

      "./python -V" no longer leaks, so I close the issue. See bpo-36356 for the follow-up.

    11. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    3.8 (EOL)end of lifeinterpreter-core(Objects, Python, Grammar, and Parser dirs)

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions