Crash in PyDict_AsFrozenDictAndClear() with obj.__dict__
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
Read the crash reproducer in the issue and inspect the relevant dict handling in Objects/dictobject.c, where the debug assertion fails. Start by tracing how PyDict_AsFrozenDictAndClear() handles instance dictionaries with inline values; done means the assertion passes and the frozen dictionary remains valid after mutating or deleting the original instance. The issue lists linked PR gh-161768, so check its status before starting.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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-161768
- Lenguaje dominante
- Python
- Estrellas
- 78.2k
- Forks
- 36.6k
- Merge medio
- 19 h 57 min
- PR fusionados (30 d)
- 630
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de python/cpython
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
stdlib type-bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
extension-modules stdlib topic-XML type-bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
python/cpython#161807 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
stdlib type-feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
python/cpython#161788 · 7 comentarios ·
Los mantenedores suelen responder en 1 día
-
extension-modules topic-IO type-bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
Todos los issues de python/cpython
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
cpp-best-practices/project_validator#267 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Project-N-E-K-O/N.E.K.O#3725 ·
Los mantenedores suelen responder en 1 día
-
[Bug] Sending a Telegram message chain twice duplicates mentionsPosiblemente ocupada @123XieC la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
AstrBotDevs/AstrBot#11125 ·
Los mantenedores suelen responder en 1 día
-
backend bug priority: high
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
nooriegarg/ContribIQ#73 ·
Los mantenedores suelen responder en 1 día
-
bug p3 security
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
amd/gaia#8197 · 2 comentarios ·
Los mantenedores suelen responder en 1 día