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_pickle are leaked on Windows #104702

Closed
Eclips4 opened this issue May 20, 2023 · 3 comments
Closed

test_pickle are leaked on Windows #104702

Eclips4 opened this issue May 20, 2023 · 3 comments
Labels
OS-windows type-bug An unexpected behavior, bug, or error

Comments

@Eclips4
Copy link
Member

Eclips4 commented May 20, 2023

Tried on current main branch.

./python -m test -R 3:3 test_pickle
Running Debug|x64 interpreter...
0:00:00 Run tests sequentially
0:00:00 [1/1] test_pickle
beginning 6 repetitions
123456
......
test_pickle leaked [13, 12, 173] references, sum=198
test_pickle leaked [11, 12, 113] memory blocks, sum=136
test_pickle failed (reference leak) in 4 min 30 sec

== Tests result: FAILURE ==

1 test failed:
    test_pickle

Total duration: 4 min 30 sec
Tests result: FAILURE

Also, I cannot reproduce it in Linux (WSL, Ubuntu 20.04)

Linked PRs

@Eclips4 Eclips4 added the type-bug An unexpected behavior, bug, or error label May 20, 2023
@Eclips4
Copy link
Member Author

Eclips4 commented May 21, 2023

Fantastic... I can't reproduce it anymore. I just try found bad commit using git bisect...
But I've found reference leak in another way.

 ./python -m test -R 3:3 test_pickle -m PyUnpicklerTests
Running Debug|x64 interpreter...
0:00:00 Run tests sequentially
0:00:00 [1/1] test_pickle
beginning 6 repetitions
123456
......
test_pickle leaked [4, 4, 4] references, sum=12
test_pickle leaked [4, 4, 4] memory blocks, sum=12
test_pickle failed (reference leak)

== Tests result: FAILURE ==

1 test failed:
    test_pickle

Total duration: 908 ms
Tests result: FAILURE

@Eclips4
Copy link
Member Author

Eclips4 commented May 21, 2023

First bad commit: #94504
Also, I know about some refleaks in test_import. (#102251)
What is the relationship with this issue and test_import issue?
Seems that both introduced in #94504 PR.

@sunmy2019
Copy link
Member

Seems all ref leaks come from test_unpickle_module_race

If this test is removed from AbstractUnpickleTests, all ref leaks are gone.

miss-islington pushed a commit to miss-islington/cpython that referenced this issue Aug 29, 2023
…cross multiple threads (pythonGH-108497)

(cherry picked from commit 5f85b44)

Co-authored-by: Brett Cannon <brett@python.org>
Yhg1s pushed a commit that referenced this issue Aug 29, 2023
… multiple threads (GH-108497) (#108612)

GH-106176, GH-104702: Fix reference leak when importing across multiple threads (GH-108497)
(cherry picked from commit 5f85b44)

Co-authored-by: Brett Cannon <brett@python.org>
@Eclips4 Eclips4 closed this as completed Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS-windows type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants