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 — Crash in PyDict_AsFrozenDictAndClear() with obj.__dict__ · Issue #161767 · python/cpython

Crash in PyDict_AsFrozenDictAndClear() with obj.__dict__ #161767

New issue
Copy link
New issue
Copy link
Open
Open
Crash in PyDict_AsFrozenDictAndClear() with obj.__dict__#161767
Copy link
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-C-APItype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump

Description

@iRELDevz
iRELDevz
opened on Nov 10, 2026
Issue body actions

Crash report

The frozendict C API crashes when given an instance __dict__ that still has inline values:

import _testcapi
class A: pass
a = A(); a.x = 1; a.y = 2
f = _testcapi.dict_as_frozendict_and_clear(a.__dict__)
a.x = 'MUTATED'
print(f)

Debug build fails an assertion in Objects/dictobject.c. The keys are moved to the frozendict but the values stay in the object's inline values, so both end up sharing them (use-after-free after del a).

CPython versions tested on:

CPython main branch

Operating systems tested on:

Windows

Output from running 'python -VV' on the command line:

Python 3.16.0a1+dev (heads/main:9d05428, Nov 10 2026, 19:53:18) [MSC v.1951 64 bit (AMD64)]

Linked PRs

  • gh-161767: Fix crash in PyDict_AsFrozenDictAndClear() with inline values #161768

Activity

  1. iRELDevz
    added
    type-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
    on Nov 10, 2026
  2. NekoAsakura
    added
    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
    topic-C-API
    on Nov 10, 2026
  3. iRELDevz
    added a commit that references this issue on Nov 11, 2026

    Merge branch 'main' into pythongh-161767-frozendict-inline-values

    a3112a5
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)topic-C-APItype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump

    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.