Title: `test_free_threading.test_monitoring` flaky (occasional reference leak) · Issue #136692 · python/cpython · GitHub
Open Graph Title: `test_free_threading.test_monitoring` flaky (occasional reference leak) · Issue #136692 · python/cpython
X Title: `test_free_threading.test_monitoring` flaky (occasional reference leak) · Issue #136692 · python/cpython
Description: Bug report When running ./python -E -m test --timeout=2700 -R3:3 -u-cpu -j40 test_free_threading.test_monitoring -F, I get a failure every ~50-100 test runs: 0:00:36 load avg: 122.12 [ 55/1] test_free_threading.test_monitoring failed (re...
Open Graph Description: Bug report When running ./python -E -m test --timeout=2700 -R3:3 -u-cpu -j40 test_free_threading.test_monitoring -F, I get a failure every ~50-100 test runs: 0:00:36 load avg: 122.12 [ 55/1] test_f...
X Description: Bug report When running ./python -E -m test --timeout=2700 -R3:3 -u-cpu -j40 test_free_threading.test_monitoring -F, I get a failure every ~50-100 test runs: 0:00:36 load avg: 122.12 [ 55/1] test_f...
Opengraph URL: https://github.com/python/cpython/issues/136692
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`test_free_threading.test_monitoring` flaky (occasional reference leak)","articleBody":"# Bug report\n\nWhen running `./python -E -m test --timeout=2700 -R3:3 -u-cpu -j40 test_free_threading.test_monitoring -F`, I get a failure every ~50-100 test runs:\n\n```\n0:00:36 load avg: 122.12 [ 55/1] test_free_threading.test_monitoring failed (reference leak)\nbeginning 6 repetitions. Showing number of leaks (. for 0 or less, X for 10 or more)\n123:456\nXX. 243\ntest_free_threading.test_monitoring leaked [2, 4, 3] memory blocks, sum=9\n```\n\nI think the issue is that we rely on `Thread.is_alive()` instead of joining the threads. I think there are still some objects that may not be freed until the thread is joined (like the handle):\n\nhttps://github.com/python/cpython/blob/cb59eaefeda5ff44ac0c742bff2b8afc023be313/Lib/test/test_free_threading/test_monitoring.py#L65-L77\n\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-136896\n* gh-141832\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/colesbury","@type":"Person","name":"colesbury"},"datePublished":"2025-07-15T18:43:35Z","url":"https://github.com/python/cpython/issues/136692"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:3b7d0732-d6b4-c113-f1fb-ae77461c08e2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C594:161320:17C4E38:1F79C6B:6B020B55 |
| html-safe-nonce | f0a2c0eaf23ab6d4b2c5f080a9f735549f7998d97b44685e1f9705fddf65c991 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNTk0OjE2MTMyMDoxN0M0RTM4OjFGNzlDNkI6NkIwMjBCNTUiLCJ2aXNpdG9yX2lkIjoiMzMwNjU4MjI2NjU2MTU2MzQ3NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 9fda65c55c67da37f81fef2d43f15ea297c092bb0a4ee7b3789c3d3de05d9e7f |
| hovercard-subject-tag | issue:3233335536 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/136692/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e765f6ef7ea37801ac8fe60d0522ff9a5145c86be104259671974933766cfb8e/python/cpython/issues/136692 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e765f6ef7ea37801ac8fe60d0522ff9a5145c86be104259671974933766cfb8e/python/cpython/issues/136692 |
| og:image:alt | Bug report When running ./python -E -m test --timeout=2700 -R3:3 -u-cpu -j40 test_free_threading.test_monitoring -F, I get a failure every ~50-100 test runs: 0:00:36 load avg: 122.12 [ 55/1] test_f... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | colesbury |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width