GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — hamt.c: sub_node leaked in bitmap_assoc and bitmap_without · Issue #150178 · python/cpython

hamt.c: sub_node leaked in bitmap_assoc and bitmap_without #150178

New issue
Copy link
New issue
Copy link
Closed
Closed
hamt.c: sub_node leaked in bitmap_assoc and bitmap_without#150178
Copy link
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@lpyu001
lpyu001
opened on May 21, 2026
Issue body actions

Bug report

Bug description:

Bug report

Bug description:

Parent issue :#146102
Glist:https://gist.github.com/devdanzin/332a120e4c7750e8a7aff47419311696

Two analogous bugs:

  1. 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.
  2. hamt_node_bitmap_without (line 997): Same pattern. Line 968 correctly DECREFs.

Fix:

Add Py_DECREF(sub_node) before return NULL/return W_ERROR

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

  • gh-150178: Fix refcount leaks in hamt allocation failure paths #150179
  • [3.13] gh-150178: Fix refcount leaks in hamt allocation failure paths (GH-150179) #150301
  • [3.15] gh-150178: Fix refcount leaks in hamt allocation failure paths (GH-150179) #150303
  • [3.14] gh-150178: Fix refcount leaks in hamt allocation failure paths (GH-150179) #150302

Activity

  1. lpyu001
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on May 21, 2026
  2. aisk
    added
    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
    on May 21, 2026
  3. aisk
    added a parent issue on May 21, 2026
    • Umbrella issue: bugs found using cpython-review-toolkit #146102
  4. kumaraditya303
    added a commit that references this issue on May 23, 2026

    gh-150178: Fix refcount leaks in hamt allocation failure paths (#150179)

    32823af
  5. kumaraditya303
    closed this as completedon May 23, 2026
  6. kumaraditya303
    added 3 commits that reference this issue on May 23, 2026

    [3.13] gh-150178: Fix refcount leaks in hamt allocation failure paths (…

    95c9323

    [3.15] gh-150178: Fix refcount leaks in hamt allocation failure paths (…

    6b17d1a

    [3.14] gh-150178: Fix refcount leaks in hamt allocation failure paths (…

    5676bfc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.