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

test_pyrepl leaks references #119469

Closed
vstinner opened this issue May 23, 2024 · 4 comments
Closed

test_pyrepl leaks references #119469

vstinner opened this issue May 23, 2024 · 4 comments
Labels
tests Tests in the Lib/test dir

Comments

@vstinner
Copy link
Member

vstinner commented May 23, 2024

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

@vstinner vstinner added the tests Tests in the Lib/test dir label May 23, 2024
@vstinner
Copy link
Member Author

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

@ambv
Copy link
Contributor

ambv commented May 23, 2024

thanks for the super quick investigation, Victor

@vstinner
Copy link
Member Author

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

@ambv
Copy link
Contributor

ambv commented May 23, 2024

Will backport.

ambv added a commit to ambv/cpython that referenced this issue May 23, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 23, 2024
(cherry picked from commit 6e012ce)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
ambv added a commit that referenced this issue May 23, 2024
(cherry picked from commit 6e012ce)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
@Eclips4 Eclips4 closed this as completed May 23, 2024
estyxx pushed a commit to estyxx/cpython that referenced this issue Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir
Projects
None yet
Development

No branches or pull requests

3 participants