Title: hamt.c: sub_node leaked in bitmap_assoc and bitmap_without · Issue #150178 · python/cpython · GitHub
Open Graph Title: hamt.c: sub_node leaked in bitmap_assoc and bitmap_without · Issue #150178 · python/cpython
X Title: hamt.c: sub_node leaked in bitmap_assoc and bitmap_without · Issue #150178 · python/cpython
Description: Bug report Bug description: Bug report Bug description: Parent issue :#146102 Glist:https://gist.github.com/devdanzin/332a120e4c7750e8a7aff47419311696 Two analogous bugs: hamt_node_bitmap_assoc (line 704): Recursive hamt_node_assoc retur...
Open Graph Description: Bug report Bug description: Bug report Bug description: Parent issue :#146102 Glist:https://gist.github.com/devdanzin/332a120e4c7750e8a7aff47419311696 Two analogous bugs: hamt_node_bitmap_assoc (li...
X Description: Bug report Bug description: Bug report Bug description: Parent issue :#146102 Glist:https://gist.github.com/devdanzin/332a120e4c7750e8a7aff47419311696 Two analogous bugs: hamt_node_bitmap_assoc (li...
Opengraph URL: https://github.com/python/cpython/issues/150178
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"hamt.c: sub_node leaked in bitmap_assoc and bitmap_without","articleBody":"# Bug report\n\n### Bug description:\n\n# Bug report\n\n### Bug description:\n\nParent issue :https://github.com/python/cpython/issues/146102\nGlist:https://gist.github.com/devdanzin/332a120e4c7750e8a7aff47419311696\n\nTwo analogous bugs:\n1. hamt_node_bitmap_assoc (line 704): Recursive hamt_node_assoc returns new sub_node, then hamt_node_bitmap_clone fails → sub_node leaked. Line 755 correctly DECREFs.\n2. hamt_node_bitmap_without (line 997): Same pattern. Line 968 correctly DECREFs.\n\n### Fix:\n\nAdd Py_DECREF(sub_node) before return NULL/return W_ERROR\n\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\n_No response_\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-150179\n* gh-150301\n* gh-150303\n* gh-150302\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/lpyu001","@type":"Person","name":"lpyu001"},"datePublished":"2026-05-21T07:47:38.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/150178/cpython/issues/150178"}
| 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:af8a1a3d-f880-4195-4e0b-71795c065c3a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CED4:177F6A:2200FEB:2F47C7E:6A50BA87 |
| html-safe-nonce | 212ba1725432ea830384b8d5cc13dca47cbd641a0aa6038f8a372c70209af306 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRUQ0OjE3N0Y2QToyMjAwRkVCOjJGNDdDN0U6NkE1MEJBODciLCJ2aXNpdG9yX2lkIjoiMTY2MjY4OTc2MTcwODUyMjExOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 933a289eed74de566f18c0c9bf50ed1adebc0d44ae7a818bb546cb3fdbd0101b |
| hovercard-subject-tag | issue:4492734463 |
| 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/150178/issue_layout |
| twitter:image | https://opengraph.githubassets.com/dfceab7b122ed106f7e76721f2c0d82f7e072f562757e389025c993bef2d07d0/python/cpython/issues/150178 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/dfceab7b122ed106f7e76721f2c0d82f7e072f562757e389025c993bef2d07d0/python/cpython/issues/150178 |
| og:image:alt | Bug report Bug description: Bug report Bug description: Parent issue :#146102 Glist:https://gist.github.com/devdanzin/332a120e4c7750e8a7aff47419311696 Two analogous bugs: hamt_node_bitmap_assoc (li... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | lpyu001 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 72b13e0e8d0319acdd27a145cfe73f4f06c791713d0ac4690e41fb68ad28cac0 |
| 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 | 08e79d53fc070870d5b168356afebb1e286a2ffe |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width