0
0
mirror of https://github.com/python/cpython.git synced 2024-11-28 16:45:42 +01:00
cpython/Objects
Sam Gross 4b63cd170e
gh-122527: Fix a crash on deallocation of PyStructSequence (GH-122577)
The `PyStructSequence` destructor would crash if it was deallocated after
its type's dictionary was cleared by the GC, because it couldn't compute
the "real size" of the instance. This could occur with relatively
straightforward code in the free-threaded build or with a reference
cycle involving the type in the default build, due to differing orders
in which `tp_clear()` was called.

Account for the non-sequence fields in `tp_basicsize` and use that,
along with `Py_SIZE()`, to compute the "real" size of a
`PyStructSequence` in the dealloc function. This avoids the accesses to
the type's dictionary during dealloc, which were unsafe.
2024-08-02 18:11:44 +02:00
..
clinic
mimalloc
stringlib
abstract.c
boolobject.c
bytearrayobject.c Replace PyObject_Del with PyObject_Free (#122453) 2024-08-01 14:12:33 +02:00
bytes_methods.c
bytesobject.c Replace PyObject_Del with PyObject_Free (#122453) 2024-08-01 14:12:33 +02:00
call.c
capsule.c
cellobject.c
classobject.c
codeobject.c Replace PyObject_Del with PyObject_Free (#122453) 2024-08-01 14:12:33 +02:00
complexobject.c Replace PyObject_Del with PyObject_Free (#122453) 2024-08-01 14:12:33 +02:00
descrobject.c
dictnotes.txt
dictobject.c gh-120974: Make asyncio swap_current_task safe in free-threaded build (#122317) 2024-08-02 19:02:08 +05:30
enumobject.c
exceptions.c
fileobject.c Replace PyObject_Del with PyObject_Free (#122453) 2024-08-01 14:12:33 +02:00
floatobject.c gh-100240: Use a consistent implementation for freelists (#121934) 2024-07-22 12:08:27 -04:00
frameobject.c gh-120906: Support arbitrary hashable keys in FrameLocalsProxy (GH-122309) 2024-07-30 22:11:00 +00:00
funcobject.c gh-122229: Add missing Py_DECREF in func_get_annotation_dict (#122230) 2024-07-24 05:47:52 -07:00
genericaliasobject.c gh-119180: Add evaluate functions for type params and type aliases (#122212) 2024-07-27 17:24:10 +00:00
genobject.c GH-118093: Improve handling of short and mid-loop traces (GH-122252) 2024-07-29 14:49:17 -07:00
iterobject.c
listobject.c gh-100240: Use a consistent implementation for freelists (#121934) 2024-07-22 12:08:27 -04:00
listsort.txt
lnotab_notes.txt
longobject.c
memoryobject.c
methodobject.c
moduleobject.c gh-116322: Fix typo in the #ifdef check (#122268) 2024-07-25 20:01:57 +05:30
namespaceobject.c
object_layout_312.gv
object_layout_312.png
object_layout_313.gv
object_layout_313.png
object_layout_full_312.gv
object_layout_full_312.png
object_layout_full_313.gv
object_layout_full_313.png
object_layout.md
object.c gh-116622: Fix testPyObjectPrintOSError on Android (#122487) 2024-07-31 08:21:43 +08:00
obmalloc.c
odictobject.c Replace PyObject_Del with PyObject_Free (#122453) 2024-08-01 14:12:33 +02:00
picklebufobject.c
rangeobject.c Replace PyObject_Del with PyObject_Free (#122453) 2024-08-01 14:12:33 +02:00
README
setobject.c
sliceobject.c gh-100240: Use a consistent implementation for freelists (#121934) 2024-07-22 12:08:27 -04:00
structseq.c gh-122527: Fix a crash on deallocation of PyStructSequence (GH-122577) 2024-08-02 18:11:44 +02:00
tupleobject.c gh-100240: Use a consistent implementation for freelists (#121934) 2024-07-22 12:08:27 -04:00
typeobject.c Replace PyObject_Del with PyObject_Free (#122453) 2024-08-01 14:12:33 +02:00
typeslots.inc
typeslots.py
typevarobject.c gh-122361: Use proper PyUnicodeWriter_* API in constevaluator_call (#122362) 2024-07-27 21:33:38 +03:00
unicodectype.c
unicodeobject.c Replace PyObject_Del with PyObject_Free (#122453) 2024-08-01 14:12:33 +02:00
unicodetype_db.h
unionobject.c gh-119180: Add evaluate functions for type params and type aliases (#122212) 2024-07-27 17:24:10 +00:00
weakrefobject.c

Source files for various builtin objects