Skip to content

Memory leak in code object lines and positions iterator  #92955

Closed

Description

@kumaraditya303

The static types LineIterator and PositionsIterator in codeobject.c are not finalized at exit leading to memory leak.

Reproducer:

def func() -> None:
    pass

print(type(func.__code__.co_positions()).mro())
print(type(func.__code__.co_lines()).mro())

Memory leak:

[<class 'positions_iterator'>, <class 'object'>]
[<class 'line_iterator'>, <class 'object'>]
[138 refs, 54 blocks]

Activity

  1. added a commit that references this issue on May 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

3.12only security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions