Repository navigation
Refleak in test_importlib on aarch64 RHEL8 #101766
Copy link
Copy link
Closed
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
I am not sure what is going on with this test run:
Ran 1377 tests in 3.713s
OK (skipped=18, expected failures=1)
......
test_importlib leaked [6, 4, 2] references, sum=12
test_importlib leaked [4, 4, 2] memory blocks, sum=10
0:32:52 load avg: 0.42 Re-running test_asyncio in verbose mode (matching: test_fork_asyncio_subprocess)
beginning 6 repetitions
123456
/home/buildbot/buildarea/pull_request.cstratak-RHEL8-aarch64.refleak/build/Lib/multiprocessing/popen_fork.py:66: DeprecationWarning: This process (pid=4145974) is multi-threaded, use of fork() may lead to deadlocks in the child.
self.pid = os.fork()
test_fork_asyncio_subprocess (test.test_asyncio.test_unix_events.TestFork.test_fork_asyncio_subprocess) ... ok
----------------------------------------------------------------------
Ran 1 test in 0.072s
OK
./home/buildbot/buildarea/pull_request.cstratak-RHEL8-aarch64.refleak/build/Lib/multiprocessing/popen_fork.py:66: DeprecationWarning: This process (pid=4145974) is multi-threaded, use of fork() may lead to deadlocks in the child.
self.pid = os.fork()
test_fork_asyncio_subprocess (test.test_asyncio.test_unix_events.TestFork.test_fork_asyncio_subprocess) ... ok
----------------------------------------------------------------------
Ran 1 test in 0.060s
OK
./home/buildbot/buildarea/pull_request.cstratak-RHEL8-aarch64.refleak/build/Lib/multiprocessing/popen_fork.py:66: DeprecationWarning: This process (pid=4145974) is multi-threaded, use of fork() may lead to deadlocks in the child.
self.pid = os.fork()
test_fork_asyncio_subprocess (test.test_asyncio.test_unix_events.TestFork.test_fork_asyncio_subprocess) ... ok
----------------------------------------------------------------------
Ran 1 test in 0.059s
OK
./home/buildbot/buildarea/pull_request.cstratak-RHEL8-aarch64.refleak/build/Lib/multiprocessing/popen_fork.py:66: DeprecationWarning: This process (pid=4145974) is multi-threaded, use of fork() may lead to deadlocks in the child.
self.pid = os.fork()
test_fork_asyncio_subprocess (test.test_asyncio.test_unix_events.TestFork.test_fork_asyncio_subprocess) ... ok
----------------------------------------------------------------------
Ran 1 test in 0.060s
OK
./home/buildbot/buildarea/pull_request.cstratak-RHEL8-aarch64.refleak/build/Lib/multiprocessing/popen_fork.py:66: DeprecationWarning: This process (pid=4145974) is multi-threaded, use of fork() may lead to deadlocks in the child.
self.pid = os.fork()
test_fork_asyncio_subprocess (test.test_asyncio.test_unix_events.TestFork.test_fork_asyncio_subprocess) ... ok
----------------------------------------------------------------------
Ran 1 test in 0.061s
OK
./home/buildbot/buildarea/pull_request.cstratak-RHEL8-aarch64.refleak/build/Lib/multiprocessing/popen_fork.py:66: DeprecationWarning: This process (pid=4145974) is multi-threaded, use of fork() may lead to deadlocks in the child.
self.pid = os.fork()
test_fork_asyncio_subprocess (test.test_asyncio.test_unix_events.TestFork.test_fork_asyncio_subprocess) ... ok
----------------------------------------------------------------------
Ran 1 test in 0.057s
OK
.
1 test failed again:
test_importlib
See https://buildbot.python.org/all/#builders/802/builds/623
Linked PRs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Activity
sobolevn commentedon Feb 12, 2023
First failing build that I was able to find: https://buildbot.python.org/all/#/builders/802/builds/582
See #101394
corona10 commentedon Feb 14, 2023
Linux 65cf87cd990d 6.1.9-200.fc37.aarch64 #1 SMP PREEMPT_DYNAMIC Thu Feb 2 00:41:31 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux
gvanrossum commentedon Feb 14, 2023
@corona10 If you found a suspect can you link it here?
corona10 commentedon Feb 15, 2023
Sure
corona10 commentedon Feb 15, 2023
@gvanrossum @sobolevn @mdickinson @brettcannon @exarkun
I finally found the suspect:
commit: 3325f05
PR: #94504
I run
./python -m test test_importlibrepeatedly 10 times onaarch64 RHEL8(rockylinux:8.7)with every single bisect commit :(When I revert the 3325f05, no more leak is detected.
The root cause has yet to be discovered.
gvanrossum commentedon Feb 15, 2023
Is the SEND fix it?
sobolevn commentedon Feb 15, 2023
@corona10 great work, thank you!
corona10 commentedon Feb 15, 2023
Do you mean c776624? No, it doesn't solve the issue.
gvanrossum commentedon Feb 15, 2023
Usually leaks are C code. There is no C code in the importlib PR. Maybe the blocking_on dict needs to be cleared?
corona10 commentedon Feb 15, 2023
I think sameway.
I will try it.
corona10 commentedon Feb 15, 2023
Yeah, this was the root cause. Amazing intuition!!
I am checking the proper solution.
gvanrossum commentedon Feb 15, 2023
Whenever there's a global cache you get things like this, I've debugged these since 2000. :-)
Good work finding the missing
del! And thanks for the hard work doing bisection.Also @sobolevn thanks for flagging this -- I had seen this occasionally but always just ignored it as being a flake. It was so much more than that!
All in all great teamwork.
pythongh-101766: Fix refleak for _BlockingOnManager resources
pythongh-101766: Fix refleak for _BlockingOnManager resources
gh-101766: Fix refleak for _BlockingOnManager resources (gh-101942)
corona10 commentedon Feb 17, 2023
Close this issue
And thank you for reporting this issue @sobolevn!!!
Revert "pythongh-101766: Fix refleak for _BlockingOnManager resources (…
pythongh-101766: Fix refleak for _BlockingOnManager resources
corona10 commentedon Feb 17, 2023
Re-open the issue due to #101942 (comment)
gh-101766: Fix refleak for _BlockingOnManager resources from test sui…