Skip to content

test_pyrepl leaks references #119469

Description

@vstinner

Since commit fe92193, test_pyrepl started to leak a lot of references.

commit fe921931a35b461fb81821a474b510f4d67c520b (HEAD)
Author: Lysandros Nikolaou <lisandrosnik@gmail.com>
Date:   Mon May 20 17:57:32 2024 -0400

    gh-111201: Add tests for unix console class in pyrepl (#118653)

Example:

$ ./python -m test test_pyrepl -u all -R 3:3
(...)
test_pyrepl leaked [8943, 8939, 8943] references, sum=26825
test_pyrepl leaked [3138, 3136, 3138] memory blocks, sum=9412
(...)

cc @lysnikolaou

Linked PRs

Activity

  1. vstinner commented on May 23, 2024

    @vstinner
    MemberAuthor

    The problem comes from self.old_sigwinch = signal.signal(signal.SIGWINCH, self.__sigwinch) in UnixConsole.prepare(). The test doesn't call console.restore().

  2. ambv commented on May 23, 2024

    @ambv
    Contributor

    thanks for the super quick investigation, Victor

  3. vstinner commented on May 23, 2024

    @vstinner
    MemberAuthor

    Python 3.13 is also affected. Example:

    $ ./python -m test test_pyrepl -u all -R 3:3 -m test_simple_addition
    (...)
    test_pyrepl leaked [851, 851, 851] references, sum=2553
    test_pyrepl leaked [289, 289, 289] memory blocks, sum=867
    
  4. ambv commented on May 23, 2024

    @ambv
    Contributor

    Will backport.

  5. added 2 commits that reference this issue on May 23, 2024
  6. added a commit that references this issue on May 23, 2024
  7. added a commit that references this issue on May 23, 2024
  8. added a commit that references this issue on Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsTests in the Lib/test dir

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions