Skip to content

Fix memory leaks in test_capi - #98017

Merged
JelleZijlstra merged 1 commit into
python:mainfrom
carljm:fixleak
Oct 7, 2022
Merged

JelleZijlstra merged 1 commit into
python:mainfrom
carljm:fixleak

Conversation

@carljm

@carljm carljm commented Oct 7, 2022

Copy link
Copy Markdown
Member

These memory leaks were recently introduced in #31787. Not sure if this fix qualifies as "trivial" or requires an issue also.

Before this fix, ./python -m test test_capi -R 3:3 reports a memory leak; after this fix it passes.

@kumaraditya303

Copy link
Copy Markdown
Contributor
@kumaraditya303 ➜ /workspaces/cpython (fixleak) $ ./python -m test test_capi -R 3:3
0:00:00 load avg: 0.98 Run tests sequentially
0:00:00 load avg: 0.98 [1/1] test_capi
beginning 6 repetitions
123456
......
test_capi passed in 38.6 sec

== Tests result: SUCCESS ==

1 test OK.

Total duration: 38.6 sec
Tests result: SUCCESS
@kumaraditya303

Copy link
Copy Markdown
Contributor

@vstinner: This PR fixes ref leak on main. Currently all refleak buildbots are failing. See https://buildbot.python.org/all/#/release_status

@vstinner

vstinner commented Oct 7, 2022

Copy link
Copy Markdown
Member

You may want to use test.support.catch_unraisable_exception context manager, but it only stores the latest unraisable exception.

@carljm

carljm commented Oct 7, 2022

Copy link
Copy Markdown
Member Author

Thanks @vstinner, included the switch to catch_unraisable_exception in #98055

@carljm
carljm deleted the fixleak branch October 7, 2022 19:35
@vstinner

vstinner commented Oct 8, 2022

Copy link
Copy Markdown
Member

Thanks @vstinner, included the switch to catch_unraisable_exception in #98055

Thanks! I like the new test code.

mpage pushed a commit to mpage/cpython that referenced this pull request Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

5 participants