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 — marshal.c: 8 refs leaked on corrupt TYPE_CODE marshal stream · Issue #148418 · python/cpython

marshal.c: 8 refs leaked on corrupt TYPE_CODE marshal stream #148418

New issue
Copy link
New issue
Copy link
Closed
Closed
marshal.c: 8 refs leaked on corrupt TYPE_CODE marshal stream#148418
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

@Wulian233
Wulian233
opened on Apr 12, 2026
Issue body actions

Bug report

Bug description:

Parent: #146121

https://gist.github.com/devdanzin/60b787bfa22651ba6a18aef3b6e1439d/raw/5b12fb962510aed36b457ae3670424bbb91ecacd/marshal_type_code_leak.md

In r_object TYPE_CODE case (line 1601-1602), when firstlineno == -1 && PyErr_Occurred(), code does break instead of goto code_error. Skips cleanup of 8 owned refs. Reachable via marshal.loads() with crafted input.

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

  • gh-148418: Fix a possible reference leak in a corrupted TYPE_CODE marshal stream #148419
  • [3.14] gh-148418: Fix a possible reference leak in a corrupted TYPE_CODE marshal stream (GH-148419) #149363
  • [3.13] gh-148418: Fix a possible reference leak in a corrupted TYPE_CODE marshal stream (GH-148419) #149364

Activity

  1. Wulian233
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Apr 12, 2026
  2. Wulian233
    added a commit that references this issue on Apr 12, 2026

    pythongh-148418: Fix a possible reference leak in a corrupted ``TYPE_…

    6855d74
  3. aisk
    added a parent issue on Apr 12, 2026
    • Umbrella issue: bugs found using cpython-review-toolkit #146102
  4. aisk
    added
    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
    extension-modulesC modules in the Modules dirC modules in the Modules dir
    and removed
    extension-modulesC modules in the Modules dirC modules in the Modules dir
    on Apr 12, 2026
  5. serhiy-storchaka
    added a commit that references this issue on May 4, 2026

    gh-148418: Fix a possible reference leak in a corrupted TYPE_CODE mar…

    c3972f2
  6. serhiy-storchaka
    closed this as completedon May 4, 2026
  7. serhiy-storchaka
    added 2 commits that reference this issue on May 4, 2026

    [3.13] gh-148418: Fix a possible reference leak in a corrupted TYPE_C…

    6d6471b

    [3.14] gh-148418: Fix a possible reference leak in a corrupted TYPE_C…

    95979d1
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 01402520 — 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.