Title: Re-entering pairwise.__next__() leaks references · Issue #109786 · python/cpython · GitHub
Open Graph Title: Re-entering pairwise.__next__() leaks references · Issue #109786 · python/cpython
X Title: Re-entering pairwise.__next__() leaks references · Issue #109786 · python/cpython
Description: Re-entering the __next__() method of itertools.pairwise leaks references, because old hold a borrowed reference when the __next__() method of the underlying iterator is called. It may potentially lead to the use of a freed memory and a c...
Open Graph Description: Re-entering the __next__() method of itertools.pairwise leaks references, because old hold a borrowed reference when the __next__() method of the underlying iterator is called. It may potentially l...
X Description: Re-entering the __next__() method of itertools.pairwise leaks references, because old hold a borrowed reference when the __next__() method of the underlying iterator is called. It may potentially l...
Opengraph URL: https://github.com/python/cpython/issues/109786
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Re-entering pairwise.__next__() leaks references","articleBody":"Re-entering the `__next__()` method of itertools.pairwise leaks references, because *old* hold a borrowed reference when the `__next__()` method of the underlying iterator is called. It may potentially lead to the use of a freed memory and a crash, but I only have reproducer for leaks.\r\n\r\nEven if the re-entrant call is not very meaningful, it should correctly count references. There are several ways to fix this issue. I choose the simplest one which matches the current results (only without leaks) in most of simple tests, even if there is no other reasons to prefer these results.\r\n\r\ncc @rhettinger\r\n\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-109788\n* gh-112699\n* gh-112700\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/serhiy-storchaka","@type":"Person","name":"serhiy-storchaka"},"datePublished":"2023-09-23T11:39:23.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/109786/cpython/issues/109786"}
| 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:5b212ca7-83f8-aa97-e459-0b4006f7b42a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D0B6:31785:2763067:385D36A:6A58FBF2 |
| html-safe-nonce | 2e7155ccdaccd562a668b520f11cfc909301bcacf5335a79c74687ea0a5fe90e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMEI2OjMxNzg1OjI3NjMwNjc6Mzg1RDM2QTo2QTU4RkJGMiIsInZpc2l0b3JfaWQiOiI0NDk1ODkyMDc4NDEzODA2NTc4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | ba672e7c5d51cf515e1e7f7659f8db1e3eac0d8e4866444784d94654d249b13d |
| hovercard-subject-tag | issue:1909838596 |
| 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/109786/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a0af5af9f30ee69f19719a9356155cdb861946b8cfde3058450010a7231eb52f/python/cpython/issues/109786 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a0af5af9f30ee69f19719a9356155cdb861946b8cfde3058450010a7231eb52f/python/cpython/issues/109786 |
| og:image:alt | Re-entering the __next__() method of itertools.pairwise leaks references, because old hold a borrowed reference when the __next__() method of the underlying iterator is called. It may potentially l... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | serhiy-storchaka |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f2a0c7865178af3d91dd9f13b0cdfc3c73a2529c873d2780bb4c01271a57ec6 |
| 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 | 8aae7b8d6caacacf5c66eaeb2702d8dc88d85b4a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width